Skip to content

Instantly share code, notes, and snippets.

View mbarzeev's full-sized avatar

Matti Bar-Zeev mbarzeev

View GitHub Profile
@mbarzeev
mbarzeev / app.js
Last active November 18, 2016 16:20
A Metronome Directive. Taken after Chris Wilson's article (http://www.html5rocks.com/en/tutorials/audio/scheduling/).
// This is the "run" block of your main module
.run(['$window', function (window) {
// First, let's shim the requestAnimationFrame API,
// with a setTimeout fallback
window.requestAnimFrame = window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.oRequestAnimationFrame ||
window.msRequestAnimationFrame ||
function (callback) {