Skip to content

Instantly share code, notes, and snippets.

View neilvoss's full-sized avatar

Neil Voss neilvoss

View GitHub Profile
@neilvoss
neilvoss / Genius.js
Last active October 3, 2017 04:10
🎷 🎹🎹🎹 🎸
////////////////////////////////////////////////////////////////////////////////
for ( var everything in large.amounts ) {
count++;
}
////////////////////////////////////////////////////////////////////////////////
monday.rgb = 0x0000ff;
@neilvoss
neilvoss / Singleton.js
Last active November 15, 2016 02:29
ES6 Singleton
// Singleton implemented abstractly in a Class
class Singleton {
constructor() {
var instance = ( Singleton._instance !== undefined ) ? Singleton._instance : this;
Singleton._instance = instance;
return instance;
}
@neilvoss
neilvoss / player.js
Last active May 26, 2016 08:55
Workaround to iOS WebAudio default lock – fix for WebAudio MOD/XM/S3M Player
// Fix for https://github.com/jhalme/webaudio-mod-player
// WebAudio is suspended on iOS by default, until an attempt to
// play audio immediately follows a user interaction.
// A simple workaround is to pre-initialize the context
// and bind a user interaction that plays an empty
// buffer once. Doing so unlocks the suspended state for the
// remainder of the session.