Skip to content

Instantly share code, notes, and snippets.

View adamrenklint's full-sized avatar

Adam Renklint adamrenklint

View GitHub Profile
@adamrenklint
adamrenklint / pre-commit
Created April 12, 2014 09:30
Pre commit hook for cam shot
#!/usr/bin/env ruby
file="~/.gitshots/#{Time.now.to_i}.jpg"
unless File.directory?(File.expand_path("../../rebase-merge", __FILE__))
puts "Taking capture into #{file}!"
system "imagesnap -q -w 3 #{file} &"
end
exit 0
@adamrenklint
adamrenklint / gist:9713653
Created March 22, 2014 20:20
Get line count from files
find . -name '*.js' | xargs wc -l
@adamrenklint
adamrenklint / ExampleController.coffee
Last active December 17, 2015 20:19
Simple mixin to glue together a controller and view presenter example for Backbone. The view is modified to not handle DOM events on its own, but offer a public interface (replacing the old events hash) for decoupled wiring with controller.
define 'ExampleController', ->
class
# Save a reference to the view
constructor: (@view) ->
# Hook our method up to the view event
implements:
'click:logo': 'clickLogo'