Philip Roberts

Over the Blue Moon.

Over the Blue Moon.

Time is not a nice person, I know because the signs said it. Time can be generous, but ultimately, time is indifferent. Time does not give two damns or a fuck. So what will you do? What will we do . .?

—Pase Rock From Sign (feat. Pase Rock) by Nujabes on Modal Soul

Departing the North Sea on New Years Day 2012.

Departing the North Sea on New Years Day 2012.

A wee whisky cocktail.

A wee whisky cocktail.

Faster rake tasks in Rails

Rake tasks are awesome for project specific scripts among other things, but in rails projects they suck for short tasks that don’t depend on rails. Here’s why:

  1. You type rake my_task_that_doesnt_depend_on_the_rails_environment
  2. Rails loads (10-20 seconds)
  3. Only then does your superfast rake task run. Boring!

Looking for a solution I came across Xavier Shay’s attempt to deal with this.

His solution is to maintain a list of rails tasks which depend on Rails (like rake db:migrate) in your Rakefile, and have the Rails environment autoload when any of those tasks are called. Any tasks in lib/tasks will now run nice and fast.

This helped, but it means you have to maintain a list of all the Rails tasks you may want to use (and any rake tasks included by gems used in your app) in your Gemfile, or remember to append LOAD_RAILS=1 to your rake call to force rails to load.

Because I can’t be bothered trying to remember which of my tasks depend on rails, I modified his Rakefile to autoload the Rails environment if Rake can’t find a task (on the assumption that it’ll be hidden in Rails/gem somewhere. This has the side-benefit of loading the :environment task, that any tasks which require the Rails environment depend on, if and when needed.

If you have any thoughts I’d love to hear them, the gist is here.

Courgette Frittata

Courgette Frittata

Cucumber and pear salad

Cucumber and pear salad

Lemon Mould from The Silver Spoon, with caramel shards and shortbread. Nom nom.

Lemon Mould from The Silver Spoon, with caramel shards and shortbread. Nom nom.

Finally, a top technical dating tip: you’ve no idea how much more motivating it is to someone technical to look at the shitty prototype you had built for $500 on Rent-a-coder, or painfully clubbed together yourself, and say, “Obviously I can help you build that much better,” than it is for them to listen to a shitty pitch.

—Great post on finding tech co-founders by @andyy: http://www.kernelmag.com/scene/2011/12/desperately-seeking-sysadmins/

Why Do Sandwiches Taste Better When Someone Else Makes Them?

When you make your own sandwich, you anticipate its taste as you’re working on it. And when you think of a particular food for a while, you become less hungry for it later. Researchers at Carnegie Mellon University, for example, found that imagining eating M&Ms makes you eat fewer of them. It’s a kind of specific satiation, just as most people find room for dessert when they couldn’t have another bite of their steak. The sandwich that another person prepares is not “preconsumed” in the same way.

- Daniel Kahneman