Skip to content

Instantly share code, notes, and snippets.

View benaskins's full-sized avatar
🍑
Peachy

Ben Askins benaskins

🍑
Peachy
View GitHub Profile
# Add this to your global ~/.gitconfig so that your read-only
# Git URLs (e.g. in submodules) are swapped out for your
# read-write URL
#
[url "https://[email protected]/USERNAME/"]
insteadOf = "git://github.com/USERNAME/"
insteadOf = "http://github.com/USERNAME/"
@timriley
timriley / gist:1446347
Created December 8, 2011 07:06
How to override Rack middleware so it doesn't run in certain circumstances
module Rack
class DeflaterWithExclusions < Deflater
def initialize(app, options = {})
@app = app
@exclude = options[:exclude]
end
def call(env)
if @exclude && @exclude.call(env)
// This gist is based on eve (https://github.com/adobe-webplatform/eve), but really any event based API will do
// Idea is to recreate backbone-like model, but on events only
// Model here is a hash-map, but it shouldn’t be. You could implement any structure this way.
function model(id) {
var modelid = ["model", id],
name = function () {
return modelid.concat.apply(modelid, arguments);
};