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
m=(3{0,2,4,7}\;4{0,2,4,7}) w=(0 1111 47f3 0fa 0ea cbb 1 1514 47f3 3ea caa0f bb0c 1 0101 0457 03fec 3faa2 3b88b3 2 0{011,57f7,0fa,caa} f88bb 4 1111 57f3 0eb 0ea cbb 5 1514 47f3 0eb 0ae0f bb0c 5 0{101,457,0efc,0ae3} 3b88b3 6 0{011,57f7,0fa,0ae} f88bb);for((i=0;i<75;x=++i/8*8+w[i%8*6])){ sleep .1;tput cup 0;for r in {1..5};{ printf %$x.s;eval printf %b▀ '\\e[${m[0x${w[i%8*6+r]:'{0..6}:1}]}m;echo;};} |
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
# Usage: gist url-or-hash or gist [-p] [file...] | |
# | |
# Given a url or hash, print a dump of the gist. Otherwise, create a new | |
# gist of the given file arguments, or stdin if no files are given. | |
# -p forces the arguments to be treated as files to be posted. | |
# | |
# Examples: | |
# | |
# - dump a gist in the terminal: | |
# gist https://gist.github.com/geirha/15103ebee61f2b129f2897be2397da2a |
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
urlencode() { | |
# urlencode <string> | |
local LC_ALL=C c i n | |
for (( i = 0, n = ${#1}; i < n; i++ )); do | |
c=${1:i:1} | |
case $c in | |
[[:alnum:].~_-]) printf %s "$c" ;; | |
*) printf %%%02X "'$c" ;; | |
esac | |
done |