Author: russt
-
Creating and Applying Diffs with Rsync
At work recently, we had a need to generate diffs between two different directory trees. This is so that we can handle deploys, but it’s after we’ve already generated assets, so we can’t just use git for the diff creation, since git diff doesn’t handle files that aren’t tracked by git itself. We looked into…
-
Saving Calculated Fields in Ruby on Rails 5
In Ruby on Rails, it’s easy to build custom functions to calculate something and then display the result in your views. While this simplicity is nice, it doesn’t come without its drawbacks. Recently, when working on a simple app, I came across a situation where loading a page was taking 0.5 seconds. This may not…
-
Many-to-Many in the UI in Ruby on Rails 5
I know I’m really late to the party, but I’m just finally creating something from scratch in Ruby on Rails. I’ve dealt a tiny bit with Rails before, but it was mostly just in helping my brother with CSS stuff, which obviously isn’t working on the Rails backend. Anyway, now that I’ve started working with…
-
Listing & Switching Contexts in Kubernetes
This is going to be a quick post – but I wanted to put it here for my own reference, since it’s something I have to look up pretty often. I might as well make my notes about it public so that others can benefit, too. What are ‘Contexts’? In Kubernetes, a Context is essentially…
-
Wildcard Let’s Encrypt Certificates with Certbot and GCP
As of last month (March 8th-ish, 2018), Let’s Encrypt supports wildcard certificates! This is great news, because it means that those of us who like using tons of subdomains can now get one cert for all our subdomains, rather than having to get a cert for every single subdomain. As you may know, Certbot is…
-
Building Large Docker Images, Quickly
Sometimes, you've just got a big codebase. Maybe you want to put that codebase into a Docker image. Sure, you could mount it, but sometimes that's either not an option or would be too much trouble. In those cases, it's nice to be able to cram your big 'ole codebase into images quickly. Overview To…
-
Alphabetic Filtering with Regex
Last week, I found myself needing to filter things alphabetically, using regex. Basically, this is because PHPUnit lets you filter what tests you run with regex, and we (we being Etsy) have enough tests that we have to split them into many parts to get them to run in a reasonable amount of time. We've…
-
Starting up the Blog Again
Hey everyone – I know that very few people are following this, but I wanted to let you all know that I'm going to be posting with a weekly cadence starting again now. The posts will be almost entirely tech-related, since that's what I do now. I've got a couple of posts in the pipeline…
-
Anker USB-C to USB A Cable Review
I was recently given a sample of Anker’s new 6ft USB-C to USB A cable (They also come in a 3 foot variant). Actually, I guess I should say that I was given two samples, since they come in a pack. I’ve been using them over the past week and a half, and I’ve got…
-
Moving or Distributing Your Docker Build Cache
Recently, I hit an issue where building docker images on containers meant that the Docker cache wasn’t being persisted from one build to the next. So even if you ran an identical build on the next run, it’d still rebuild every step, costing you valuable time. Luckily, it’s not too difficult to save your Docker…