Skip to content

Instantly share code, notes, and snippets.

View mikertjones's full-sized avatar

Mike Jones mikertjones

View GitHub Profile
@mikertjones
mikertjones / 0_reuse_code.js
Created December 6, 2016 11:07
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@mikertjones
mikertjones / underscore.js_mixin._.altWhere.js
Created November 1, 2012 16:59
Underscore.js_mixin:_.altWhere
// Return an object who's members match choice of parameters
// Extends underscore _.where concept
// params={gender:'M',status:'Staff|Volunteer'};
// obj=[{gender:'M',status:'Staff',name:'Jack'},{gender:'F',status:'Volunteer',name:'Susan'},{gender:'M',status:'Student',name:'Peter'}];
// _.filterObj(obj, params)
// => [{gender:'M',status:'Staff',name:'Jack'}]
_.mixin({
altWhere:function(obj, attrs) {