This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
module.exports = function (module, oddModule) { | |
module.exports = function even (n) { | |
return n == 0 || oddModule.exports(n - 1); | |
}; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// method as a constructor. | |
function MyClass () { | |
this.isInitialized = false; | |
} | |
MyClass.prototype.initialize = function () { | |
this.initialized = true; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
var gulp = require("gulp"); | |
var exec = require("gulp-exec"); | |
var _ = require("lodash"); | |
// This task will do nothing until it hasn't been triggered within 1s. | |
gulp.task("exec", _.debounce(function () { | |
return gulp.src(["..."], { read: false }) | |
.pipe(exec("ctags -R")); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var createSentence = function () { | |
var names = [].slice.call(arguments); | |
var fn = names.pop(); | |
if ( names.length === 0 ) { | |
return fn; | |
} | |
var name = names.shift(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class OffsetNode { | |
constructor (context) { | |
this.context = context; | |
this.worker = this.context.createAudioWorker("worker.js"); | |
this.node = this.context.createScriptProcessor(this.worker); | |
this.initializeQueue(); | |
} | |
initializeQueue () { | |
this.getOffsetQueue = []; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let context = new AudioContext(); | |
let noiseWorker = context.createAudioWorker("worker.js"); | |
let noiseNode1 = context.createScriptProcessor(noiseWorker); | |
let noiseNode2 = context.createScriptProcessor(noiseWorker); | |
let oscillator = context.createOscillator(); | |
noiseNode1.connect(oscillator.detune); | |
noiseNode2.connect(context.destination); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The usual way | |
var prepend = function (string, prefix) { | |
return prefix.concat(string); | |
}; | |
prepend("foo", "bar_"); // Wait, what? Is this "foobar_" or "bar_foo"? Not obvious without seeing the function signature. | |
// More natural language | |
var prepend = function (string) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var usedFunctions = function (_) { | |
"use strict"; | |
var usedFunctions = []; | |
var isFunction = _.isFunction; | |
var contains = _.contains; | |
_.forOwn(_, function (func, name) { | |
if ( !isFunction(func) ) { return; } | |
_[name] = function () { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var select = document.createElement('select'); | |
var selectedPort = null; | |
var onMessage = function (event) { | |
// TODO: Use the message | |
}; | |
var selectPort = function (id) { | |
var newPort = midiAccess.inputs.get(id); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 Jussi Kalliokoski <[email protected]> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |