Skip to content

Instantly share code, notes, and snippets.

View benaskins's full-sized avatar
🍑
Peachy

Ben Askins benaskins

🍑
Peachy
View GitHub Profile
// 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);
};
@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)
# 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://USERNAME@github.com/USERNAME/"]
insteadOf = "git://github.com/USERNAME/"
insteadOf = "http://github.com/USERNAME/"