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
$("html, body").animate({ scrollTop: 0 }, { | |
duration: 250, | |
complete: function() { | |
var elem = document.documentElement; | |
// setting a padding top on document element will force repaint, but not show any visual effect | |
elem.style.paddingTop = '1px'; | |
setTimeout(function() { | |
elem.style.paddingTop = '0'; | |
}, 0); | |
} |
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 lifx = require('lifx'); | |
var lx = lifx.init(); | |
lx.on('bulb', function(bulb) { | |
queueLights([ | |
[255, 255, 255], | |
[255, 0, 0], | |
[0, 255, 0], | |
[0, 0, 255], | |
[255, 255, 0], |
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 sleepSort(res, arr) { | |
arr.forEach(function(val) { | |
setTimeout(function() { | |
res.push(val); | |
}, val * 5); | |
}) | |
} | |
var res = []; | |
sleepSort(res, [4, 6, 2, 9, 3, 5, 1]); |
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 Snow = (function() { | |
var requestAnimationFrame = | |
window.requestAnimationFrame || | |
window.webkitRequestAnimationFrame || | |
window.mozRequestAnimationFrame || | |
function(callback) { | |
return setTimeout(function() { | |
callback(performance.now()); | |
}, 16); | |
}; |
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
//GLOBALS | |
var triangleVertexPositionBuffer; | |
var squareVertexPositionBuffer; | |
var mvMatrix = mat4.create(); | |
var pMatrix = mat4.create(); | |
var gl; | |
var shaderProgram; |
NewerOlder