Nested for_each with Terraform

Terraform provides a for_each iterator which allows you to loop over elements of a list, and perform an operation with each element. For example, to grant multiple permissions for myself on a Snowflake schema, I could do something like this: resource "snowflake_schema_grant" "write_permissions" { for_each = toset(["CREATE TABLE", "CREATE VIEW", "USAGE"]) database_name = "MY_DATABASE" privilege = each.key roles = "DAVE" schema_name = "MY_SCHEMA" } This loops over each element in the for_each list, and substitutes it as the privilege using each....

August 19, 2021 · 2 min · Dave Perrett

Working with local Terraform providers

I recently submitted a small fix to @chronark’s Vercel provider. The fix itself was pretty trivial, but it took me quite a while to figure out how to actually run Terraform against a local copy of the provider in order to make sure it actually worked. I found the answer eventually in the Terraform CLI documentation. As a convenience for provider development, Terraform supports a special additional block dev_overrides in provider_installation blocks....

August 19, 2021 · 2 min · Dave Perrett

An update to exif-orientation-examples

I was surprised to discover recently that my exif-orientation-examples repository has quietly collected almost 300 stars on github. The sample images were created over 5 years ago now, and are pretty low-resolution and unsuitable for testing on modern displays and websites. With that in mind, I’ve replaced the sample images with 1200x1800 pixel images (previously they were 600x450 pixels), and automated the process of generating new images. ...

August 5, 2017 · 2 min · Dave Perrett

Importing a Pivotal Tracker project into Trello

I’m currently in the middle of migrating a project from Pivotal Tracker to Trello, and couldn’t find any easy method of importing the data, so I spent this morning putting together a gem to do exactly that. ...

January 13, 2014 · 4 min · Dave Perrett

Callback support and a version bump for jquery-simple-color

The jquery-simple-color plugin has received a bunch of callback-related goodness thanks to jbergen. He’s also added a live preview option which displays the currently-hovered-on color. ...

April 8, 2013 · 1 min · Dave Perrett

Recreating the Reeder two-tone horizontal rule in pure CSS

I’m a huge fan of the design of Reeder, and wanted to take a stab at recreating their fading two-tone horizontal rule in CSS for this blog. ...

April 7, 2013 · 3 min · Dave Perrett

Sending mail with SendGrid on Ubuntu

I keep forgetting how to do this, so purely for my own benefit - how to set up Ubuntu to send via sendmail and SendGrid. ...

March 19, 2013 · 3 min · Dave Perrett

A bit of digital house cleaning

My old recursive-design.com site has served me well for a couple of years of contracting and consulting, but having jumped headfirst into a startup, my focus is now on reducing my workload rather than increasing it :) ...

March 18, 2013 · 1 min · Dave Perrett

EXIF orientation handling is a ghetto

One of my favourite services at the moment is Transloadit, who provide an image processing API that works a treat on top of platforms like Heroku, where there are strict request timeout limits that make large uploads difficult. They handle auto-orientation of images automagically by default, and normally I’m not even aware of it happening during testing since my camera and OSX also handle auto-orientation transparently. ...

July 28, 2012 · 7 min · Dave Perrett

Messing around with ruby-processing, take 5

I’ve been spending quite a bit of time playing with ruby-processing (and processing in general) recently. It’s also been my first exposure to JRuby which has been a bit of an eye-opener, in terms of the sheer number of Java libraries that it makes available in Ruby. All the fun stuff in processing seems to be OpenGL-related, and after a lot of research the easiest way to dig in ended up being the GLGraphics Java library, which was made specifically for use in processing. ...

May 31, 2012 · 2 min · Dave Perrett