NHITY23HIXZZXKKRU5SBD2PWJDV4ZG6MM2FDDIY4TCQU672B3BQQC #!/usr/bin/env awk -f# Waterman's Algorithm R for random sampling# by way of Knuth's The Art of Computer Programming, volume 2BEGIN {if (!n) {print "Usage: sample.awk -v n=[size]"exit}t = nsrand()}NR <= n {pool[NR] = $0places[NR] = NRnext}NR > n {t++M = int(rand()*t) + 1if (M <= n) {READ_NEXT_RECORD(M)}}END {if (NR < n) {print "sample.awk: Not enough records for sample" \> "/dev/stderr"exit}# gawk needs a numeric sort function# since it doesn't have one, zero-pad and sort alphabeticallypad = length(NR)for (i in pool) {new_index = sprintf("%0" pad "d", i)newpool[new_index] = pool[i]}x = asorti(newpool, ordered)for (i = 1; i <= x; i++)print newpool[ordered[i]]}function READ_NEXT_RECORD(idx) {rec = places[idx]delete pool[rec]pool[NR] = $0places[idx] = NR}
#!/usr/bin/env zshgit remote | (while read -r remote; doprintf "Pushing to %s\n" "$remote..."git push --all "$@" "$remote"git push --tags "$remote"done)
#!/usr/bin/env zshtmux lsattach_tmux () {TMUX_SESSION="$1"tmux attach -t "$TMUX_SESSION" -d}new_tmux () {TMUX_SESSION="$1"exec tmux new-session -s "$TMUX_SESSION"}if [[ x"$1" == x ]]; thenecho -n "Which session? "read TMUX_SESSIONif [[ "$TMUX_SESSION"x != ""x ]]; thenattach_tmux "$TMUX_SESSION" && exit 0fiecho -n "No such session '$TMUX_SESSION', new session [y/N]? "read NEW_SESSIONNEW_SESSION="${NEW_SESSION/Y/y}"if [[ x"${NEW_SESSION[1]}" == x'y' ]]; thennew_tmux "$TMUX_SESSION"fiecho "Either you decided not to create a new session or something went _horribly_ wrong!"read BOBelseattach_tmux "$1" || new_tmux "$1"fi
(add-hook 'after-init-hook (evil-mode))(add-hook 'after-init-hook 'paredit-mode)(add-hook 'after-init-hook 'evil-paredit-mode)(add-hook 'after-init-hook 'global-company-mode)(add-hook 'after-init-hook 'global-linum-mode)
(add-hook 'after-init-hook(lambda ()(unless (server-running-p)(server-start))(evil-mode)(paredit-mode)(evil-paredit-mode)(global-company-mode)(global-linum-mode)))