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
robby-russells-macbook-pro% sudo /opt/local/bin/port selfupdate | |
MacPorts base version 1.600 installed | |
Downloaded MacPorts base version 1.600 | |
The MacPorts installation is not outdated and so was not updated | |
selfupdate done! | |
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
.transparent | |
{ | |
filter:alpha(opacity=60); | |
-moz-opacity: 0.6; | |
opacity: 0.6; | |
} |
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
I use Cucumber 0.3.97. Your mileage may vary with older versions. | |
# Install guillaumegentil's RSpactor gem | |
sudo gem install guillaumegentil-rspactor | |
# Change your database.yml to include the following | |
test: &TEST | |
database: your_database_name_here | |
<<: *login |
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 | |
puts "looking for the gems to upgrade..." | |
gem_info = Struct.new(:name, :version) | |
to_reinstall = [] | |
Dir.glob('/Library/Ruby/Gems/**/*.bundle').map do |path| | |
path =~ /.*1.8\/gems\/(.*)-(.*?)\/.*/ | |
name, version = $1, $2 | |
bundle_info = `file path` | |
to_reinstall << gem_info.new(name, version) unless bundle_info =~ /bundle x86_64/ | |
end |
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
#RUBYISMS | |
a = b.foo | |
if a.empty? | |
a = b.bar | |
else | |
a.reverse! | |
end | |
#can be simplied a little by assigning and |
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
function migrate() { | |
if [[ $1 == '' ]]; then | |
rake db:migrate RAILS_ENV=development && rake db:migrate RAILS_ENV=test | |
else | |
rake db:migrate RAILS_ENV=$1 | |
fi | |
} | |
function rollback() { | |
if [[ $1 == '' ]]; then |
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
Using Ruby Enterprise Edition with RVM | |
* Install RVM | |
zsh < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head ) | |
rvm update --head | |
* Install Readline package |
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
gem update ZenTest | |
gem install autotest-rails | |
gem install autotest-growl | |
gem install autotest-fsevent | |
Install growlnotify if not already installed | |
.zshrc | |
# For autotest |
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
var Cache = function() { | |
this.table = {}; | |
}; | |
Cache.prototype = { | |
'get': function(key) { | |
return this.table[key]; | |
}, | |
'set': function(key, value) { | |
return this.table[key] = value; |
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. | |
<script type="text/javascript" charset="utf-8"> | |
function log(string){ | |
document.getElementById('log').innerHTML += (string + '<br/>'); | |
} | |
document.getElementById('the_div').addEventListener( | |
'click', function(){ log('the_div!') }, true); |
OlderNewer