Skip to content

Instantly share code, notes, and snippets.

View daveaugustine's full-sized avatar

Dave Augustine daveaugustine

View GitHub Profile
@daveaugustine
daveaugustine / Your_router.coffee
Created February 8, 2012 18:34
simple router example
class Router extends Backbone.Router
routes:
'listings/:id': 'listing'
listing: (id) ->
# update content
@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}"])
@daveaugustine
daveaugustine / pre-commit-jammit
Created November 9, 2011 22:51
Check JS Jammit Manifest for untracked files
# Check the jammit asset manifest for files that have not been tracked
# Only javascripts for now since we gitignore sass generated .css files
# TODO check for .css and .scss files
require 'rubygems'
require 'jammit'
j = Jammit.load_configuration(Jammit::DEFAULT_CONFIG_PATH)
files = j.configuration[:javascripts].values.flatten.uniq
errors = []
files.each do |f|