Skip to content

Instantly share code, notes, and snippets.

View ctrlcctrlv's full-sized avatar
🛠️
happy hacking

Fredrick Brennan ctrlcctrlv

🛠️
happy hacking
View GitHub Profile
def _mturk_flatten(obj):
if isinstance(obj, basestring):
return {"": obj}
elif isinstance(obj, collections.Mapping):
iterable = obj.items()
elif isinstance(obj, collections.Iterable):
iterable = enumerate(obj)
else:
return {"": obj}
@msimpson
msimpson / pipes
Created July 21, 2011 10:40
2D Bash version of the Pipes screensaver.
#!/bin/bash
declare -i f=75 s=13 r=2000 t=0 c=1 n=0 l=0
declare -ir w=$(tput cols) h=$(tput lines)
declare -i x=$((w/2)) y=$((h/2))
declare -ar v=( [00]="\x83" [01]="\x8f" [03]="\x93"
[10]="\x9b" [11]="\x81" [12]="\x93"
[21]="\x97" [22]="\x83" [23]="\x9b"
[30]="\x97" [32]="\x8f" [33]="\x81" )
OPTIND=1