If you want to pass information to a Camping controller, all you have to do is define the class like this:class Index < R '/(\d+)'
get(id)
Now whatever was matched by the regex \d+ can be retrieved by the variable id. If you want to pass more than one variable, just chain them like this:class Index < R '/(\d+)/(\w+)'
get(id, action)
Each of your regex groups will be passed as a variable.

If you forget to add the arguments to the get method, you'll get an error like this:

Camping Problem!

MyApp::Controllers::Index.GET

ArgumentError wrong number of arguments (1 for 0):

I have GNU screen running on a couple of boxes. Occasionally I accidentally ssh from inside screen to the other box and attach the remote screen, purely out of habit. That means that C-a sends a signal to the outer screen. You can send a real C-a to any application through screen with C-a a, so to detach the inner screen you use C-a a DD.
One of the most raved about features of TextMate is snippet expansion. Felix Ingram has written a Vim plugin that emulates this behaviour, SnippetEmu. I haven't had much of a play with it yet, but it looks like a real time saver. You need Vim 7, and make sure you have the following in your vimrc: filetype on filetype plugin on
I've just created my first Yahoo! Pipe, and it was incredibly easy. I subscribe to Lifehacker, which is full of really good ways to procrastinate - ah, improve your productivity. However, I use a Mac, so I really don't want to see all the Windows tips. The screenshot below shows what 30 seconds in Yahoo! Pipes let me do; filter out all the Windows tips. Lifehacker feed in Yahoo! Pipes Here's the feed.
I'm trying to build PHP against the MySQL supplied binary on my Mac mini running 10.4.9. For some reason it's looking in the wrong place for libraries, so I get the following error: /usr/local/mysql/lib/mysql/libmysqlclient.15.dylib Referenced from: /Users/michael/build/php-5.2.3/sapi/cli/php Reason: image not found /usr/local/mysql/lib exists and contains the libraries. It seems like a horrible fix but the following "fixes" the problem: sudo ln -s /usr/local/mysql/lib /usr/local/mysql/lib/mysql
When you save an object to a session in one file, say write.php, and then retrieve it from another, say read.php, PHP needs to know about the class definition so that it knows how to unserialize it from the session. If you don't include the class in read.php, you'll get an error complaining about __PHP_Incomplete_Class.
In the middle of the Tomcat 5 installation, MacPorts was unable to download the required version of antlr, 2.7.7. After a bit of digging, it became clear that this was because the antlr website only has the latest versions available for download. The required version of antlr is available in the gentoo distribution, so you can get around the problem.
  1. Download antlr-2.7.7.tar.gz from gentoo or I mirror. I got it from Planet Mirror.
  2. Edit the antlr portfile (by default it's at /opt/local/var/db/dports/sources/ rsync.rsync.darwinports.org_dpupdate_dports/lang/antlr/Portfile (line split for readability)). You need to change master_sites to the location of the antlr ...
[read more]
While trying to book an international flight online through Emirates, clicking submit on the second last step in an involved process I got the following error message:
ERR_shortmiddlename_1
So friendly. Certainly gives me a way forward, like step-by-step instructions about how to solve the problem. My middle name is part of my profile, and there are certain things in your profile you can't edit. Like your name. When I joined Skywards, the Emirates reward program, I'd entered "C" as my middle initial, and after a recent "upgrade" the full middle name was required. The error message was a show ...
[read more]
I hate using a mouse. I much prefer to work with the keyboard. I also do a lot of work in a browser. One of the most useful keyboard shortcuts I've come across in Firefox is the apostrophe. If you want to go to a link, simply type ' and start typing the link text. For example, gootodo doesn't have any keyboard shortcuts, but I can create a new todo by typing 'new and hitting enter. That's quicker than moving my hand to the mouse and moving to the link. You can also go to the detail of a particular ...
[read more]
My aim was to find a bunch of zip files, unzip with the -t flag to get their contents, and look for a specific file in the archive. The output I wanted was the name of the zip, followed by the path to the file. Like this:
ZIP: archive.zip
   testing: path/to/the/filename  OK
find . -name \*.zip -exec unzip -t {} \; grep filename gives me the path to the file in the archive, but not the name of the file (aside: I always forget that you need space, backslash, semicolon at the end of the find exec flag). I ended ...
[read more]