Skip to content

Instantly share code, notes, and snippets.

// Zero-Clause BSD (more permissive than MIT, doesn't require copyright notice)
//
// Permission to use, copy, modify, and/or distribute this software for any purpose
// with or without fee is hereby granted.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
// AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
// OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
@JohanObrink
JohanObrink / gist:5796334
Last active December 18, 2015 14:19
Fix for Array.prototype.slice.call not working on NodeLists in IE8
(function() {
if(navigator.appVersion.indexOf('MSIE 8') > 0) {
var _slice = Array.prototype.slice;
Array.prototype.slice = function() {
if(this instanceof Array) {
return _slice.apply(this, arguments);
} else {
var result = [];
var start = (arguments.length >= 1) ? arguments[0] : 0;
var end = (arguments.length >= 2) ? arguments[1] : this.length;
@paulirish
paulirish / rAF.js
Last active July 19, 2024 19:50
requestAnimationFrame polyfill
// 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
// MIT license
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];