Skip to content

Instantly share code, notes, and snippets.

View kousu's full-sized avatar

Nick Guenther kousu

  • Asymmetric Research
  • Canada
View GitHub Profile
@kousu
kousu / lol.sh
Created July 12, 2014 01:02
nonblocking pipes with Popen
#!/bin/bash -e
i=0
while true; do
echo "yadda yadda ||$i||"
sleep 3;
i=$(($i+1))
done
#while true; do #HILARIOUS:
def humanized_diff(L, delta):
"""
Convert the given (sorted!!) tabular diff to a string,
marked up with +s and -s, similar to regular diff(1)'s "-u" mode.
"""
D, A = delta
U, D = drop(L, D), [L[i] for i in D]
def prefix(v, S):