Migrating user avatars to circular crops, with ImageMagick 05 Sep 2015

Picture the scene: you have a few thousand users with avatars on your site. You want to change from a boring 4x3 photo to a cool and hip circular crop. You know it’ll look great for new users, but we don’t want to leave the existing ones behind.

Let’s imagine our current approach to user avatars is to accept any size and shape image. Because we’re sensible, we retain the originally uploaded image and generate a thumbnail to be used on the site which maintains the proportions but constrains the longest side to 100 pixels.

Our… Read more

Kitematic for boot2docker users 28 Aug 2015

A while ago I switched from using boot2docker directly to the Kitematic Mac app. Although Kitematic generally makes life a bit easier when managing Docker containers, it was a bit of a pain to get it running.

After the Kitematic installation, the VM started but Kitematic had trouble connecting to it. The error messages showed boot2docker paths so I made the assumption they’d got in a tangle. Uninstalling boot2docker didn’t entirely solve the problem, as I was still unable to connect using the terminal. The error pointed us in the right direction:

FATA[0000] Couldn't read ca cert /Users/rb/.boot2docker/certs/boot2docker-vm/ca.pem: open /Users/rb/.boot2docker/certs/boot2docker-vm/ca.pem:…
  		    Read more

Constraining width for LabKey WebParts and Views 16 Jun 2015

Building custom web views within LabKey is pretty straightforward, but if you find yourself needing to constrain the contents of your module horizontally you’ll quickly find that the surrounding tables will gladly stretch to any width. Fortunately restricting the width of hte container is pretty straightforward.

TL;DR: Wrap your contents in a table with table-layout: fixed; width: 100% and the contents won’t push the surrounding page to wider than the browser window.

LabKey’s JavaScript API is rich, and allows complex JavaScript applications to be built against it whilst being hosted as web parts or views within… Read more