My Octopress Blog

A blogging framework for hackers.

Speeding Tickets

A few years ago I was pulled over for speeding. The officer got out of his car and came up to my window and asked to see my pilot’s license (since I was flying). I happened to have a private pilots license so I pulled it out gave it to the officer. He let me go and told me to slow down.
How they got out of traffic tickets - CNN.com

Work Can Be Enjoyable

It does not seem to be true that work necessarily needs to be unpleasant. It may always have to be hard, or at least harder than doing nothing at all. But there is ample evidence that work can be enjoyable, and that indeed, it is often the most enjoyable part of life.
—Mihaly Csikszentmihalyi, Flow: The Psychology of Optimal Experience, 1990

Simplicity Is Effective

It is simplicity that makes the uneducated more effective than the educated when addressing popular audiences
—Aristotle

Making Millionaires in Your Sleep

There was a little boat sitting in English Bay the other day. We stumbled upon it when we were out cruising around the bay.

After a quick little google search, we found out that it belongs to Roman Abramovich, the Russian Billionaire.

Out of sheer boredom, my roommate and I did the math and figured out what Roman makes per second, assuming his 13.3 billion dollar net worth makes him an average of 10% per annum.

42 Dollars USD per SECOND!

Well, it may not be much.. but at least he’s off to a good start.

By the time he wakes up from a night’s rest, he could give away $1.23 million to a lucky passerby and he wouldn’t have any less than he did when he went to sleep. And that’s not counting compound interest.

In 24 hours, he could crown 4 new millionaires. 28 new millionaires per week. One thousand, four hundred and fifty six new millionaires per year without any impact on his net worth.

*sigh*

In the meantime.. I just like looking at his boat.

Accidentally Deleting All the .svn Folders

I did something really stupid today. I deleted all of the .svn folders in my project before committing my changes, and after building a major addition to it. I was trying to delete them from another folder, and used the wrong terminal window. :|

Anyway, point being, I fixed it!

Here is what I did:

> pwd
~/Development/project_name/
> cd ..
> svn co http://svn.domain.com/repo/trunk/ project_name_temp/
> cd project_name_temp
> find .  -type d -name ".svn" -exec mv -f '{}' ../project_name/log/.'{}'  \;
find: ./app/.svn: No such file or directory
find: ./app/apis/.svn: No such file or directory
(repeated.. this is normal)
> cd ..
> rm -R project_name_temp/

The key was:

find .  -type d -name ".svn" -exec mv -f '{}' ../project_name/log/.'{}'  \;

Redirecting Moveable Type URLs

Well, I read the different options that were posted on how to migrate the links, and I didn’t like any of them. I wasn’t really a fan of leaving my MoveableType installation on the server for X duration. So, I wrote my own solution that is easily applied to the WordPress installation in the form of a custom 404 page. The page is fairly simple. All it does is the following:

  • Tries to figure out what the title of the post is, or should be
  • Formats the title according to what WordPress wants it to be
  • Checks the database to see if a post by that name exists
  • If it does, it sends you there with a proper 301 redirect
  • If it doesn’t, it displays the standard error page
The nice thing about this technique is that you have full control over it, and since it’s part of the template, you can edit it quickly and easily without using FTP or SSH. I have attached the PHP file that I used here, and it is full of comments. Custom 404 Page for MoveableType Links I would love to hear any feedback or comments on how it can be improved… or even why it sucks.

Flight Searching Done Right

Finding a good place to go on vacation has always been hard for me. Like most people, I’m cheap when it comes to big purchases, and since I spent so much time in Maui when I was a kid, I don’t really subscribe to the idea of spending a few thousand dollars per person to relax on a beach.

I also don’t really have any restrictions on when I take a vacation, so all I’m really looking for is a good deal that I can snap up for a few days away… or a good price on a flight to somewhere that I can dissapear for a few weeks.

For those reasons, finding flights has always been hard. I don’t care about the flight dates. I don’t care about the destination. In fact, I don’t care which Airport I leave from - SEA (Seattle )is only an hour.5 away from YVR (Vancouver). All I want to do is say where I am, and have them tell me what my options are… and I want them to do it quickly and comprehensively. To be picky, I would also like them to tell me in Canadian Dollars so that I don’t have to convert it in my head.

Well wouldn’t you know it. The geniuses over at Kayak have gone and built the best flight search I have ever seen. It does pretty much everything I would want it to do. It’s quick, it’s easy, and I can tell it my currency..

It sites like this that make me love the internet.

Thank you Kayak. :)