Skip to content

Instantly share code, notes, and snippets.

View saladthieves's full-sized avatar
🔋
Not lazy, but on power saving mode.

Salad Thieves saladthieves

🔋
Not lazy, but on power saving mode.
  • Nairobi, Kenya
View GitHub Profile
@trevordixon
trevordixon / Routes.js
Last active May 9, 2016 16:59
Very simple Express-like routing for PhantomJS
var Routes = (function() {
var _ = {}, ctor = function(){};
_.bind = function bind(func, context) {
var bound, args, slice = Array.prototype.slice;
args = slice.call(arguments, 2);
return bound = function() {
if (!(this instanceof bound)) return func.apply(context, args.concat(slice.call(arguments)));
ctor.prototype = func.prototype;
var self = new ctor;
var result = func.apply(self, args.concat(slice.call(arguments)));