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
h1 Percussion | |
section.switches.loading | |
.start.hidden | |
button type="button" Start | |
- keys = [ "a", "s", "d", "f", "j", "k", "l", ";" ] | |
- %w( highHat crash bell rim snare tom1 tom2 kick ).each_with_index do |instrument, i| | |
.instrument data-instrument=instrument | |
- 16.times do |tick| | |
button.tick type="checkbox" data-tick=tick = keys[i] | |
p Built by <a href="http://twitter.com/LandonSchropp" target="_blank">Landon Schropp</a> as part of the <a href="http://codepen.io/collection/fDxJj/" target="_blank">Randoms Collection</a> |
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 test = ( f, _n ) => { | |
console.log( ( new Array( _n || 1000 ) ).fill( 0 ).map( n => { | |
let t0 = performance.now() | |
f() | |
let t1 = performance.now() | |
return t1 - t0 | |
} ).reduce( ( sum, d ) => sum+=d ) + ' ms' ) | |
} | |
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
<!DOCTYPE html> | |
<title>Hello Reactor</title> | |
<script src="reactor.js"></script> | |
<script src="main.js"></script> |
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 googleFontsBaseUrl="//fonts.gstatic.com/s/",googleFonts=[{name:"ABeeZee",styles:["regular","italic"],files:[{style:"regular",url:"abeezee/v10/mE5BOuZKGln_Ex0uYKpIaw.ttf"},{style:"italic",url:"abeezee/v10/kpplLynmYgP0YtlJA3atRw.ttf"}]},{name:"Abel",styles:["regular"],files:[{style:"regular",url:"abel/v7/RpUKfqNxoyNe_ka23bzQ2A.ttf"}]},{name:"AbhayaLibre",styles:["regular","500","600","700","800"],files:[{style:"500",url:"abhayalibre/v2/wBjdF6T34NCo7wQYXgzrc5MQuUSAwdHsY8ov_6tk1oA.ttf"},{style:"600",url:"abhayalibre/v2/wBjdF6T34NCo7wQYXgzrc2v8CylhIUtwUiYO7Z2wXbE.ttf"},{style:"700",url:"abhayalibre/v2/wBjdF6T34NCo7wQYXgzrc0D2ttfZwueP-QU272T9-k4.ttf"},{style:"800",url:"abhayalibre/v2/wBjdF6T34NCo7wQYXgzrc_qsay_1ZmRGmC8pVRdIfAg.ttf"},{style:"regular",url:"abhayalibre/v2/zTLc5Jxv6yvb1nHyqBasVy3USBnSvpkopQaUR-2r7iU.ttf"}]},{name:"AbrilFatface",styles:["regular"],files:[{style:"regular",url:"abrilfatface/v8/X1g_KwGeBV3ajZIXQ9VnDojjx0o0jr6fNXxPgYh_a8Q.ttf"}]},{name:"Aclonica",styles:["regular"],files:[{style:"regula |
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
fetch( 'https://gist.githubusercontent.com/MAKIO135/0f0c45136069ee6e7366afef684f3373/raw/89e9b1600f2ff9331ddc9f12a9f58500d9ad09ae/pi.json' ) | |
.then( resp => resp.json() ) | |
.then( json => { | |
let pi = json.pi | |
let i = 0; | |
setInterval( function run(){ | |
console.clear() | |
console.log( + pi.charAt( i ) ) | |
i++; |
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
// https://stackoverflow.com/questions/10865025/merge-flatten-an-array-of-arrays-in-javascript/39000004#39000004 | |
const flatten = function(arr, result = []) { | |
for (let i = 0, length = arr.length; i < length; i++) { | |
const value = arr[i]; | |
if (Array.isArray(value)) { | |
flatten(value, result); | |
} else { | |
result.push(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
// gif.worker.js 0.2.0 - https://github.com/jnordberg/gif.js | |
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){var NeuQuant=require("./TypedNeuQuant.js");var LZWEncoder=require("./LZWEncoder.js");function ByteArray(){this.page=-1;this.pages=[];this.newPage()}ByteArray.pageSize=4096;ByteArray.charMap={};for(var i=0;i<256;i++)ByteArray.charMap[i]=String.fromCharCode(i);ByteArray.prototype.newPage=function(){this.pages[++this.page]=new Uint8Array(ByteArray.pageSize);this.cursor=0};ByteArray.prototype.getData=function(){var rv="";for(var p=0;p<this.pages.length;p++){for(var i=0;i<ByteArray.p |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<title>Hello WebMIDI</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
</head> | |
<body> | |
<script> |
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
Note | Midi | Frequency | |
---|---|---|---|
C1 | 0 | 8.1757989156 | |
Db1 | 1 | 8.6619572180 | |
D1 | 2 | 9.1770239974 | |
Eb1 | 3 | 9.7227182413 | |
E1 | 4 | 10.3008611535 | |
F1 | 5 | 10.9133822323 | |
Gb1 | 6 | 11.5623257097 | |
G1 | 7 | 12.2498573744 | |
Ab1 | 8 | 12.9782717994 |
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
Array.prototype.count = function( n ) { | |
return this.filter( d => d === n ).length; | |
} |