Skip to content

Instantly share code, notes, and snippets.

View davidbanham's full-sized avatar

David Banham davidbanham

View GitHub Profile
.printonly {
display: none;
}
@media print {
.noprint, nav, footer {
display: none;
}
.printonly {
display: block;
package main
import (
"context"
"crypto/tls"
"fmt"
"log"
"net/http"
"os"
"strings"
@davidbanham
davidbanham / Infinite_Gist.js
Last active December 21, 2015 09:07
Infinite Gist
while (true) {console.log('Man, you know I can\'t eat your ghost chups.')}
@davidbanham
davidbanham / gist:7e4ab9e54f2706554f01
Created June 25, 2015 01:35
Electron segfault cased by resolveProxy
Process: Electron [45085]
Path: /Users/USER/Downloads/*/Electron.app/./Contents/MacOS/Electron
Identifier: com.github.electron
Version: 0.28.3
Code Type: X86-64 (Native)
Parent Process: zsh [43882]
Responsible: iTerm [294]
User ID: 501
Date/Time: 2015-06-25 11:33:25.927 +1000
# Welcome to the InfluxDB configuration file.
# If hostname (on the OS) doesn't return a name that can be resolved by the other
# systems in the cluster, you'll have to set the hostname to an IP or something
# that can be resolved here.
# hostname = ""
hostname = "influxdb_internal.[redacted]"
bind-address = "0.0.0.0"
> rs.status()
{
"info" : "run rs.initiate(...) if not yet done for the set",
"ok" : 0,
"errmsg" : "no replset config has been received",
"code" : 94
}
>
ordermentum:PRIMARY> rs.add("mongod2")
{ "ok" : 1 }
ordermentum:PRIMARY> rs.add("mongod3")
{ "ok" : 1 }
ordermentum:PRIMARY> rs.status()
{
"set" : "ordermentum",
"date" : ISODate("2015-04-20T01:28:47.456Z"),
"myState" : 1,
"members" : [
@davidbanham
davidbanham / gist:d3278a60dfa0f105ecff
Last active August 29, 2015 14:15
Salt role matching issue
Roles as per grains.item
roles:
- field-marshal
Matcher in top.sls:
'role:field-marshal':
- match: grain
- field-marshal
@davidbanham
davidbanham / repl.js
Created November 24, 2014 23:32
NodeJS debugger + repl
// To interact with this file, run `node debug repl.js`
// If you type `next` it will step to the next line
// If you type `cont` it will carry on to the
var foo = 'bar'; // You are stopped here. To go to the next line, type `next`
var bar = 'baz'; // Now you're here! Typing `next` was a lot of keystrokes, you can also type `n`
var baz = 'quux'; // This is still going to take a while. To skip all the way to the next debugger statment, type `cont`
var alice = 'bob';
var bob = 'alice';
@davidbanham
davidbanham / gist:0d81359ed4d8c4a784dc
Created September 24, 2014 23:10
You can totally pass functions in a document stream
t2 = require 'through2'
one = t2.obj (doc, enc, cb) ->
doc.speak()
doc.foo = ->
console.log 'foo'
@push doc
cb()
two = t2.obj (doc, enc, cb) ->