Skip to content

Instantly share code, notes, and snippets.

View adamcbrewer's full-sized avatar

Adam Brewer adamcbrewer

View GitHub Profile
@adamcbrewer
adamcbrewer / ga-tracker.js
Last active December 14, 2015 01:09 — forked from stugoo/event-tracker-modernizr.js
JS: GA tracker with support for Modernizr tests
/**
* A Google Analytics event tracking proxy.
*
* This lobal allows us to do tests for the instantiation of _gaq
* and also allows us easier debugging in a test environment.
*
* Hat-tip to @stugoo for most the self-invoked function features!
*
*/
window.track = function (args) {
@adamcbrewer
adamcbrewer / rAF.js
Created December 3, 2012 08:46 — forked from paulirish/rAF.js
JS: 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
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
@adamcbrewer
adamcbrewer / throttle.sh
Created October 11, 2012 07:55 — forked from apinstein/ipfw bandwidth throttle.sh
SH: ipfw bandwidth throttling
#!/bin/sh
#
# Use ipfw to throttle bandwidth.
# usage:
# ./throttle.sh # Throttle at default (60KB/s)
# ./throttle.sh 5 # Throttle at custom speed (5KB/s)
# ./throttle.sh off # Turn throttling off
# flush rules
ipfw del pipe 1