Skip to content

Instantly share code, notes, and snippets.

@irfan
irfan / mixpanel.error.tracking.js
Created March 14, 2016 22:27
Mixpanel js error tracking
<script>
window.onerror = function(message, file, line) {
var prop = {}
prop.message = message;
prop.file = file;
prop.line = line;
mpq.track('js-err',prop);
}
</script>
@irfan
irfan / pr.md
Created March 25, 2013 10:49 — forked from piscisaureus/pr.md

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@irfan
irfan / gist:2412193
Created April 18, 2012 09:03
Display current SVN branch in the shell.
# Output:
# /projects/zidaya: TURPAR-801 $
function svn_branch () {
svn info | grep '^URL:' | egrep -o '(tags|branches)/[^/]+|trunk' | egrep -o '[^/]+$'
}
function pretty_prompt () {
_IFS=$IFS;
DIR=`pwd|sed -e "s|$HOME|~|"`;