April 2008
11 posts
2 tags
Foxy Fixtures fail with namespaced models →
Sadly, Animal::Fox can’t be foxy.
2 tags
I've been committed. →
To make_resourceful and altered_beast.
1 tag
Logrotate hates missing files and directories
/usr/sbin/logrotate /etc/logrotate.conf
Is your friend. Watch for errors on the command line when executed.
1 tag
Git back.
Apparently it’s git reset --hard HEAD instead of git revert.
2 tags
I love remote tail, thank you Capistrano
I use remote tail on a daily basis. Well, that’s not completely true, probably more of an hourly basis during a normal business day. Below is a snippet of the Capistrano 2 code I use to tail remote files:
desc "Tail all or a single remote file"
task :tail do
ENV["LOGFILE"] ||= "*.log"
run "tail -f #{shared_path}/log/#{ENV["LOGFILE"]}" do |channel, stream, data|
puts "#{data}"
...
2 tags
Benchmarking Popular Template Engines
Enter RTBench, a template engine performance benchmarking suite. The following benchmarks were compiled using RTBench and run on a MacBook Pro 2.4GHz Core 2 Duo with 4GB RAM, performing each task 10,000 times:
user system total real
Tasks::AttributeAccess (Handlers::Erb) 2.140000 0.010000 2.150000 ( ...
1 tag
Illegal Indentation: Only two space characters are...
HAML is a bit picky with whitespace and if you’re editing your text documents in TextMate, then you’ve no doubt run into the above mentioned Illegal Indentation error. Luckily, fixing this is a simple task and doesn’t require that you left-justify all of your source code.
In the “Tab size” drop down at the bottom of the TextMate window in your HAML document, check...
2 tags
Boost your Rails Controller params[:fu] →
Useful params techniques
2 tags
Static pages for the enterprise →
1 tag
There was an error creating the child process for this terminal
– An unhappy Gnome Terminal, fixed by hollywoodb by adding devpts to fstab
1 tag
class Object
##
# @person ? @person.name : nil
# vs
# @person.try(:name)
def try(method)
send method if respond_to? method
end
end
- Chris Wanstrath, GitHub [Ruby try()]