Skip to content

Instantly share code, notes, and snippets.

View cwholt's full-sized avatar

christopher holt cwholt

View GitHub Profile
@cwholt
cwholt / keybase.md
Last active August 29, 2015 13:59
keybase.md

Keybase proof

I hereby claim:

  • I am cwholt on github.
  • I am cwh (https://keybase.io/cwh) on keybase.
  • I have a public key whose fingerprint is AFE1 EDE8 F6A1 1533 605A 39D8 8E9E 8153 086C A278

To claim this, I am signing this object:

@cwholt
cwholt / Autocomplete.js
Created February 17, 2012 16:39
node.js + redis prefix trie (autocomplete)
module.exports = function(redisClient,prefix) {
var Autocomplete = {};
Autocomplete.prefix = prefix;
Autocomplete.terminal = "+";
Autocomplete.add = function(word, next) {
function add(letters, key, last, x) {
var letter = last ? Autocomplete.terminal : letters[x];
var score = last ? 0 : letter.charCodeAt(0);
@cwholt
cwholt / gist:1032827
Created June 18, 2011 05:14
turntable.fm download current playing song (adds to mouseover "Add song to:")
javascript:var cwh;for(i in turntable)cwh||(cwh=i);$('#songboard_add').append($('<div>',{'class':'btn disk'}).css({'background-image':'url(http://s3.firstrule.net/cwh/cwh_ttfm_disk_dark.png)'}).click(function(x){window.open(location.protocol+"//"+location.host+"/getfile/?roomid="+turntable[cwh]['roomId']+"&rand="+Math.random()+"&fileid="+turntable[cwh]['currentSong']['_id']+"&downloadKey="+$.sha1(turntable[cwh]['currentSong']['_id']+turntable[cwh]['roomId']))}))