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
| function create(object) { | |
| var wait = Promise.resolve(); | |
| function synchronized(func) { | |
| function next() { | |
| return func(object); | |
| } | |
| return (wait = wait.then(next, next)); | |
| } |
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
| const WORKER_ENABLED = !!(global === global.window && global.URL && global.Worker); | |
| const IN_WORKER_CONTEXT = !!(global === global.self && global.location); | |
| let pathname = WORKER_ENABLED && (() => { | |
| let scripts = global.document.getElementsByTagName("script"); | |
| let script = scripts[scripts.length - 1].src; | |
| return new global.URL(script).pathname; | |
| })(); |
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 ctrl = new LaunchControl(); | |
| ctrl.open(); | |
| ctrl.led(1, "red"); | |
| ctrl.led(1, "dark-red"); | |
| ctrl.led(1, "off"); | |
| ctrl.led(1, 0); | |
| var colorDict = { |
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
| function cubicinterp(x, y0, y1, y2, y3) { | |
| let c0 = y1; | |
| let c1 = 0.5 * (y2 - y0); | |
| let c2 = y0 - 2.5 * y1 + 2 * y2 - 0.5 * y3; | |
| let c3 = 0.5 * (y3 - y0) + 1.5 * (y1 - y2); | |
| return ((c3 * x + c2) * x + c1) * x + c0; | |
| } |
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
| export let re2 = /^(?:([-+]?(?:\d+|\d+\.\d+))\s*,\s*)?([-+]?(?:\d+|\d+\.\d+))(?:\s*\.\.(\.?)\s*([-+]?(?:\d+|\d+\.\d+)))?$/; | |
| export let re = /^([-+]?(?:\d+|\d+\.\d+))(?:\s*,\s*([-+]?(?:\d+|\d+\.\d+)))?(?:\s*(\.\.\.?)\s*([-+]?(?:\d+|\d+\.\d+)))?$/; | |
| function toArray(value) { | |
| if (Array.isArray(value)) { | |
| return value.slice(); | |
| } | |
| if (typeof value !== "string") { | |
| return [ value ]; |
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
| [ 10, [ 100, [ 1000 ] ] ].absdif([ 2, 3, 4, 5, 6 ]) | |
| // -> [ 8, [ 97, [ 997 ] ], 6, [ 95, [ 995 ] ], 4 ] |
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
| import EventEmitter from "./EventEmitter"; | |
| import Session from "./Session"; | |
| export default class Application extends EventEmitter { | |
| constructor(io) { | |
| super(); | |
| this.io = io; | |
| this.slots = []; | |
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
| function diff(oldObj, newObj) { | |
| return _.omit(newObj, function(value, key) { | |
| return _.isEqual(oldObj[key], value); | |
| }); | |
| } |
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 _dispatchers = {}; | |
| let _clientSocket = null; | |
| export default class ActionDispatcher extends EventEmitter { | |
| constructor() { | |
| super(); | |
| _dispatchers[this.name || this.constructor.name] = this; | |
| } | |
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 apiOptions = { | |
| FloatTimeDomainData: true, | |
| AudioBufferCopy: true, | |
| AudioWorker: false, | |
| StereoPanner: false, | |
| PromiseBasedDecode: true, | |
| PromiseBasedRender: true, | |
| AudioContextState: true, | |
| AudioContextClose: true, | |
| SelectiveDisconnect: true, |