Erik A. Hanson's Weblog

Archive for the 'Howto' Category

A Ruby Script To Generate a JsUnit Suite

Posted: Saturday, May 26th, 2007    Tags: Howto, Javascript, JsUnit

I’ve got a bunch of JsUnit tests for a project I’m working on and I wanted an easy way to create a JsUnit suite that can run all the tests but also run any individual test page. Also, I wanted to be able to view any test page so I could debug the tests with Firebug. I also didn’t want to run a web server all the time, so I wanted a script that would create a static HTML file.

Debugging a JsUnit Test With Firebug

Posted: Thursday, November 16th, 2006    Tags: Howto, Javascript, JsUnit

Sometimes I find that I want to debug a JsUnit test because I’m not quite sure what’s going on in the browser. FireBug has a nice debugger, but I couldn’t get it to work with the JsUnit test runner. I could set breakpoints in JsUnit itself, but any breakpoints in my test would be ignored. And then it hit me: ditch the test runner.

A Bold Prompt in Bash

Posted: Sunday, February 12th, 2006    Tags: Howto

I wanted my Bash prompt to be bold and red so I could find my one line of input amongst the million lines of output in my terminal. I’m no Unix nerd, so I don’t really know offhand where to look for this info. After a bunch of Googling, I found something that works for me.

Join Tables with Attributes in Rails

Posted: Sunday, February 12th, 2006    Tags: Howto, Ruby on Rails

I had a little trouble today with join tables that contain attributes.

Setting XSL Parameters from Javascript in AJAXSLT

Posted: Sunday, October 23rd, 2005    Tags: Howto, Javascript, XSL

Recently, I was trying to pass some info from my Javascript into my XSL stylesheet. Here’s how I finally did it.

How To Use Google’s Ajaxslt Library

Posted: Friday, September 30th, 2005    Tags: Howto, Javascript, XSL

Google has written an open-source library called Ajaxslt that implements XPath and XSLT in Javascript. It took a bit of playing to get it to work.

Writing a Ruby Test Suite that RDT and Test::Unit Can Understand

Posted: Tuesday, September 20th, 2005    Tags: Howto, Ruby on Rails

I’m working on a Ruby project using Eclipse and RDT. RDT provides a couple useful features, including support for running unit tests with Test::Unit. Unfortunately, it’s pretty primitive at the moment. One big problem is that it can’t run all your tests. So we wrote a test suite class that runs all tests and can be run from Test::Unit:.

Installing Ruby on Rails on Mac OS X 10.4 (Tiger)

Posted: Wednesday, September 7th, 2005    Tags: Howto, Ruby on Rails

I had a hell of a time getting Ruby on Rails to work on Mac OS X 10.4 (Tiger). Here’s what ended up working for me.

About Me

I'm a software developer and consultant in San Francisco. I mostly develop web apps in Javascript, Java and Rails. There's a little more about me on my LinkedIn profile.

Recent Projects

wshlst.com: a group-oriented wish list website.

BoardsConsult​/​RotationTracker: a site to help medical residents prepare for the U.S. Medical Licensing Exam, and a related site to help medical schools evaluate and track the progress of the residents in their programs.

Jobs

I moderate a few completely free jobs mailing lists with RSS feeds and zero spam: XP jobs, Rails jobs and Mac development jobs. Also, my pals at Pivotal Labs have agile Rails and Java job openings.

Plug: Web Hosting

Looking for cheap shared web hosting and/or domain registration? I've been using DreamHost for years and I've been very happy with them. They offer tons of disk space and bandwidth, one-click installation for apps like WordPress and Gallery, unlimited domains, thousands of email accounts, private domain registration, and more. They are also a nice bunch of folks, not some big dumb company.