Skip to content

Instantly share code, notes, and snippets.

@cwalkatron
cwalkatron / keybase.md
Created April 11, 2014 02:16
My Keybase proof!

Keybase proof

I hereby claim:

  • I am cwalkatron on github.
  • I am cwalkatron (https://keybase.io/cwalkatron) on keybase.
  • I have a public key whose fingerprint is 0635 7954 859B EB26 5FD7 7999 D02F C0B2 B828 8846

To claim this, I am signing this object:

@cwalkatron
cwalkatron / find-orphans.py
Created July 16, 2013 03:44
Find all the orphaned images. You'll have to walk the imgdir instead of just `listdir`ing it.
#!/usr/bin/env python
# ./find-orphans.py HTMLDIR IMGDIR
import os, HTMLParser, sys
from HTMLParser import HTMLParser
htmldir = sys.argv[1]
imgdir = sys.argv[2]
@cwalkatron
cwalkatron / gist:5614225
Created May 20, 2013 18:30
defaultdict use
# instead of this
x, y, z = 1, 2, 3
d = {}
if not d.has_key(x):
d[x] = {}
if not d[x].has_key(y):
d[x][y] = []
d[x][y].append(z)
# this
set -g default-command zsh
# BOOM
set -g default-terminal "screen-256color"
set -g history-limit 10000
# Display on Linux
setenv DISPLAY :0
set -g update-environment "SSH_AUTH_SOCK SSH_ASKPASS WINDOWID SSH_CONNECTION XAUTHORITY"
# use a different control key