Skip to content

Instantly share code, notes, and snippets.

View gerred's full-sized avatar
:octocat:

Gerred Dillon gerred

:octocat:
View GitHub Profile
@gerred
gerred / haproxy.cfg.tmpl
Created November 25, 2014 23:06
Configs
global
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
chroot /var/lib/haproxy
user haproxy
group haproxy
# daemon
defaults
log global
select contract, sum(amount) as total from transactions where org_id = 1 and (expires is null or expires > now()) group by contract having sum(amount) > 0;
MediaStreamTrack.getSources(function(sources) {
navigator.webkitGetUserMedia({video: {optional: [{sourceId: sources[4]}]}}, function(stream) {
var video = document.querySelector('video')
video.src = window.webkitURL.createObjectURL(stream)
}, function(err) {})
})
http://plnkr.co/edit/G6wObW2hXYvqlGcGJoEU?p=preview
http://plnkr.co/edit/uZ4qQDJIH2htNXLswsqY?p=preview
http://plnkr.co/edit/GrKmTFPfzkFvVWi1vkKJ?p=preview
http://plnkr.co/edit/Z7wrznN1l7i469cYEOke?p=preview
http://plnkr.co/edit/mONgKU4XRqZlJ5RPKDQL?p=preview
http://plnkr.co/edit/11BbgDmxH2nDntgYLO1V?p=preview
#!/bin/bash
# note, the first time you run this on your computer, you'll need to run this a second time
# steps:
# make a change to the site under the master branch
# commit and push that change
# fetch all, making sure that you're tracking gh-pages
# run this script
@gerred
gerred / gist:11150542
Created April 21, 2014 17:52
doing some config building with through2
var through = require('through2')
var path = require('path')
var File = require('gulp-util').File
var yaml = require('js-yaml')
var configBuilder = function(fileName) {
var buffer = [];
var firstFile = null;
return through.obj(function(file, enc, cb) {
buffer.push(file.frontMatter);
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD4jHxEJvqfnPM+1Tropn/J551X0HW7cVlGF2RyK/y5meRxrHG//AAdZfEt5fhRFu2JQx/CvlKkl30bYmJEOhOzHfZc+HWrfSxYURKLJd3su+3Llms0ZPkQiJQp15OLeFUvWEZRHNO1SVH/UbBRIea71FGV+PFA9kpOCdgjSBLaG2+hzQ08xcRN62ZElv3Wg51J8ccv5NtfIqiuekH1bEcJeBUxt2unToDcZ8twSyNpZTO3EclVfASFGABhv5C3f7nt8IrZY83+tcauH4byx+Cpy+OlYdVAs2OVT8QQ/yXSQXcW9enwfmL667XtLGFBzXYJ6VpLuLhT2g+4wGRlVLzh [email protected]
function parseThrift(thriftEncodedData, callback) {
var thrift = require('thrift');
var transport = new thrift.TBufferedTransport(thriftEncodedData);
var protocol = new thrift.TBinaryProtocol(transport);
var clientClass = require('./gen-nodejs/observation_types').Observation;
var client = new clientClass();
client.read(protocol);
callback(null, client);
}
### Keybase proof
I hereby claim:
* I am gerred on github.
* I am gerred (https://keybase.io/gerred) on keybase.
* I have a public key whose fingerprint is 5816 134F DC84 C8A3 8A46 3F9C 7011 BD5F 80A2 9193
To claim this, I am signing this object:
{ file: '/Users/gerred/dev/pw_threat_console/bower_components/angular/angular.js',
info:
{ package_json: '/Users/gerred/dev/pw_threat_console/package.json',
packageDir: '/Users/gerred/dev/pw_threat_console/',
shim: { exports: 'angular', depends: undefined },
exposeGlobals: {},
browser:
{ jquery: './bower_components/jquery/dist/jquery.js',
lodash: './bower_components/lodash/dist/lodash.js',
angular: './bower_components/angular/angular.js',