Skip to content

Instantly share code, notes, and snippets.

View joelongstreet's full-sized avatar

Joe Longstreet joelongstreet

View GitHub Profile
@staltz
staltz / introrx.md
Last active November 19, 2024 18:00
The introduction to Reactive Programming you've been missing
@ruzz311
ruzz311 / turnip-farmer.txt
Last active June 30, 2016 20:53
The story of the turnip farmer. Weird things are written in the middle of a hackathon. (originally ~ June 2013)
"In all my days as a turnip farmer, I have not yet experienced the love of a white radish", thought the farmer as he sighed and walked up the dusty, worn trail towards the barn. The paint, which once was vibrant red had dulled to rust where the paint had not yet freed it's self from the side, leaving chunks of exposed rough wood that he rain his hands along. The man braced his back against the worn but sturdy structure and slowly sank until his knees could take no more and he crumpled against the barn. The sun beat warm against the old man's skin which had thinned as the years raced by him. And in that moment he drifted off to sleep.
...
How long had he been out? One hour? Two? It was not yet dusk but the cicatas had begun to roar.
@ckniffen
ckniffen / backbone.inherits.js
Created October 8, 2013 20:55
Tweak of Backbone.extend to allow deeper inheritance for properties such as `defaults` and `options` and another property you also want extended.
/* global _, Backbone */
(function(_, Backbone){
// Helper function to correctly set up the prototype chain, for subclasses.
// Similar to `goog.inherits`, but uses a hash of prototype properties and
// class properties to be extended.
Backbone.deepInheritableProperties = ['options', 'defaults'];
var inherits = function(protoProps, staticProps) {
var parent = this;
var child;
@mikermcneil
mikermcneil / custom-express-middleware.md
Created August 17, 2013 04:44
Using custom express middleware in Sails.js circa v0.9.3

Custom middleware is a legacy option, since most times you just want to use policies.

HOWEVER! There are times you want to use sails for quick/dirty things you would normally use express for (but you already have sails around, w/e). More pertinently, if you want middleware to run before the static files from your assets folder are served, policies won't let you do that.

Here's an example of using the BasicAuth middleware for everything:
// Put this in `config/express.js`