Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am thecapacity on github.
  • I am wjhuie (https://keybase.io/wjhuie) on keybase.
  • I have a public key whose fingerprint is C404 81E0 563E 6CFA FF8D CD5A D0C3 C468 BBE2 9B9E

To claim this, I am signing this object:

#!/usr/bin/env python
# -*- coding: ascii -*-
### Sample Usage: for f in `ls *.md`; do html_unescape.py $f > ok && mv ok $f; done
import sys
import codecs
import HTMLParser
h = HTMLParser.HTMLParser()
@thecapacity
thecapacity / pop_search.py
Last active August 29, 2015 14:00
Testing parms for efficiently searching a given population for duplicates with a given sample size and number of iterations
#!/usr/bin/env python
from optparse import OptionParser
import collections
import itertools
import random
import math
import profile
import sys
@thecapacity
thecapacity / receive_wahoo_data.py
Created April 7, 2013 17:32
Receive Wahoo Fitness "Air Broadcaster" data
#!/usr/bin/python
import socket
import json
UDP_IP = "0.0.0.0"
UDP_PORT = 51530
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) # UDP
sock.bind((UDP_IP, UDP_PORT))
@thecapacity
thecapacity / kinect_demo_tilt_scroll.py
Created February 19, 2013 00:14
Simple demo for using Kinect with freenect's python wrapper
#!/usr/bin/env python
import freenect
import time
import sys
TILT_MAX = 30
TILT_STEP = 10
TILT_START = 0
if sys.argv[1]: TILT_MAX = int(sys.argv[1])