This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class LazyCollection extends Backbone.Collection | |
indexQuerystring: 'index' | |
index: 1 | |
lastLength: 0 | |
fetch: (options) -> | |
options or= {} | |
if options.reset | |
@index = 1 | |
@lastLength = 0 | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// includes bindings for fetching/fetched | |
var PaginatedCollection = Backbone.Collection.extend({ | |
initialize: function() { | |
_.bindAll(this, 'parse', 'url', 'pageInfo', 'nextPage', 'previousPage'); | |
typeof(options) != 'undefined' || (options = {}); | |
this.page = 1; | |
typeof(this.perPage) != 'undefined' || (this.perPage = 10); | |
}, | |
fetch: function(options) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
grep = `git grep -n #{ARGV[0]} #{ARGV[1]}` | |
files = grep.scan /.*\:\d+/ | |
interrupt = false | |
files.each do |file_with_line| | |
exit if interrupt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
churn number and file name | |
git log --all -M -C --name-only | grep -E '^(app|lib)/' | sort | uniq -c | sort | awk 'BEGIN {print "count,file"} {print $1 "," $2}' | |
graph of churn number and frequency | |
git log --all -M -C --name-only | grep -E '^(app|lib)/' | sort | uniq -c | sort | awk '{print $1}' | uniq -c | sort | awk 'BEGIN { print "frequency,churn_count"} { print $1,$2}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# command prefix (like screen) | |
set -g prefix C-a | |
bind C-a send-prefix | |
# basic settings | |
set-window-option -g mode-keys vi # vi key | |
set-option -g status-keys vi | |
set-window-option -g utf8 on # utf8 support | |
set-window-option -g mode-mouse off # disable mouse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://unicorn.bogomips.org/SIGNALS.html | |
rails_env = ENV['RAILS_ENV'] || 'production' | |
rails_root = ENV['RAILS_ROOT'] || "/data/github/current" | |
God.watch do |w| | |
w.name = "unicorn" | |
w.interval = 30.seconds # default | |
# unicorn needs to be run from the rails root |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source "http://rubygems.org" | |
gem "janky", "~>0.9" | |
gem "pg" | |
gem "thin" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
# Host Database | |
# | |
# localhost is used to configure the loopback interface | |
# when the system is booting. Do not change this entry. | |
## | |
127.0.0.1 localhost | |
127.0.0.1 localhooker | |
127.0.0.1 locohost |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install git | |
sudo apt-get install g++ curl libssl-dev apache2-utils | |
sudo apt-get install git-core | |
# download the Node source, compile and install it | |
git clone https://github.com/joyent/node.git | |
cd node | |
./configure | |
make | |
sudo make install | |
# install the Node package manager for later use |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias all='git for-each-ref --count=400 --sort=-committerdate refs/heads/ --format='"'"'printf "%%-40s %%4d behind\t%%4d ahead\t%%-20s\t%%30s\n" "$(echo %(refname) | cut -d / -f 3-)" "$(echo $(git log %(objectname)..head --oneline | wc -l))" "$(git log head..%(objectname) --oneline | wc -l)" "%(authorname)" "%(authordate)"'"'"' | $SHELL | less' |