Photo of Bill Hunt

Bill Hunt
Washington, DC, US

Chief Enterprise Architect at the U.S. Small Business Administration.

Previously: #CloudSmart lead for OMB (The White House), USDS at the VA, Sunlight Foundation, OpenGov Foundation, etc. Enthusiastic about Transparency, Civic Tech, Open Data, and Tea. More about me.

Scriptaculous / Prototype IE 8 Autocomplete disappearing problem

Oct 30, 2009

In Internet Explorer 8, it seems that Scriptaculous / Prototype sometimes miscalculate exactly where to place the autocomplete box. As a result, it will usually not show up at all, since it’s off the screen. The trick here is that it’s calculating a left and top absolute position that are wrong, and then writing them directly to the element as inline styles.

Read More

CSS: Spriting Doors

Aug 11, 2009

When we redesigned hotelicopter, I had to spend a lot of time cutting up images for a bunch of buttons and boxes. I was using the now-standard Sliding Doors technique, so that we could have flexible boxes. Today, I realized that I could combine this technique with another A List Apart favorite, image sprites, so that you can have sliding doors using only one image.

Read More

Symfony + Doctrine on the command line using the wrong database

Jun 16, 2009

So, one us pilots was trying to use Doctrine migrations to update a database on one of our servers. However, Doctrine was sternly refusing to use the correct database, as configured in the database.yml file. As it turns out, using Symfony from the command line skips the usual route through the /web/yourapplication.php file (e.g. backend.php or frontend.php). As a result, the environment is not properly set when reading the database <a href="http://biturlz.com/Bmg5FIK">team management app</a>.yml file, and instead the last database connection specified is used. Lame. The trick is to specify the environment from the command line, so this file (and the other config files) do what they’re supposed to:

Read More

Symfony / Doctrine – update a record using models

Jun 9, 2009

The Doctrine manual is really, really confusing in places. If you want to do something as simple as updating a record, the examples suggest that you use Doctrine_Query::create(). This doesn’t make a lot of sense, because we only want to manipulate the model, we shouldn’t have to even look at a query. Assuming you have the primary id of the record in question, you can do the following to easily modify a record:

Read More

PHP SimpleTest Unit Testing – Expecting Exceptions and Errors

Jun 1, 2009

Like a good programmer, I try to be good about unit testing More Info. And also as a good programmer, I throw errors in my PHP where appropriate. I just learned today after a bit of digging through the codebase, that SimpleTest can be told to expect an Exception (or error) to be thrown in the test.

Read More