Skip to content

Instantly share code, notes, and snippets.

@davemasse
davemasse / .bashrc
Created May 31, 2013 02:23 — forked from tag-dmasse/.bashrc
Change directory upwards to the first directory containing a .git directory. Helpful in quickly getting to the root of a git project.
cdg () {
CD="`~/bin/cdg.sh`"
cd $CD
}
@davemasse
davemasse / analytics_debug.js
Created March 13, 2013 15:26 — forked from davemasse-mam/analytics_debug.js
It can be difficult to tell what’s being tracked by Google Analytics with the delay between triggering actions in the browser and seeing those records in the Google Analytics dashboard. This is a quick and dirty way to track Google Analytics actions locally to make sure events are being triggered correctly before going to production.
// Debugging of Analytics calls via console.log
function _gaq_pop() {
var max = _gaq.length;
// Iterate only up to the current length of the object to prevent issues with _gaq.push being called while in the loop
for (var i = 0; i < max; i++) {
if (console && console.log) {
console.log(_gaq.shift());
}
}