- Install Xcode (Avaliable on the Mac App Store)
- Install Xcode Command Line Tools (Preferences > Downloads)
- Install depot_tools
$ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
$ nano ~/.zshrc
- Add
path=('/path/to/depot_tools' $path)
This file contains 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
// assuming a var named `buffer` exists and is an AudioBuffer instance | |
// start a new worker | |
// we can't use Recorder directly, since it doesn't support what we're trying to do | |
var worker = new Worker('recorderWorker.js'); | |
// initialize the new worker | |
worker.postMessage({ | |
command: 'init', |
This file contains 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 url = 'http://static1.kevincennis.com/sounds/callmemaybe.mp3' | |
, audio = new Audio(url) | |
, context = new webkitAudioContext() | |
// 512 samples per frame, stereo input, mono output | |
, processor = context.createJavaScriptNode(512, 2, 1) | |
, sourceNode | |
audio.addEventListener('canplaythrough', function(){ | |
sourceNode = context.createMediaElementSource(audio) | |
sourceNode.connect(processor) |
This file contains 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
( async() => { | |
const items = 'abcdefghijklmnopqrstuvwxyz'.split(''); | |
const concurrency = 10; | |
async function process() { | |
return new Promise( r => setTimeout( r, Math.random() * 1000 ) ); | |
} | |
async function report({ item, processed, total, done }){ | |
if ( done ) { |
This file contains 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
// basic usage: new Markov(lotsOfText).generate() | |
// markov chain constructor | |
// | |
// @string input {example text} | |
// @integer len {optional # of words to output} | |
// @integer stateSize {optional chain order} | |
function Markov( input, len, stateSize ){ | |
this.cache = Object.create(null) | |
this.words = input.split(/\s/) |
This file contains 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
// For more documentation and a newer version, | |
// check out the full repo: https://github.com/kevincennis/TinyMusic | |
npm i
deno run --unstable --compat --allow-all index.j
This file contains 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
// see http://jsbin.com/okoxiq/3/edit | |
var src | |
, fftSize = 1024 | |
, audio = new Audio() | |
, ac = new webkitAudioContext() | |
, analyser = ac.createAnalyser() | |
, timeData = new Uint8Array(fftSize) | |
, bar = document.querySelector('.bar') | |
, url = 'http://static1.kevincennis.com/sounds/callmemaybe.mp3'; |
This file contains 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 curry( fn ) { | |
var arity = fn.length; | |
return (function resolver() { | |
var mem = Array.prototype.slice.call( arguments ); | |
return function() { | |
var args = mem.slice(); | |
Array.prototype.push.apply( args, arguments ); | |
return ( args.length >= arity ? fn : resolver ).apply( null, args ); | |
}; |
This file contains 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.6.0 |
NewerOlder