Last active
December 21, 2015 22:19
-
-
Save terryoy/6374725 to your computer and use it in GitHub Desktop.
Useful Alias
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# open a browser and view raw html (e.g. "cat some.html | viewhtml") | |
alias viewhtml='firefox "data:text/html;charset=utf-8;base64,$(base64 -w 0 <&0)"' | |
# url encode / decode | |
alias urlencode='python -c "import sys, urllib as ul; print ul.quote_plus(sys.argv[1])"' | |
alias urldecode='python -c "import sys, urllib as ul; print ul.unquote_plus(sys.argv[1])"' | |
# url shortener | |
alias shortenurl="python -c \"import sys, urllib as ul; print ul.urlopen('http://tinyurl.com/api-create.php?url=%s' % ul.quote_plus(sys.argv[1])).readline()\"" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment