Skip to content

Instantly share code, notes, and snippets.

@bhurlow
bhurlow / gist:8985709
Created February 13, 2014 22:59
example webhook
{ ref: 'refs/heads/deploy',
after: '9e597618cb9102c993b3245f4e7c0843131ce335',
before: '85a5d3681c47658c4e0a667472a17a754c22055d',
created: false,
deleted: false,
forced: false,
compare: 'https://github.com/XXXXXX/XXXXXX/compare/85a5d3681c47...9e597618cb91',
commits:
[ { id: '9e597618cb9102c993b3245f4e7c0843131ce335',
distinct: true,
@bhurlow
bhurlow / gist:9060828
Created February 17, 2014 22:49
upstart script
description "PROCESS"
author "breez"
# used to be: start on startup
# until we found some mounts weren't ready yet while booting:
start on started mountall
stop on shutdown
# Automatically Respawn:
# respawn
var util = require('util');
var Transform = require('stream').Transform;
util.inherits(SizeStream, Transform);
function SizeStream() {
if (!(this instanceof SizeStream))
return new SizeStream()
Transform.call(this)
}
@bhurlow
bhurlow / go.sh
Created April 7, 2014 02:58
iphone
open /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app
@bhurlow
bhurlow / gist:10201211
Created April 8, 2014 22:14
node tail -f
var spawn = require('child_process').spawn
var tail = spawn('tail', ['-f', 'dicks.log'])
tail.stdout.pipe(process.stdout)
setTimeout(tick.bind(this), 1000)
@bhurlow
bhurlow / gist:4e91523fbf2095a7087c
Created May 12, 2014 19:24
order of opts matters for event emitter constructors
function limb() {
ee.call(this)
var self = this
this.emit('canemit')
}
// this before the inherits call wont work
module.exports = new limb
node -e "console.log(require('os').cpus().length)"
if (0 != url.indexOf('http')) url = 'http://' + url;
site = url.parse(site).protocol ? site : 'http://' + site;
@bhurlow
bhurlow / gist:2db0deb2223680e9c387
Last active August 29, 2015 14:01
docker snippets
docker rm $(docker ps -a -q)
docker rmi $(docker images | grep "^<none>" | awk "{print $3}")