Skip to content

Instantly share code, notes, and snippets.

@octocat
octocat / .gitignore
Created February 27, 2014 19:38
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@roder
roder / gist:5428312
Created April 21, 2013 03:14
quick and dirty function for JSON REST APIs for your shell.
function jurl() {
case `echo $1 | tr '[a-z]' '[A-Z]'` in
"PUT"|"POST")
curl -vs -H "Content-Type: application/json" -X $1 -d "${2}" $3 | python -mjson.tool
;;
"GET"|"DELETE")
curl -vs -H "Content-Type: application/json" -X $1 $2 | python -mjson.tool
;;
*)
echo "Error: Please use of the following HTTP methods: GET, POST, PUT, DELETE."
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@roder
roder / gist:1478299
Created December 14, 2011 20:16
Matt Heitzenroder SSH Public Key
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAuvp4DliG7bRgSKEFywMLcIFefxa9h7ThH13Gp3ZnmjkwedC6KFvqVEYWMK7MO9HXYa8eLS389Cq1tPrUXnC2z9AkvFReGfg+SID+zkY+1vP5j4gJSR6RD9DxCgdT13ncUzgtoC/q76OAVImH7actvNZ9KjLH3gft3tbBMC3Xpiwhjirh+BY+ObJ4QjRK/DWyWUv7pn13wWt1jo+6lfUv4gqSzmthubWI7oUPjTyRqpSuAQf2CFPsV3s51k6JveixaS+tJ/jaCv4usZCyTTLviyh8fLCpVojYEU9S67PLqrWhjWUGuW+B2ietPMEaq5WZFyZvOVXpASeQY9PB3umgUQ== Matt Heitzenroder <mheitzenroder at gmail dot com>
@cstar
cstar / gist:970445
Created May 13, 2011 12:33
Fake your webmachine requests for unit testing.
make_wrq(Method, RawPath, Headers) ->
{ok, Dispatch} = file:consult(filename:join(
[filename:dirname(code:which(?MODULE)),
"..", "priv", "dispatch.conf"])),
R0 = wrq:create(Method, {1,1}, RawPath, mochiweb_headers:from_list(Headers)),
R1 = wrq:set_peer("127.0.0.1", R0),
{_, _, HostTokens, Port, PathTokens, Bindings, AppRoot, StringPath} =
webmachine_dispatcher:dispatch("127.0.0.1", RawPath, Dispatch),
wrq:load_dispatch_data(Bindings,
HostTokens,
@protocool
protocool / caveatPatchor.js
Created February 14, 2011 02:29
Sample caveatPatchor.js file for use in Propane 1.1.2 and above
/*
As of version 1.1.2, Propane will load and execute the contents of
~Library/Application Support/Propane/unsupported/caveatPatchor.js
immediately following the execution of its own enhancer.js file.
You can use this mechanism to add your own customizations to Campfire
in Propane.
Below you'll find two customization examples.
@roder
roder / xmlsqlite.py
Created December 16, 2010 04:49
Convert XML files into SQLite
#!/usr/bin/env python
from optparse import OptionParser
from xml.dom.minidom import parse
import os
import sqlite3
datatypeMap = {
'integer': 'INT',
'datetime': 'DATETIME',