Skip to content

Instantly share code, notes, and snippets.

View derfarg's full-sized avatar

Pablo Daniel Rodriguez derfarg

View GitHub Profile
@derfarg
derfarg / gist:2955471
Created June 19, 2012 17:37
Better git log colors
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --"
@derfarg
derfarg / gist:2897501
Created June 8, 2012 18:38
Ctags On OSX
Snow Leo ships with ctags not suitable for Ruby development. Ie if you try to generate tags recursively, it will error out:
$ ctags -R
ctags: illegal option -- R
usage: ctags [-BFadtuwvx] [-f tagsfile] file ...
$ which ctags
/usr/bin/ctags
homebrew to the rescue:
@derfarg
derfarg / gist:2522833
Created April 29, 2012 00:11
JS Array Converter to JSON (YUI)
var JSArray = ["item1","item2","item3"];
var json = {};
for(i in tree){ json[i] = tree[i]; }
json = YAHOO.lang.JSON.stringify(json);
//dependecies
//http://yui.yahooapis.com/2.9.0/build/yahoo/yahoo-min.js"
//http://yui.yahooapis.com/2.9.0/build/json/json-min.js"
@derfarg
derfarg / ga_multiple_track.js
Created April 17, 2012 16:59
Google Analytics, multiple code tracker
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-xxxxxxx-x']);
_gaq.push(['_trackPageview']);
_gaq.push(['tracker2._setAccount', 'UA-xxxxxxx-x']);
_gaq.push(['tracker2._trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;