Skip to content

Instantly share code, notes, and snippets.

@jowl
jowl / gitshot
Created September 17, 2012 11:48
Take photo automatically after every git commit. Run `gitshot --enable` in project base dir to enable.
#!/usr/bin/env ruby
require 'fileutils'
APP = __FILE__.split('/').last
pwd = Dir.pwd
if ARGV.include? '--enable'
post_commit = File.join(pwd,'.git/hooks/post-commit')
abort('post commit hook already exist!') if File.exists?(post_commit)
@daveaugustine
daveaugustine / Inside_your_router.coffee
Created February 8, 2012 18:33
Super simple Google Analytics page tracking with backbone
initialize: ->
@bind 'all', @_trackPageview
_trackPageview: ->
url = Backbone.history.getFragment()
_gaq.push(['_trackPageview', "/#{url}"])
@jsmpereira
jsmpereira / gist:1094024
Created July 19, 2011 23:46
Padrino pagination
#
# Adapted from http://pastebin.com/FL5KeQQH
#
# As mentioned on the link above put this on app/helpers/pagination.rb
# and you can use in your view
#
# =will_paginate @posts
#
# I'm also using this https://gist.github.com/837683
#
@briandealwis
briandealwis / gist:782862
Created January 17, 2011 13:55 — forked from spullara/gist:782523
One-liner to turn jar with Main-Class into executable shell script
# turn a jar with a Main-Class into a stand alone executable
(echo '#!/usr/bin/env java -jar'; cat blahblah.jar) > blah
# turn a jar with a particular main clas into a stand alone executable
(echo '#!/usr/bin/env java -jar package.MainClass'; cat blahblah.jar) > blah