If one was inclined to use the acts_as_yaffle pattern, they would probably use the second one, rather than the heavily cargo-culted first one.
This file contains hidden or 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
# From http://jasonseifer.com/2009/02/22/offline-gem-server-rdocs | |
gem install mislav-hanna sinatra | |
echo "rdoc: --inline-source --line-numbers --format=html --template=hanna" >> ~/.gemrc | |
sudo gem rdoc --all --no-ri | |
cd ~/Projects | |
git clone git://github.com/jseifer/sinatra-rubygems.git | |
# Then add to Passenger via URL above. |
This file contains hidden or 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
# Find open file descriptors (I think) for mongrel | |
ps aux | grep mongrel_rails | awk '{print $2}' | xargs -n1 -I 'foo' /usr/sbin/lsof -p 'foo' | sort | awk '{print $2}' | uniq -c |
This file contains hidden or 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
Last login: Sat Feb 6 09:48:31 on ttys006 | |
09:55:01@[~]: which ghc | |
/usr/bin/ghc | |
09:55:07@[~]: ghc --version | |
The Glorious Glasgow Haskell Compilation System, version 6.10.4 | |
09:55:14@[~]: fucker | |
-bash: fucker: command not found | |
09:55:25@[~]: make fucking ghc work with fucking snow leopard | |
make: *** No rule to make target `fucking'. Stop. | |
09:55:45@[~]: Really? Well FUCK YOU! |
This file contains hidden or 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
require 'benchmark' | |
module Kernel | |
alias old_require require | |
def require(path) | |
#unless caller.find { |caller_line| caller_line.match /dependencies\.rb/ } | |
# return old_require(path) | |
#end |
This file contains hidden or 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
brew update | |
brew versions FORMULA | |
cd `brew --prefix` | |
git checkout HASH Library/Formula/FORMULA.rb # use output of "brew versions" | |
brew install FORMULA | |
brew switch FORMULA VERSION | |
git checkout -- Library/Formula/FORMULA.rb # reset formula | |
## Example: Using Subversion 1.6.17 | |
# |
Based on: http://coderwall.com/p/1mni7w
brew install postgresql
initdb /usr/local/var/postgres -E utf8
mkdir -p ~/Library/LaunchAgents
cp /usr/local/Cellar/postgresql/9.1.4/homebrew.mxcl.postgresql.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
This file contains hidden or 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
git log --name-only --no-merges | grep \.rb$ | sort | uniq -c | sort -nr |
This file contains hidden or 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
sj = read.csv('stocksJobs.csv') | |
myPalette = c('blue', 'red'); | |
myColors = myPalette [sj$recession] | |
scaleFunc <- function(vec, factor=5) | |
factor * (vec - min(vec)) / (max(vec) - min(vec)) | |
pointSize = scaleFunc(sj$jobClm) | |
plot(as.Date(sj$date), sj$sp500, main="S&P 500", xlab="Date", ylab="Closing", col=myColors, cex=pointSize) #- vector of point sizes | |
#- Generate legend with colors |
This file contains hidden or 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 | |
# Complete rake tasks script for bash | |
# Save it somewhere and then add | |
# complete -C path/to/script -o default rake | |
# to your ~/.bashrc | |
# Xavier Shay (http://rhnh.net), combining work from | |
# Francis Hwang ( http://fhwang.net/ ) - http://fhwang.net/rb/rake-complete.rb | |
# Nicholas Seckar <[email protected]> - http://www.webtypes.com/2006/03/31/rake-completion-script-that-handles-namespaces | |
# Saimon Moore <[email protected]> |
OlderNewer