Skip to main content

Posts

Showing posts from December, 2010

Apple: Ouch!

I had my laptop wrapped in a blanket in my backpack when I dropped it on concrete at BART yesterday. It landed on the corner with quite a lot of force and bent a few metal pieces. Everything seems to work, with the exception of the ethernet port. Thankfully, I rarely use that. I'm hoping this is covered by the warranty, although it seems unlikely. The bent aluminum reminds me of body damage on a car.

Vim: PeepCode Videos

There are commercial videos on PeepCode that show how to use Vim. They're fantastic! The production quality is very high, so they're worth paying for. I bought both of them, and I learned quite a lot. Even the first one covered a ton of advanced stuff, so I highly recommend it. If you're just getting started with Vim, I suggest you: Read this blog post from Yehuda Katz. Basically, he suggests you use the GUI to get started and iteratively gain more experience with Vim. I think that's good advice. Next, I suggest you fire up Vim and take the internal tutorial. Last of all, watch Smash into Vim part I . If you're an advanced Vim user, watch both videos and tell me what your favorite part was ;)

JavaScript: IE and DTDs

I was having a hard time getting Internet Explorer 8 (IE8) working with Socket.IO's "htmlfile" transport (or any other transport for that matter). I was getting weird permissions issues. I finally fixed the problem by adding a DTD to the top of my HTML file, "<!doctype html>". I was just being lazy not having a DTD, but I was really surprised when that fixed my problem. Of course, I'm still having a hard time getting IE7, IE6, and Opera working cross-domain (technically, I'm just using a different port, but eventually it'll truly be cross-domain).

Ruby: Why I Prefer Cucumber

I've been struggling to articulate why, in most cases, I prefer high-level integration tests with Cucumber and Webrat (or Capybara) over low-level model, view, and controller tests with RSpec. I think I finally have an example that conveys what I'm trying to say. Consider the following Cucumber test: Scenario: create a new film unsuccessfully Given I am logged in as "admin" And I am on the admin films page When I follow "New film" And I press "Create" Then I should see "There were problems with the following fields:" And I should see "Name can't be blank" And I should see "Url name can't be blank" And I should see "Sort name can't be blank" And I should see "URL doesn't look like a valid RTMPE URL" But I should not see "Trailer URL doesn't look like a valid RTMPE URL" And I should not see "Scene URL doesn't look like a valid RTMPE URL&q