I did a very stupid thing. I automatically updated my syntaxhighlighter plugin (which is excellent by the way) through the wordpress admin panel. I also forgot that I had made a custom theme and added a few more matchers to the ruby brush, which were subsequently overwritten in the update. Bummer.
So. Here is the theme, [...]
More
Well, with the release of Rails 2.2 and the ability to create custom error pages I figured I’d revisit my 404/500 pages and try to do it the new way.
Setting up the rescue_from methods were simple enough, but I noticed that when I was capturing my error 500s it wasn’t logging the exception. Here is [...]
More
I’ve been finding myself using YAML a lot for silly enums — maybe because I’m lazy, but mostly because there is no need to manage them via a database table. Here is just a simple example — I need to associate a region and division to a client. These will not change much and are [...]
More
Another common thing I like to do is use a helper method to handle tricky tag-soupish markup. A client may have 1 URL, in which case I would like to simply display it, but if they have multiple URLs I’d like to put it in a list format. The only problem with using the content_tag [...]
More
One piece of code I find myself using a lot is for defaulting values using a simple conditional if statement: condition ? true : false. This isn’t bad in itself, but it also isn’t very powerful and dynamic. I wrote a small application helper which wraps this function and provides a pretty nice way [...]
More
I was trying to tag a few of my internal apps with a subversion revision number just for personal reference. Since running the command svn info yields YAML-ish output the ruby YAML library can load it. Sweet. The next step was just wrapping it in a class and creating some instance variables and methods for [...]
More
Took the idea from Dive Into Mark because I’m bored.
If you’re curious to see which commands you use the most just run:
$>history | awk ‘{a[$2]++}END{for(i in a){print a[i] ” ” i}}’ | sort -rn | head
# local server
133 l
70 cd
47 svn
38 ..
29 e
26 mv
20 ll
10 rm
10 cp
8 ror
# remote server
123 l
74 cd
35 [...]
More
Update!
Switch spaces using your Apple Remote! (Or view the project on GitHub)
I was just goin around on the interblagosphere today and stumbled upon Erling Ellingsen’s smackbook pro. If you’ve never heard of this then you’re in for a shock. The basic idea behind what he has created is a way to switch virtual desktops simply [...]
More
This is a short and sweet post. I was trying to merge and sync all my calendars (something I do every so often which leaves me frustrated, drunk and huddled in a corner crying) and decided on google calendar as a main point since I have my work Outlook synced up with it (using their [...]
More
I found that I use a lot of input fields which need to display a simple message to the user like “type the molecular structure of didehydro-dimethylether onium cation” — and when they focus the box it needs to clear, and when they blur the box it needs to go back to that message. Theres [...]
More