Skip to content

Instantly share code, notes, and snippets.

View mattbaker's full-sized avatar

Matt Baker mattbaker

  • New Relic
  • Portland, OR
View GitHub Profile
@mattbaker
mattbaker / README
Created December 22, 2011 06:02
SVG to PNG render with Node and D3.js
This example expects to have d3.min.js and d3.layout.min.js in the same directory as pie.js and pie_serv.js.
Run with node pie_serv.js
@mattbaker
mattbaker / object.prototype.js
Created June 14, 2011 18:54
Object.tap in Javascript
Object.prototype.tap = function(f){f.apply(this); return this;}
var x = {a:2};
x.tap(function(){console.log(this.a)}).a = 4; //Prints 2
console.assert(x.a == 4);