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
activerecord.errors.models.content.attributes.topic.invalid | |
activerecord.errors.models.content.invalid | |
activerecord.errors.messages.invalid | |
# with STI | |
activerecord.errors.models.post.attributes.topic.invalid | |
activerecord.errors.models.post.invalid | |
activerecord.errors.models.content.attributes.topic.invalid | |
activerecord.errors.models.content.invalid | |
activerecord.errors.messages.invalid |
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
humans do: | |
errors.add(:topic, :custom_invalid) | |
rails does: | |
errors.add(:topic, :invalid, :default => :custom_invalid) | |
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
Marcel: "Ja, we willen graag dat jullie een huis bouwen. Het moet met hout, stenen of een voordeur!" | |
Iain: "We gebruiken dezelfde versie van WordPress als Hannibal toen hij blogde over hoe hij olifanten gebruikte om de Alpen door te trekken" |
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 "rubygems" | |
require "rbench" | |
RBench.run(500) do | |
report("memoed") do | |
Foo.memoed("hello") | |
end | |
report("unmemoed") do | |
Foo.unmemoed("hello") | |
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
# File management | |
run "rm README" | |
file "README.rdoc", "TODO add readme content" | |
run "cp config/database.yml config/database.example.yml" | |
run "rm public/index.html" | |
# RSpec as plugin, because it won't freeze easily as gem | |
plugin "rspec", :git => "git://github.com/dchelimsky/rspec.git" | |
plugin "rspec-rails", :git => "git://github.com/dchelimsky/rspec-rails.git" |
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
#!/bin/bash | |
# Unattended REE/Passenger installation | |
# Source: http://weblog.brightlight-ict.nl/2008/12/unattended-passenger-ruby-enterprise-installation-on-ubuntu-8/ | |
# 15/03/09 Updated to use latest r.e.e. and passenger 2.1 and rewrote bits thanks to the comments left on my blog. Thanks guys | |
if [ "$(whoami)" != "root" ]; then | |
echo "You need to be root to run this!" | |
exit 2 | |
fi | |
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 File.expand_path(File.join(File.dirname(__FILE__), "..", "support", "paths")) | |
# Commonly used webrat steps | |
# http://github.com/brynary/webrat | |
# Dutch webrat steps translated by Iain | |
# http://iain.nl/ | |
Stel /^ik ben op (.+)$/ do |page_name| | |
visit path_to(page_name) | |
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
$ rake spec | |
/home/iain/code/sail/vendor/rails/activesupport/lib/active_support/dependencies.rb:443:in `load_missing_constant': uninitialized constant Remarkable::ActiveRecord (NameError) | |
from /home/iain/code/sail/vendor/rails/activesupport/lib/active_support/dependencies.rb:80:in `const_missing_with_dependencies' | |
from /usr/local/lib/ruby/gems/1.9.1/gems/remarkable_rails-3.1.2/lib/remarkable_rails/active_orm.rb:17:in `<top (required)>' | |
from /home/iain/code/sail/vendor/rails/activesupport/lib/active_support/dependencies.rb:158:in `require' | |
from /home/iain/code/sail/vendor/rails/activesupport/lib/active_support/dependencies.rb:158:in `require' | |
from /usr/local/lib/ruby/gems/1.9.1/gems/remarkable_rails-3.1.2/lib/remarkable_rails.rb:25:in `<top (required)>' | |
from /home/iain/code/sail/vendor/rails/activesupport/lib/active_support/dependencies.rb:158:in `require' | |
from /home/iain/code/sail/vendor/rails/activesupport/lib/active_support/dependencies.rb:158:in `require' | |
from /home/iain/code/sail/spec/spec_helper.r |
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
$ rake spec | |
(in /home/iain/code/remarkable/remarkable) | |
Exemplo desativado: não deve conter os valores fornecidos | |
Example disabled: single contain | |
Example disabled: should contain the given values | |
Example disabled: should not contain the given values | |
...............*................................................ | |
Pending: |
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
$ time dd if=/dev/zero bs=1024 count=1000000 of=~/1Gb.file | |
1000000+0 records in | |
1000000+0 records out | |
1024000000 bytes transferred in 15.577478 secs (65735929 bytes/sec) | |
real 0m15.609s | |
user 0m1.299s | |
sys 0m6.948s | |
OlderNewer