If a user is modifying the .gist file by hand there is a big risk that the user adds a newline to the file. That newline is causing gist to fail with "Error: Got Net::HTTPUnauthorized from gist:". So better remove the eventual newline with chomp before use. This is extra handy when setting up gist on an computer that you don't trust with your real GitHub credentials (pre-generated OAuth token).
…: non-authed user}
for anonymous users, the url returns from gist api is something like https://gist.github.com/7216441 , and it would redirect to https://gist.github.com/anonymous/7216441, it's not easy to get the raw file url by scripting. this commit make the hack to handle the HTTPRedirection, and concate the result url with /raw to generate the raw url.
Unlike `xclip`, calling `xsel` without any argument outputs the selection. In other words, `xclip` defaults to `xclip -i`, but xsel` defaults to `xsel -o`. Thus we should use `xsel -i` instead of `xsel` for copying the url to clipboard.