Skip to content

Instantly share code, notes, and snippets.

Drew Petersen kirbysayshi

Block or report user

Report or block kirbysayshi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@kirbysayshi
kirbysayshi / notes.md
Created Nov 23, 2015
windows to go notes
View notes.md
@kirbysayshi
kirbysayshi / .babelrc
Last active Nov 11, 2015
show how babelify fails to read babelrc
View .babelrc
{
"presets": [
"es2015",
"stage-0"
]
}
@kirbysayshi
kirbysayshi / index.js
Last active Oct 14, 2015
requirebin sketch
View index.js
var Pocket = require('pocket-ces');
var arbit = require('arbit');
var pkt = new Pocket();
var random = arbit();
var uiHTML = ''
+ '<button onclick="handlePlantSeedClick()">Plant a seed</button>'
+ '<button onclick="handleTickClick()">Walk through the fields</button>'
+ '<button onclick="handleHarvestClick()">Harvest!</button>'
@kirbysayshi
kirbysayshi / index.js
Created Oct 8, 2015
requirebin sketch
View index.js
var Pocket = require('pocket-ces');
var arbit = require('arbit');
var pkt = new Pocket();
var random = arbit();
var uiHTML = ''
+ '<button onclick="handlePlantSeedClick()">Plant a seed</button>'
+ '<button onclick="handleTickClick()">Walk through the fields</button>'
+ '<button onclick="handleHarvestClick()">Harvest!</button>'
@kirbysayshi
kirbysayshi / index.js
Last active Sep 21, 2015
requirebin sketch
View index.js
var binaryxhr = require('binary-xhr');
var actx = null;
function kick () {
var audioContext = new webkitAudioContext()
var osc = audioContext.createOscillator()
var gain = audioContext.createGain()
gain.gain.value = 0
osc.connect(gain)
@kirbysayshi
kirbysayshi / multidimensional-dtw.js
Created Sep 15, 2015
override dtw's (https://github.com/langholz/dtw) silly 1-dimensional validation.
View multidimensional-dtw.js
var DTW = require('./');
//var DTW = require('dtw');
var validate = require('./lib/validate');
// Monkey patch to allow for non-numeric input
validate.sequence = function() {};
var template = makeSeries([], 0, Math.PI*2);
@kirbysayshi
kirbysayshi / _README.md
Last active Aug 26, 2015
imports vs require
View _README.md

import is hoisted, meaning transition to import from require can be non-trivial if relying on app-wide dependencies to be initialized before use.

$ npm run import

> import-test@0.0.0 import /Users/drewp/GIT/import-test-gist
> babel-node index-import.js

exec a
exec c
@kirbysayshi
kirbysayshi / howhowhow.markdown
Last active Aug 29, 2015
Is any variant of this possible in ES6 modules / destructuring?
View howhowhow.markdown

I have a big fat object that is structured like this (using CJS format to remove all ambiguity):

// big-fat-package.js
module.exports = {
  runtime: {
    compile: function() {},
    partials: {
      'non-valid-identifier-property-0': function() {},
      'non-valid-identifier-property-1': function() {},
@kirbysayshi
kirbysayshi / index.js
Last active Aug 29, 2015
requirebin sketch
View index.js
var Benchmark = require('benchmark');
var suite = new Benchmark.Suite;
global.moutdifference = require('mout/array/difference');
global.assert = require('assert');
function setup() {
destArr = [];
You can’t perform that action at this time.