Skip to content

Instantly share code, notes, and snippets.

View sdboyer's full-sized avatar

sam boyer sdboyer

View GitHub Profile
@nictuku
nictuku / sshd.go
Created April 8, 2012 15:43
Go SSH server complete example
package main
import (
"fmt"
"io"
"io/ioutil"
"log"
"code.google.com/p/go.crypto/ssh"
"code.google.com/p/go.crypto/ssh/terminal"
@textarcana
textarcana / git-log2json.sh
Last active June 12, 2024 15:09
Convert Git logs to JSON. The first script (git-log2json.sh) is all you need, the other two files contain only optional bonus features 😀THIS GIST NOW HAS A FULL GIT REPO: https://github.com/context-driven-testing-toolkit/git-log2json
#!/usr/bin/env bash
# Use this one-liner to produce a JSON literal from the Git log:
git log \
--pretty=format:'{%n "commit": "%H",%n "author": "%aN <%aE>",%n "date": "%ad",%n "message": "%f"%n},' \
$@ | \
perl -pe 'BEGIN{print "["}; END{print "]\n"}' | \
perl -pe 's/},]/}]/'
@sdboyer
sdboyer / gist:825176
Created February 13, 2011 21:48
merge horribleness
Original LCAS:
set(['drumm@delocalizedham.com-20110114031905-tf0ean18fij48avq',
'hudson@util.drupal.org-20101231175052-vh23b2wb4m4fuyrf',
'hudson@util.drupal.org-20110115180021-3pa9rxlzj0b4m7ux',
'hudson@util.drupal.org-20110116201349-pt6bqho1lfldzmev',
'hudson@util.drupal.org-20110124022445-53hs3ux2ek0fjw23',
'hudson@util.drupal.org-20110126103810-nz8z9m6uk958031d',
'killes@util.drupal.org-20101222010347-tqtq6pn8q9g3622d'])
Using LCAS:
set(['hudson@util.drupal.org-20110115180021-3pa9rxlzj0b4m7ux'])
@raggi
raggi / eventmachine_is_web_scale.rb
Created September 1, 2010 01:34
the secrets of the web scale sauce
require 'eventmachine'
EM.run do
SEKRET_SAUCE = EM.attach(
open(RUBY_PLATFORM =~ /mswin|mingw/ ? 'NUL:' : '/dev/null', 'w')
)
EM.start_server('0.0.0.0', 80, Module.new do
def post_init; proxy_incoming_to(SEKRET_SAUCE); end
end)
end