Skip to content

Instantly share code, notes, and snippets.

@eligrey
eligrey / object-watch.js
Created April 30, 2010 01:38
object.watch polyfill in ES5
/*
* object.watch polyfill
*
* 2012-04-03
*
* By Eli Grey, http://eligrey.com
* Public Domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/
@pmeenan
pmeenan / user-timing-rum.js
Last active January 18, 2024 23:46
Support routine for adding W3C user timing events to a site. Includes some basic polyfill support for browsers that don't support user timing or navigation timing (though the start time for non-navigation timing support could be improved with IE < 9 to use IE's custom start event).
// Support routines for automatically reporting user timing for common analytics platforms
// Currently supports Google Analytics, Boomerang and SOASTA mPulse
// In the case of boomerang, you will need to map the event names you want reported
// to timer names (for mPulse these need to be custom0, custom1, etc) using a global variable:
// rumMapping = {'aft': 'custom0'};
(function() {
var wtt = function(n, t, b) {
t = Math.round(t);
if (t >= 0 && t < 3600000) {
// Google Analytics
@JasonStoltz
JasonStoltz / experience.js
Created November 21, 2013 13:20
A wrapper for Test & Target to turn its "over-simplified-for-marketers" mbox api into a developer friendly, JSONP-like service call.
/**
*
* Adobe Test and Target doesn't really have a nice API for dynamically including content, so this wraps it to provide that.
*
* What T&T wants you to do is simply define an "mbox" div on a page, call them and tell them the id of that div, and they handle
* populating content to that div.
*
* What I prefer to do is simply make a service call to T&T, have them give me some data/configuration back, and I will handle rendering
* content, however I see fit.
*