Rubymine print current line
One way of debugging your ruby scripts is to print out the value of variables in different sections of your code. Rubymine has a feature called live templates that allows you to type a short command and have RubyMine extract it in to full blown code. Some built in shortcuts exist, such as def (creates [...]
Visiting Pivotal Labs in Boulder, CO
I recently had the opportunity to visit Boulder, CO (Wiki, Map). The reason for my visit was to visit the Pivotal Labs office and spend a day pairing with them. One of the cool/interesting features of the Pivotal office is that the company provides breakfast in the morning. I walked into the office to find [...]
Straight HTML/CSS for a change of pace
I recently worked on a personal project involving HTML and CSS. My wife’s family is trying to sell a 52 acre parcel of land in Noxon, MT. They wanted a website that showed the property better than the real estate agent was able to provide (short summary, only one photo). The site I came up [...]
W3C logger plugin for Rails
I just released a plugin for Rails that logs your rails requests in W3C format. Checkout http://github.com/primedia/w3c_logger/tree/master.
How to optionally load gems
I ran into an interesting problem today at work. I wanted to optionally require a ruby gem. For example, I wanted to include the metric_fu rake tasks, but if a user doesn’t have metric_fu installed, it’s no big deal. Here’s how I implemented it. I added a method to the Kernel space (where require lives) [...]
Recover files from git after deletion is committed
As I work with git, I have occasionally deleted files that I later end up needing. You can restore the files, but it’s not an intuitive process. First, I looked at the output of git log to find the commit that I deleted the files with. Then I ran: This restored all the files I [...]
RDoc preview in Textmate
While working on writing some RDOC documentation within Textmate, Rein Henrichs and I ran into a problem. Textmate will give you previews if you use markdown, but not RDOC. Below is how to do it. Create /usr/bin/rdoc2html: Make the file executable: In textmate, hit Cntrl-Option-Command-P. In the bottom left corner, click Show options. Click the [...]
Adding an alias to the Tcsh Shell
If you run a command frequently, you can create what is called an alias. The alias is usually a shorter form of the original command. To make these aliases permament, you should edit .tcshrc in your home directory. Add a line of text of the format “alias YYY ‘ZZZ’” where YYY is the command you [...]
Adding an alias to the Bash Shell
If you run a command frequently, you can create what is called an alias. The alias is usually a shorter form of the original command. To make these aliases permament, you should edit .bashrc in your home directory. Add a line of text of the format “alias YYY=’ZZZ’” where YYY is the command you want [...]