- Life is too short…
Life is too short…

via Hugh MacLeod at Gaping Void
- Aha! The trick to getting custom named routes!
It was frustrating me that I had to hardcode strings like
/activate/#{user.activation_token}when using link_to and other constructs with wacky custom routes (because they wouldn’t auto-generate a named route). The trick is to add:as => 'routename'to your routes.rb match statement. This will then exposeroutename_urlto the rest of your app so you can doroutename_url(user.activation_token)to get the proper url.It’s easy when you know how… Also,
$ rake routesis essential to understanding the magic under the hood. Use it!
- Upgrading your Authlogic Gem for Rails3
If you’re using Authlogic in Rails3 (or if you’re upgrading your existing app from 2.3.8 to Rails3) you really need to be using the rails3 branch of the Authlogic gem. If you’re using Bundler, this is super-easy because you just need to update your Gemfile.
In your Gemfile, update the authlogic line to be:
gem 'authlogic', :git => 'git://github.com/odorcicd/authlogic.git', :branch => 'rails3'
Now you should run
$ bundle installto grab the new gem. Then, there are just a few more deprecated things in Rails3 that you’ll need to change in your upgraded app. I’ll try to enumerate here from memory, so please forgive me if I forget something.
- InvalidAuthenticityToken on Logout when using Authlogic
This one took me a while to debug. When upgrading my existing application to Rails 3 almost everything was working fine except whenever I would click the Logout link I would get an error because Rails couldn’t verify that the UserSessionsController#destroy request was valid from my app.
This is the error message shown:
ActionController::InvalidAuthenticityToken in User sessionsController#destroyactionpack (3.0.0) lib/action_controller/metal/ request_forgery_protection.rb:96:in `verify_authenticity_token'And the solution is simple, you just need to add the new csrf_meta_tag helper to your generated page (probably in the /views/layouts/application.html.erb file).
- Running Rails 3 using RVM
Getting RVM installed and managing two ruby environments (ruby 1.8.7 + rails 2.3.8 / ruby 1.9.2 + rails 3.0.0) went better than expected. This gist pointed me in the right direction. Now hopefully the process of migrating a rails 2.3.8 app to 3.0.0 will be as quick and easy.
- 99 Excuses For NOT Making Ideas Happen
Common excuses for NOT making ideas happen:
1. I DON’T HAVE ENOUGH TIME.
Extra time, like money, rarely just materializes out of thin air. We have to work for it. If “finding creative time” is a struggle for you, consider getting proactive about carving it out, and doing the most important work first.
2. I’M AFRAID OF FAILURE.
If we really push ourselves, we will fail more than we’ll succeed. But that’s how we gain experience, how we learn, how we grow. The greater failure is to never risk failure at all. Choreographer Twyla Tharp: “If you do only what you know and do it very, very well, chances are that you won’t fail. You’ll just stagnate, and your work will get less and less interesting, and that’s failure by erosion.”
3. I’M NOT INSPIRED.
Inspiration comes from action, not the other way around. Our friends at Red Lemon Club shared this insightful tidbit from leadership guru John C. Maxwell: “”The whole idea of motivation is a trap. Forget motivation. Just do it. Exercise, lose weight, test your blood sugar, or whatever. Do it without motivation. And then, guess what? After you start doing the thing, that’s when the motivation comes and makes it easy for you to keep on doing it.”
[... to see 4-99, read the rest of the article]
via 99 Excuses For NOT Making Ideas Happen :: Tips :: The 99 Percent.
- Debunking Myths of the Medical World
Interesting article from the NY Times that looks at unusual research findings that seem to fly in the face of reason. He looks at surprising medial statistics of class presidents, Academy Award-winners, and drivers, among others:
“Life is a marathon, not a sprint,” he read, adding, “A great deal of mischief occurs when people are in a rush.”
To that end, he studied the psychology around changing lanes in traffic. In an article published in Nature in 1999, Dr. Redelmeier and Professor Tibshirani found that while cars in the other lane sometimes appear to be moving faster, they are not.
“Every driver on average thinks he’s in the wrong lane,” Dr. Redelmeier said. “You think more cars are passing you when you’re actually passing them just as quickly. Still, you make a lane change where the benefits are illusory and not real.” Meanwhile, changing lanes increases the chances of collision about threefold.
via Scientist at Work – Dr. Donald A. Redelmeier – Debunking Myths of the Medical World – NYTimes.com.
- Running my own Private Git Host with Multiple Users
Maybe I’m just cheap, or maybe I have a run-my-own-servers fetish, but instead of using GitHub for my private personal and small-team projects I’m now hosting the Git repos on my own servers. Two excellent blog posts explained the first step of setting up a private Git server on Ubuntu and the second step of using gitosis to manage multiple repos and users with access.
Took about an hour to set it up and test with two users and three forks. One note: you might want to use GitHub-style fork names like “cgooley/whirlfood” to keep things better organized if you plan on having many projects.
- Coming Soon: Earbits Radio iPhone App
Earbits is a new 24×7 commercial-free, subscription-free free internet radio service that just launched last Friday. Once it’s fully baked, it’s going to have some really cool artist discovery tools and great utilities for bands who want to get their music heard.
I’ve been involved in the minor capacity of building the actual player used on the website and for embedded players on partner websites. It’s been a nice refresher of using my javascript skills. And now, I’m expanding my role into building the first mobile Earbits app for the iPhone. Since I’ve been trying to learn Ruby on Rails over the past week or so, I decided that I might as well also try and learn Objective-C and that whole mess too.
Keeps life interesting. But here’s the teaser shot taken right after the first time I actually deployed the radio app to my iPhone.

Hope to have a beta version done in a week or so, depending on API availability, and get it into the App Store sometime in September.
- Poster: My Strategic Plan
I see this poster every day. It keeps me in the right mindset. And it’s way better than those “motivators” posters.

“We have a strategic plan… it’s called Doing Things.” [get one for yourself]
