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
// easing functions http://goo.gl/5HLl8 | |
Math.easeInOutQuad = function (t, b, c, d) { | |
t /= d/2; | |
if (t < 1) { | |
return c/2*t*t + b | |
} | |
t--; | |
return -c/2 * (t*(t-2) - 1) + b; | |
}; |
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
// Detect whether device supports orientationchange event, otherwise fall back to | |
// the resize event. | |
var supportsOrientationChange = 'onorientationchange' in window, | |
orientationEvent = supportsOrientationChange ? 'orientationchange' : 'resize'; | |
window.addEventListener(orientationEvent, function() { | |
window.alert('HOLY ROTATING SCREENS BATMAN:' + window.orientation + ' ' + screen.width); | |
}, false); |
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
document.getElementsByClassName && (function(){ | |
var gists = document.getElementsByClassName('gist'); | |
function embed(id, file, i, tag) { | |
window['embed_gist_'+i] = function(gist) { | |
var tmp = document.createElement('div'); | |
tmp.innerHTML = gist.div; | |
tag.parentNode.replaceChild(tmp.firstChild, tag); | |
}; | |
var url = 'https://gist.github.com/'+id+'.json?callback=embed_gist_'+i; | |
if(file) { |
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
/** | |
* Randomly reorder child elements. | |
* The optional *callback* is called with each child and its new (deep) clone, allowing you to | |
* copy data over or anything else you may require. | |
* | |
* Example usage: | |
* controls.songs.reorder(function(child, clone) { | |
* clone.data('info', child.data('info')); | |
* var id = child.data('info').id; | |
* if (self.current != undefined && self.current.data('info').id == id) self.current = clone; |
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
// https://gist.github.com/854622 | |
(function(window,undefined){ | |
// Prepare our Variables | |
var | |
History = window.History, | |
$ = window.jQuery, | |
document = window.document; | |
// Check to see if History.js is enabled for our Browser |