View split.js
const line = '"" "a b" "a b c" "a \\" marvellous" \'we like\'a"b a""b abab abb "hi"';
const gre = /\s*(?:(?:"((?:\\"|[^"])*)")|(?:'((?:\\'|[^'])*)')|([^\s]+))/g;
function split(str) {
const result = [];
str.replace(gre, (part, dquoteMatch, squoteMatch, wsMatch, offset, fullString) => {
result.push(dquoteMatch !== undefined ? dquoteMatch : squoteMatch !== undefined ? squoteMatch : wsMatch)
});
return result;
}
View repl.js
// You should probably use Vorpal.js instead of this.
// usage demo down at the bottom of the file...
const Repl = require('repl');
const util = require('util');
const fs = require('fs');
const path = require('path');
// Don't be a repli-can't, be a...
class Replican {
View readme.md

Transducers Primer

function reducerFn(output, value) {
	// reducer functions know how to build a structure when repeatedly given
	// that structure and values (think of it as 'builder')
	return output
}
function reduceFn(collection, reducerFn, output) {
View keybase.md

Keybase proof

I hereby claim:

  • I am kybernetikos on github.
  • I am kybernetikos (https://keybase.io/kybernetikos) on keybase.
  • I have a public key whose fingerprint is 4D54 659A DBC4 D807 220C 03E4 7DD3 2D18 A8D8 2630

To claim this, I am signing this object:

View itrreduce.js
function itrReduce(src, reductionFn, destination) {
let result = {value: undefined, done: false}
let done = {done: true}
let latestDestinationValue = destination
return {
next: function() {
let nextIncomingOpt = src.next()
if (nextIncomingOpt.done) {
return done
View gist:61687b05fcf78a17576d
javascript:var cssLink=document.createElement('style');cssLink.innerHTML="@font-face { font-family: SansBS; src: url('data:font/ttf;base64,AAEAAAASAQAABAAgRkZUTVGwM9YAAKaYAAAAHEdERUYAJgDYAACmtAAAAB5HUE9T8lpNXgAAptQAABLAR1NVQhvFOicAALmUAAAV5k9TLzKg07VlAAABqAAAAGBjbWFwoIGYEgAABWAAAAGiY3Z0IDl+PkwAABD4AAAB/GZwZ21zhINeAAAHBAAABwVnYXNwAAQABwAApowAAAAMZ2x5Zs5ZPbgAABSkAACJQGhlYWQml1fWAAABLAAAADZoaGVhNgItRwAAAWQAAAAkaG10eMXDVZsAAAIIAAADWGxvY2EqhwaaAAAS9AAAAa5tYXhwA34GYgAAAYgAAAAgbmFtZefcI3UAAJ3kAAAGoHBvc3TfQqePAACkhAAAAgVwcmVwgtwhEwAADgwAAALsAAEAAAABAAB5kUCqXw889QAdCAAAAAAAyBdP9gAAAADRFL1c/qD+FC+aB3MAAAAIAAIAAAAAAAAAAQAAB3P+FAAAL7r+oP6iL+wAAQAAAAAAAAAAAAAAAAAAANYAAQAAANYE+AAXAFMABAACABAALwBaAAACHwDlAAMAAQADBCYBkAAFAAgFmgUzAAABHgWaBTMAAAPQAGYB8gAAAgsGBgMIBAICBOAAAu9AACBbAAAAKAAAAAAxQVNDAEAAICBEBh/+FACEB3MB7CAAAZ8AAAAABEoFtgAAACAAAggAAAAAAAAACAAAAAIUAAACJwCTAzcAhQUrADMEaAB7BpoAZgWeAG0BzwCFAmgAUgJoAD0EaABSBGgAZgIAAD8CkwBSAiUAkwL8ABQEaABiBGgAsgRoAGAEaABSBGgAFwRoAIMEaABxBGgAWgRoAGoEaABqAiUAkwIlAD8EaABmBGgAZgRoAGYDaAAlB
View gist:a264fba207527d775032
try {
var WAIT = "wait"
var FIRE = "fire"
var ACTIONS = [WAIT, FIRE]
if (!context.classesDefined) {
context.classesDefined = true;
context.WorldState = function WorldState(numberOfAsteroids, asteroidX, asteroidVx, fired) {
this.asteroidX = asteroidX
View gist:5588309
// Generated by CoffeeScript 1.3.1
(function() {
var cubes, list, math, num, number, opposite, race, square,
__slice = [].slice;
number = 42;
opposite = true;
if (opposite) {
View gist:5380463
// Bad behaviour ahead!
// doesn't work with strict mode.
function local(obj) {
var global = Function("return this")();
var tmpName = "_tmp";
while (tmpName in global) {
tmpName = "_"+tmpName;
}
View watchFile monkey patch.js
var os = require('os');
if (os.platform() == 'win32') {
// change fs.watchFile so that it doesn't throw an error on windows.
fs.watchFile = function(filepath, callbackfunc) {
var old = fs.statSync(filepath);
fs.watch(filepath, function() {
fs.stat(filepath, function(err, newStat) {
callbackfunc(old, newStat);