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
{ | |
"events": [ | |
[0, "meter", 4, 1], | |
[1, "A♭2", 0.25, 0.5], | |
[3, "A♭2", 0.25, 1], | |
[5, "A♭2", 0.25, 1], | |
[7, "A♭2", 0.25, 1], | |
[0, "B1", 0.3, 1], | |
[1.5, "B1", 0.3, 0.5], | |
[3, "B1", 0.3, 1], |
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
{ | |
"name": "Dolphin Dance", | |
"author": "Herbie Hancock", | |
"events": [ | |
[0, "chord", "C∆", 4], | |
[4, "chord", "G-", 4], | |
[8, "chord", "C∆", 4], | |
[12, "chord", "Bø", 2], | |
[14, "chord", "E7alt", 2], | |
[16, "chord", "A-", 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
[ | |
[0, "chord", "C-7", 2], | |
[2, "chord", "A♭∆(♯11)", 2], | |
[4, "chord", "D♭∆(♯11)", 2], | |
[6, "chord", "G♭∆(♯11)", 2], | |
[8, "chord", "B♭7sus", 2], | |
[10, "chord", "A♭7(♯11)", 2], | |
[12, "chord", "B♭7sus", 2], | |
[14, "chord", "C7", 2], | |
[16, "chord", "F-7", 2], |
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
document.addEventListener('focusin', (e) => | |
// Sanity check for target being activeElement, should always be true | |
console.log('focusin', e.target === document.activeElement, document.activeElement) | |
); | |
document.addEventListener('focusout', (e) => | |
// Sanity check that activeElement is body, should always be true | |
console.log('focusout', document.body === document.activeElement) | |
); |
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 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
948185325142024192 | |
141671778 | |
1595919655 | |
859375579 | |
1310776698 | |
3017785207 | |
628899279 | |
888323120 | |
4802917600 | |
308660195 |
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
// Overload a function according to the types of arguments passed in: | |
// | |
// var fn = overloadByTypes({ | |
// 'object': function(object) {}, | |
// 'string number': function(string, number) {}, | |
// 'default': function() {} | |
// }); | |
// | |
// Returns the result of the called function. To return this to create | |
// a chainable method, for example, pass in true as a second argument: |
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
// Viterbi algorithm for finding hidden relationships | |
function Viterbi(data) { | |
var V = [{}]; | |
var path = {}; | |
// Initialize base cases (t == 0) | |
for(var i=0;i<data.states.length;i++) { | |
var state = data.states[i]; | |
V[0][state] = data.start_probability[state] * data.emission_probability[state][data.observations[0]]; | |
path[state] = [state]; |
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(jQuery) { | |
var win = jQuery(window); | |
var sampleLength = 20; | |
var maxInterval = 250; | |
var avgInterval = 35; | |
var timeStamps = []; | |
function diff(n, i, array) { | |
return array[i + 1] - n; | |
} |
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(jQuery, undefined){ | |
// Cycle news slides | |
jQuery(document).ready(function(){ | |
var slides = jQuery('.header_slide'), | |
length = slides.length, | |
i = slides.index(slides.filter('.active')[0]), | |
durationShort = 8000, | |
durationLong = 48000, | |
timer, fn; | |
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
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating | |
// requestAnimationFrame polyfill by Erik Möller | |
// fixes from Paul Irish and Tino Zijdel | |
(function() { | |
var lastTime = 0; | |
var vendors = ['ms', 'moz', 'webkit', 'o']; | |
for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { |
NewerOlder