Tuesday, May 1, 2018

Swift: fix invalid url

Some urls contain special characters or contain arabic words and when you parse this url on swift you will get "Invalid url request" error.

to resolve this problem it very easy but i take long time with searching on google about it after if find the solution :


feed?.link.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)
let url = URL(string: (feed?.link)!)



Good Luck :)

Thursday, February 22, 2018

To add new keyboard layout i3wm


To add secandary layout for i3wm it's just simple like like this to add in config file

~/.config/i3/config :
  
exec setxkbmap -layout us,ar -option grp:alt_shift_toggle

This comman is adding arabic as second layout and use same windows switch keys "ALT+SHIFT".

and this comman it's work on command line also but without exec .



Have fun :D