Skip to content

Instantly share code, notes, and snippets.

View ericelliott's full-sized avatar
💭
https://leanpub.com/composingsoftware

Eric Elliott ericelliott

💭
https://leanpub.com/composingsoftware
View GitHub Profile
@staltz
staltz / introrx.md
Last active April 19, 2024 18:49
The introduction to Reactive Programming you've been missing
@traviskaufman
traviskaufman / jasmine-this-vars.md
Last active September 19, 2022 14:35
Better Jasmine Tests With `this`

Better Jasmine Tests With this

On the Refinery29 Mobile Web Team, codenamed "Bicycle", all of our unit tests are written using Jasmine, an awesome BDD library written by Pivotal Labs. We recently switched how we set up data for tests from declaring and assigning to closures, to assigning properties to each test case's this object, and we've seen some awesome benefits from doing such.

The old way

Up until recently, a typical unit test for us looked something like this:

describe('views.Card', function() {
@ericelliott
ericelliott / args.js
Created June 24, 2011 08:05
Polymorphic functions and multiple dispatch in JavaScript
var args = [].slice.call(arguments, 0);