Well, one of them anyone and maybe not the one he loves the most.
All-around pretty smart Rails-guru guy Dr. Nic is selling his Rails-based MyConfPlan site for charity so he can attend a conference session:
Why? Because all the money paid by the winner is going to the Chad Fowler and Marcel Molina Jr fund for all-things Humanitarian, and so I can go to their Testing Training Day on the 17th of September in Berlin. Minimum donation is $75.
That’s right, the winner’s money could be entirely tax-deductible as its all going to charity. (You get the site’s code base and the myconfplan.com domain (cost of transfer is yours) are yours. I get entry to the workshop.
If it raises $500 then you are donating $500. If it raises $2,000,000 then you are donating $2×10^6.
I like it. Rather than let an interesting niche site languish on the vine it gets sold off to someone who can either learn from it or extend it, Dr. Nic gets some testing edumacation, and the charity gets some cash.
As of this posting bidding is up to AU $355. Not too shabby.
MyConfPlan in action.
chris on August 23rd 2007 in /dev/rails
Today I finally got around to editing my .bash_profile to include the following aliases. I find they make general command line use more pleasant.
The first one remaps ls to show a useful amount of information. Never in my lifetime of using computers have I ever wanted ls to output the way it does by default.
The next two just save a couple of characters by removing the cd from their respective command and optimizing the dual backstep (a cool shell script would be one that counts the number of consecutive periods and cd's back that many directories – 1).
The last one is Rails-specific and simply fires up the default server from your Rails project directory.
alias ls=’ls -alh’
alias ..=’cd ..’
alias …=’cd ../..’
alias home=’cd ~’
alias ss=’script/server’
Update: See Sam’s suggestions for fast ls variants below.
chris on August 16th 2007 in /dev/rails, /dev/random
For a class of objects in my database I extract data from one or two ways: the first directly from the database via ActiveRecord, the second from Amazon using Amazon::Ecs.
When the asset calls to Amazon to populate its properties I want to use the Amazon-provided data. When I refrence the asset without calling to Amazon (ie: the data has been cached) then I want to reference AR's properties directly. I don't want to have to make two calls dependent upon the data's source location.
In otherwords, I always want to be able to call
book.title
no matter what.
Turns out ActiveRecord makes this pretty easy:
RUBY:
-
def title
-
return @atts ? @atts.get( 'title' ) || "" : super
-
end
If there are attributes and an attribute called "title" exists, return that. If attributes don't exist then call the super class's title() which contains the data extracted from the database.
Pretty cool ActiveRecord, pretty cool.
chris on August 8th 2007 in /dev/rails