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
/* | |
* Refs | |
* | |
* http://documentcloud.github.com/backbone/ | |
* http://msdn.microsoft.com/en-us/scriptjunkie/hh377172.aspx | |
* http://arturadib.com/hello-backbonejs/ | |
* http://stackoverflow.com/questions/5629972/integrating-json-feed-with-backbone-js | |
* http://stackoverflow.com/questions/6048480/backbone-js-fetch-problem-cant-refresh-data-immediately | |
* http://documentcloud.github.com/backbone/docs/todos.html | |
* |
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
# Commands to build a .deb with ruby 1.9.2 | |
apt-get install libssl-dev | |
gem install fpm | |
cd /usr/src | |
wget ftp://ftp.ruby-lang.org//pub/ruby/1.9/ruby-1.9.2-p180.tar.gz | |
tar -zxvf ruby-1.9.2-p180.tar.gz | |
cd ruby-1.9.2-p180 | |
./configure --prefix=/usr && make && make install DESTDIR=/tmp/installdir | |
cd .. | |
# This builds the package. Replace x86_64 with i386 or the arch you're building |
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
// 1: how could you rewrite the following to make it shorter? | |
if (foo) { | |
bar.doSomething(el); | |
} else { | |
bar.doSomethingElse(el); | |
} | |
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
// 1: how could you rewrite the following to make it shorter? | |
foo ? bar.doSomething(el) : bar.doSomethingElse(el); | |
// 2: what is the faulty logic in the following code? | |
var foo = 'hello'; | |
(function() { |
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
size=`rsync --delete --delete-excluded -pthrv --exclude-from \ | |
/Users/paul/.backup/exclude /Users/paul/Documents/ \ | |
/Users/paul/Dropbox | egrep -o "total size is (.*)G" | egrep -o "[0-9\.]+"` | |
if [ "$size" = "" ]; then | |
size=0 | |
fi | |
if [ `echo "$size < 1.8" | bc` = 0 ]; then | |
echo "`date`: WARNING: Size is running out for Dropbox backups.\ | |
(Currently using ${size} GB.)" 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
" File: commonjs-package-json | |
" Author: Ash Berlin <ash.berlin@gmail.com> | |
" Last Change: 23-Feb-2010. | |
" Version: 1.1 | |
" Usage: | |
" | |
" Use by placing something like the following in your .vimrc: | |
" | |
" let g:maintainer='{ "name": "Ash Berlin", "web": "http://ashberlin.com" }' | |
" |
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
# Helper to execute blocks of shell commands via capistrano run | |
def run_chunk(cmd,options={}) | |
run cmd.split("\n").map {|l| l.strip }.join(" "), options | |
end | |
# Example | |
task :revision, :roles => [:app] do | |
run_chunk %Q{ | |
rm -f #{current_release}/public/REVISION;cp #{current_release}/REVISION #{current_release}/public/REVISION; | |
cd #{current_release}; git config --list | grep branch\.deploy >> #{current_release}/public/REVISION; |