Skip to content

Instantly share code, notes, and snippets.

Avatar

christopher holt cwholt

View GitHub Profile
View gist:a934ef4a7d17e5d92856
var http = require('http')
function Wat() {
this.get = function(cb) {
function callback(response) {
console.log("callback");
}
var req = http.request({
host: "localhost",
@cwholt
cwholt / keybase.md
Last active Aug 29, 2015
keybase.md
View 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:

View gist:7108358
Carnosine 500mg - 1 daily
Rosemaria - 2 daily
Meriva-SR (curcumin) - Throne - 2 twice daily
D3 (50000 IU) - 1 weekly
Imunai - 2 daily
Shitake - 2 daily
Chaga Mushroom (1000 MG) - 1 twice daily
Alpha GPC 300MG (Jarrow) - 2 daily
Bacopa - 2 pills 2 times daily
Magnolia Extract (Nutricology) 200MG - 1 daily
@cwholt
cwholt / Autocomplete.js
Created Feb 17, 2012
node.js + redis prefix trie (autocomplete)
View Autocomplete.js
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);
View gist:1658356
<html>
<head>
<title>sup</title>
<script src='https://ajax.googleapis.com/ajax/libs/jquery/1.6.3/jquery.min.js' type='text/javascript'></script>
<script type="text/javascript">
var zoom = 14;
var startX = 5207;
var startY = 7350;
var right = 16;
var down = 6;
View gist:1349608
var Sprite = {
image: null,
delay: 100,
width: 0,
height: 0,
steps: 15,
frame: 0,
interval: null,
initialize: function() {
Sprite.interval != null && clearInterval(Sprite.interval);
@cwholt
cwholt / gist:1340782
Created Nov 4, 2011
chef script to get all ipv4 address from all nodes
View gist:1340782
addresses = Array.new
search(:node).each do |n|
n[:network][:interfaces].each do |eth,eth_config|
next unless eth_config[:addresses]
eth_config[:addresses].each do |address,details|
addresses << address if details[:family] == "inet" && address != "127.0.0.1"
end
end
end
@cwholt
cwholt / gist:1032827
Created Jun 18, 2011
turntable.fm download current playing song (adds to mouseover "Add song to:")
View gist:1032827
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']))}))