While working on a feature test today, I learned that any database data that is modified in a before(:all) callback in an RSpec test is retained outside of the test run. This is documented quite clearly in the RSpec documentation, I just haven’t had the opportunity to work with these types of callbacks regularly before. The test I ran into...
TIL about the CSS property text-underline-position. This property is a useful progressive enhancement to achieve a particular look and feel for links, in particular for content with many descenders. Examples: This is standard underlined text. This text has the underline position set to "under". This text has a bottom border instead of an underline. Notice that the border overflows the...
Today I learned about a CSS selector I have not used a great deal before - pipe-equals. The spec describes this operator as: Represents an element with the att attribute, its value either being exactly “val” or beginning with “val” immediately followed by “-“ This selector is particularly useful for loose matching of BEM CSS classes, and other dasherized class...
I’ve used Calibre for years to manage my eBook collection. It’s a great piece of software that has always worked really well for me. I discovered today that Calibre has the ability to start a “content server”. This provides an endpoint which serves information about the Calibre library, including covers, titles, and descriptions. The content server can be started by...
Sometimes an application can have pretty complex configuration for certain components. There’s always temptation to put these settings straight in your service, but today I learned about a simple method built into Rails from 4.2 onwards that lets this config live outside of your Ruby classses: Rails.application.config_for. This method allows you to place your config in an environment-namespaced YAML file...
I often struggle with the correct way to set any kind of configuration on a class, especially when it is a class intended to integrate with an external API that usually needs several configuration values. I initially implemented my own configuration pattern, before coming across this great pattern by ThoughtBot that has been used for their open-source library Clearance: class...
I frequently find myself tramping into the Tararua Forest Park from the Mount Holdsworth road-end, travelling through Donnelly Flat, a popular picnic spot around 10 minutes from the roadend. After considering the lack of signed history regarding the history of the Flat, and after being unable to find out any information from Archives, National Library, Papers Past or regional libraries,...
This post outlines a day trip from the Akatawara Hill Road saddle towards Renata Hut. After a couple of recent winter storms, I ran into a lot of tree fall that slowed things down sufficiently so that I ran into my time limit and turned back, however, it was a struggle to find information about the route, so I’m happy...
Every now and then I need to restore an old database backup to grab some data out of. I use Postgres containers for every app I work on, so I don’t really want to go polluting those. Here’s how I start a postgres container, restore a DB into it, do what I need to do, then destroy it. Start the...
A little while ago, I blogged about the trip to Powell Hut. This post decribes an alternative trip into the Tararuas, from the Waiohine road-end into Totara Flats Hut. I found this trip much more challenging than the trip up the Gentle Annie track to Powell Hut, but at the same time a lot more fulfiling. The track, marked in...