Instantly share code, notes, and snippets.

View .spacemacs.el
(defun dotspacemacs/user-config ()
"Configuration function for user code.
This function is called at the very end of Spacemacs initialization after
layers configuration. You are free to put any user code."
;; Add OS X Layer
(setq-default dotspacemacs-configuration-layers '(osx))
#!/usr/bin/env bash
killall Messages Dock
open /Applications/
View engima-encode.racket
(define (encode reflector rotor-l rotor-m rotor-r letter)
(list-ref alphabet
(rotor-translate-right (rotate rotor-r 1)
(rotor-translate-right rotor-m
(rotor-translate-right rotor-l
(reflect reflector
(rotor-translate-left rotor-l
(rotor-translate-left rotor-m
(rotor-translate-left (rotate rotor-r 1)
(letter-to-index letter))))))))))
View wealthfront-js-prep.js
// JavaScript variables belong to one of the following scopes: global or local(function).
// Basically, any variable defined outside of a function is a global variable. Variables
// defined inside of a function are scoped narrowly to that function, and any other
// functions defined within the scope of that function (explicit use of the var keyword assumed).
var myName = "john";
var capitalizeMyName = function() {
myName = myName.substring(0).toUpperCase() + myName.slice(1);
var name = myName;

Keybase proof

I hereby claim:

  • I am mattbaker on github.
  • I am mattbaker ( on keybase.
  • I have a public key whose fingerprint is 9563 2B6B 6E59 F85F 3B61 2419 40D9 A66D EFF9 425F

To claim this, I am signing this object:

View option.js
* A Wealthfront-style Option implementation in Javascript implementing ES6 iterables
* Reference:
* This only runs in current versions of Firefox.
* It's recommended you use the FF Scratchpad with the web console open to see logging results:
View zscroll.html
<title>Scrolling along the Z-Axis</title>
Example from
Assumes browser window is sized at a height of 400px (the size of the black box).
#viewport {
View thunk.js
function Thunk(fn) {
this.get = function() {
var v = fn();
this.get = function() { return v };
return v;
* > var x = new Thunk(function() { console.log("working..."); return 2 * 2 * 2; })
View converttest.js
/* converttest.js: Send a PNG of a red square to STDOUT
* ex. node converttest.js > test.png
var convert = require('child_process').spawn("convert", ["svg:", "png:-"]),
svgsrc = '<svg><rect height="100" width="100" style="fill:red;"/></svg>';
convert.stdout.on('data', function (data) {
View jsdomtest.js
/* jsdomtest.js: Build a pie chart using d3.js and send the result to stdout
* Requires d3.js and d3.layout.js in same directory
* Requires pie.js from this gist:
* ex. node jsdomtest.js > pie.svg
var jsdom = require('jsdom'),
scripts = ["file://"+__dirname+"/d3.min.js",