Skip to content

Instantly share code, notes, and snippets.

@chrisfrancis27
chrisfrancis27 / globals-are-bad.js
Created October 29, 2013 15:16
Find all the shitty globals on your window object.
for (var k in Object.keys(window)) {
console.log(Object.keys(window)[k], window[Object.keys(window)[k]])
}
@zolitch
zolitch / debug.js
Created February 20, 2012 09:55 — forked from davetayls/debug.js
Basic debug module
/**
* Basic debug AMD module
* usage: debug.log('inside coolFunc',this,arguments);
*/
/*jslint browser: true, vars: true, white: true, forin: true */
/*global define, require */
(function(){
'use strict';
var debug = {
@paulirish
paulirish / rAF.js
Last active March 22, 2024 00:00
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'];
<!-- VideoJS partial for AppiaSkeletona -->
<div class="video-js-box">
<!-- Using the Video for Everybody Embed Code http://camendesign.com/code/video_for_everybody -->
<video id="@Model.id"
class="video-js"
width="@Model.width"
height="@Model.height"
controls="controls"
preload="auto"
poster="@Model.image">
@kares
kares / jquery.parseparams.js
Created May 5, 2011 11:28
jQuery.parseParams - parse query string paramaters into an object
/**
* $.parseParams - parse query string paramaters into an object.
*/
(function($) {
var re = /([^&=]+)=?([^&]*)/g;
var decodeRE = /\+/g; // Regex for replacing addition symbol with a space
var decode = function (str) {return decodeURIComponent( str.replace(decodeRE, " ") );};
$.parseParams = function(query) {
var params = {}, e;
while ( e = re.exec(query) ) {