Posts

  • Fix for bundle install: ArgumentError: invalid byte sequence in US-ASCII

    I stumbled across a weird issue with bundler on MacOS X:

    Read more

  • Creating smaller images in Rmagick

    When you create an image in Rmagick and save it, chances are high that your image will be way too big. The reason is that, by default, Rmagick creates uncompressed images.

    Try to run optipng <filename> for PNG or jpegoptim --strip-all <filename> for JPG on your file, and you will probably see a file size reduction of 20% - 90%. That is without loosing image quality! One way to improve on this is to set the compression level in Rmagick's write method. Here is some clunky code to do this:

    Read more

  • Printing the page content in Capybara

    Capybara is a great integration testing framework that easily replaces Webrat. Plus, it works with Rails 3, which Webrat seems not to do. If you need to print the current page's content, for example to debug your test, you can do so with:

    Read more

« Newer Entries 1 2 3 4 5 6 7 8 9 Older Entries »

subscribe via RSS