Skip to content

Instantly share code, notes, and snippets.

View nduhamel's full-sized avatar

Nicolas Duhamel nduhamel

View GitHub Profile
@Ceasar
Ceasar / colorize.py
Created August 11, 2012 18:40
Add colors to stdout when printing.
BLACK = 0
RED = 1
GREEN = 2
YELLOW = 3
BLUE = 4
MAGENTA = 5
CYAN = 6
WHITE = 7
@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@efeminella
efeminella / backbone-persistable-collection.js
Created April 9, 2012 21:10
A Persistable Backbone Collection Implementation
/*!
* Copyright (c) 2012 Eric Feminella, http://code.ericfeminella.com/license/LICENSE.txt
*/
( function( _, Backbone )
{
// convenience reference to the Backbone.Collection constructor
var _initialize = Backbone.Collection.prototype.initialize;
/*
* The Backbone.PersistableCollection provides a simply abstraction which