Skip to content

Instantly share code, notes, and snippets.

View cwholt's full-sized avatar

christopher holt cwholt

View GitHub Profile
@cwholt
cwholt / gist:a934ef4a7d17e5d92856
Created March 31, 2015 16:56 — forked from crash2burn/gist:76c840a05416dd394179
node --expose-gc test.js
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 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 / gist:7108358
Created October 22, 2013 21:18
SUPPLEMENTS
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 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:1658356
Created January 22, 2012 19:17
gmap hax
<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;
@cwholt
cwholt / gist:1349608
Created November 8, 2011 23:06
sprite animator
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 November 4, 2011 23:29
chef script to get all ipv4 address from all nodes
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 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']))}))