Skip to content

Instantly share code, notes, and snippets.

View gist:9866671
function* asyncIterator() {
let value, done;
while ({value, done} = (yield null), !done) {
console.log("got", value);
it = asyncIterator();;
View sparkio-test.js
var five = require("johnny-five");
var Spark = require("spark-io");
var board = new five.Board({
io: new Spark({
token: process.env.SPARK_TOKEN,
deviceId: process.env.SPARK_DEVICE_ID

Inspired by Robert O'Callahan's blog

To reduce the need for "visual confirmation" tests:

  • store the base-64 encoded data-uri of a reference png as a string
  • copy the outerHTML of your test fixture into an SVG wrapper, prefixed with "data:image/svg+xml,"
  • set the src of an image to the value of the SVG wrapper
  • copy the image into a canvas context
  • assert equality of canvas.context.toDataURL() and previously stored reference string
View gist:3751340
let defaults = {},
overrides = {};
function foo(bar, options) {
// YUI
options = Y.merge(defaults, options, overrides);
// Underscore
options = _.extend({}, defaults, options, overrides);
View Custom.css
/* IR_Dark_Monokai
/* Designed and developed by Andres Pagella (@mapagella)
/* Based on Ben Truyman's IR_Black
/* which is...
/* Based on Todd Werth's IR_Black:
disnet / scheme.sjs
Created Oct 8, 2012
start of scheme in sweet.js (modified from
View scheme.sjs
macro sexp {
case () => {
case ($p) => {
case ($x $y) => {
tcr / Vagrantfile
Last active Nov 29, 2015
tessel 2 openwrt in packer
View Vagrantfile
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.ssh.username = "root"
config.ssh.password = "tessel2" = "ash"
config.vm.synced_folder ".", "/vagrant", disabled: true = "technicalmachine/tessel2"
andrew / xbox.js
Created Dec 29, 2012
Xbox Controller in Node.js (wip)
View xbox.js
var HID = require('HID');
var util = require('util');
var events = require('events');
var devices = HID.devices();
var device
devices.forEach((function(d) {
if(typeof d === 'object' && d.product.toLowerCase() === 'controller') {
jlongster / input.ljs
Last active Dec 15, 2015
LLJS compiling to asm.js
View input.ljs
struct Point {
function void Point(double x, double y) {
this->x = x;
this->y = y;
double x, y;
function int add1(int x) {
dfkaye /
Last active Dec 15, 2015
ES6 needs a timeout - I reserve the right to change my mind about this


Some recent activity from active contributors regarding ES6 proposals threaten to undermine its acceptance from the community at large.

ES6 proposals include the fat arrow, destructured assignment, splat args, let/block scope, class syntax, class-based inheritance, setters/getters with export, the module loader syntax, weak maps, weak events, @symbols, and so forth.

That is a lot for a community user of the language to comprehend. It is a lot for a single iteration of any project.

The sheer amount of change is at root of the confusion apparent even among the es-discuss mailing list ~ [see this conversation for an example] ( ""that was removed from the spec", "I thought it was back in", "it's on the table", "'on the table' does not mean 'in the spec'"").