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
| request = require 'request' | |
| Restzilla = require 'restzilla' | |
| BUGZILLA_URL = 'https://www.w3.org/Bugs/Public/' | |
| BURL = 'http://localhost:8000/AudioWG/MIDI%20API/' | |
| GH_USER = 'jussi-kalliokoski' | |
| GH_REPO = 'webmidi-issues' | |
| GH_URL = 'https://api.github.com/repos/' + GH_USER + '/' + GH_REPO + '/issues' | |
| GH_AUTH = | |
| username: 'octocat' |
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
| function getAudioData (url, time) { | |
| return new Promise(function (resolve, reject) { | |
| var context = new AudioContext(); | |
| var track = new Audio(url); | |
| var bufferLength = time * context.sampleRate; | |
| var buffer = new Float32Array(bufferLength); | |
| var collector = context.createScriptProcessor(0, 1); | |
| var audioSource = context.createMediaElementSource(track); | |
| var samplesCollected = 0; |
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 NOTE = 69; | |
| const NOTE_ON = 0x90; | |
| const NOTE_OFF = 0x80; | |
| const SECONDS = 1000; | |
| function startSequencer (destination) { | |
| let active = false; | |
| setInterval(() => { | |
| const now = performance.now(); | |
| const type = active ? NOTE_OFF : NOTE_ON; |
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
| // Usage: | |
| // let parseRoute = routeParser("/users/{userId}/posts/{postId}"); | |
| // let params = parseRoute("/users/123/posts/456"); | |
| // console.log(params); // { userId: "123", postId: "456" } | |
| const KIND_KEY = "key" as const; | |
| const KIND_VALUE = "value" as const; | |
| /** | |
| * Create a route parser from a route 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
| $!/usr/bin/env sh | |
| branch=`git symbolic-ref --short HEAD` | |
| git checkout master | |
| commits=`git log --pretty="%H" --reverse -- $*` | |
| git checkout $branch | |
| for commit in $commits; do | |
| git cherry-pick $commit | |
| done |
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 memcpy (src, srcOffset, dst, dstOffset, length) { | |
| var i | |
| src = src.subarray || src.slice ? src : src.buffer | |
| dst = dst.subarray || dst.slice ? dst : dst.buffer | |
| src = srcOffset ? src.subarray ? | |
| src.subarray(srcOffset, length && srcOffset + length) : | |
| src.slice(srcOffset, length && srcOffset + length) : src |
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
| void function () { | |
| if ( 'dispose' in ArrayBuffer.prototype ) return | |
| var blob = new Blob([''], { | |
| type: 'text/javascript' | |
| }) | |
| var url = URL.createObjectURL(blob) | |
| var worker = new Worker(url) | |
| URL.revokeObjectURL(url) |
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
| NOOP := rm -f | |
| me: | |
| @$(NOOP) | |
| a: | |
| @$(NOOP) | |
| sandwich: | |
| @if [ `whoami` = "root" ]; then echo "one sandwich coming right up!"; else echo "hah, make me!"; fi |
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 <jussi.kalliokoski@gmail.com> | |
| 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 |
NewerOlder