RSSAmplifier

Blog

Jamie Schembri - Jamie Schembri

Jamie Schembri

schembri.meRSS feed ↗21 posts

Latest posts

Popping the Filter Bubble

I haven't heard about C# and the .NET framework for years. It's probably still being used to churn out ugly Windows applications by sleepy suits at business factories. I bet there are still a few equally stuffy Java developers around, maintaining legacy enterprise applications at Oracle and IBM and what-have-you. What was it they built, again? Desktop applications with a GUI that looks equally bad…

New Experiences at Friendly.rb

My brain is a torrent, coursing with new ideas and fond memories of the past few days at Friendly.rb , the "Friendly European Ruby conference." Like many developers, I identify as an introvert. I get out very little, and I'm happy that way! I contentedly putter through life at home with my lovely partner and the bestest, fluffiest dogs. I've been to a couple of very different conferences, but…

SOLID: Dependency Inversion Principle (DIP)

🖋️ This article is one part of my series on Robert (Bob) C. Martin's SOLID principles. And so we've arrived at the end of the series with the Dependency Inversion Principle. We're going to spend quite a while defining this one, because it has something of an identity crisis and I think it's important we understand what the principle is trying to convey before we move onto examples and…

SOLID: Interface Segregation Principle (ISP)

🖋️ This article is one part of my series on Robert (Bob) C. Martin's SOLID principles. Introduction The Interface Segregation Principle is one that Bathrobe Bob designed himself. On the surface it looks like it only applies to static languages, which it shares somewhat with the previous entry in SOLID: The Liskov Substitution Principle . Let's see how we can apply it to duck-typed languages.…

SOLID: Liskov Substitution Principle (LSP)

🖋️ This article is one part of my series on Robert (Bob) C. Martin's SOLID principles. Not to be confused with the Language Server Protocol , part three of SOLID is the Liskov Substitution Principle. It is named after Barbara Liskov , who described her ideas in a keynote address in 1987 — Data Abstraction and Hierarchy . Definition I struggle to find a concise and readable definition of LSP from…

SOLID: The Open–Closed Principle (OCP)

🖋️ This article is one part of my series on Robert (Bob) C. Martin's SOLID principles. The O in Bob's SOLID principles is in fact the brilliant Bertrand Meyer 's open–closed principle, which is one of the five principles Meyer devised to define modularity. Definition The original definition, in Bertrand Meyer's 1988 book Object-Oriented Software Construction (from my 1997 second edition): Modules…

SOLID: The Single-Responsibility Principle (SRP)

🖋️ This article is one part of my series on Robert (Bob) C. Martin's SOLID principles. Definition The original and most quoted definition of SRP is this: A class should have only one reason to change. Excuse me, I'm here for "The Single-Responsibility Principle." This is it? Oh, I expected something else... So is it about change or responsibilities? I'm not the first to be confused by this, so…

SOLID for Ruby Engineers

The SOLID principles are often presented as the foundational rules that all good developers should know and employ in writing object-oriented software. With such an elevated status, I decided it to dive into each principle and present my findings here. I was surprised at how often misunderstood some of these principles are. Besides them being inherently difficult to understand, the SOLID…

Your Dependencies Are Not Free

At first glance, depending on a library to fill a requirement is just good engineering. DRY , probably the best-known software engineering principle, tells us to avoid duplication like the plague. And what is writing your own code over grabbing an off-the-shelf package, if not duplication? In most programming languages, the majority of available libraries are free and open source, so it's not like…

Start a Blog With Ghost & PikaPods

Introduction ℹ️ I am not affiliated with any of the services mentioned in this post. With more people questioning big tech's role and impact on their lives, now is as good a time as any to reduce our reliance on traditional, force-for-evil social media and carve out our own little corners of the web. If you want to own your data and build up an audience, Ghost is a solid option, combining blogging…

Complexity

I dislike [all] blanket statements, but complexity is never desirable. Managing complexity is the most important technical topic in software development. In my view, it’s so important that Software’s Primary Technical Imperative has to be managing complexity. — Steve McConnell, 2004 It must have been around 2008 that I first read this quote in Steve McConnell's classic book, Code Complete , and it…

Remove the 'Choose Your Search Engine' Dialog in Capybara

Google recently added a dialog to let users select their search engine. Ordinarily you choose your preferred search engine and get on with life, but this doesn't appear to be the case when using Chrome for automation, such as through Capybara; everything is fine if running in headless mode — as evidenced by any automated screenshots — but if you flip headless off, as I'm like to do to quickly…

A Better Gitconfig

Git provides a rich set of options for customising its behaviour via the .gitconfig file. I present here some of the more interesting options. For more comprehensive information on each and every option, you had better peruse the official documentation . Basics Depending on your preferences, the global gitconfig file is either located at ~/.gitconfig , $XDG_CONFIG_HOME/git/config , or perhaps…

Eleventy Tricks

I recently moved this site away from Hugo and onto Eleventy . Given my simple needs, I was attracted to Eleventy because it too is simple and flexible. Unfortunately, those very positive traits mean that developers may need to invent a few features for themselves — one size does not fit all, after all. This page collects some of the tricks, and snippets I ended up with for this site to function as…

My App is Slow. Who Cares?

It's not a rhetorical question. Who, and why, do people care if your app is slow? What is the purpose of the code you're writing? Whom does it impact? And where is the author going with this? Today I came across a post on social media discussing the benefits of offloading heavy data operations to the database for improved performance. The logic is sound: databases are highly optimized for data…

Debugging Software and Coffee

Our coffee machine is currently at the shop for repair, so we're stuck drinking instant. It's not fantastic, but it's really all right in a pinch. In fact, my parents exclusively drink instant because it's what they're used to — seems like a pretty common thing in the UK and is probably a war relic or something (I haven't looked it up). Instant coffee is really easy to make: you take some coffee…

RubyMine with Docker

Lately I've been experimenting with RubyMine . I've played around with it in the past, but always ended up back on vim for various reasons. This time I'm making a concerted effort to learn its feature set and make them work for me, and so far I'm thoroughly impressed. Unfortunately I had some problems setting up Ruby/Rails projects running in Docker containers to work with RubyMine's debugging…

Faster Excel Parsing in Ruby

When exporting data for general use, we commonly reach for CSV files; they're basically plain-text, but with a sort-of agreed-upon structure — well, there is RFC 4180 but Wikipedia agrees that implementations are inconsistent at best. For the layperson, though, Excel sheets are what's used and understood. XLSX (aka OOXML) files have been the default file format in Microsoft Office for some years,…

Powering a Windows PC via HomeAssistant

I have a PC hooked up to the TV in our living room, which is used primarily for Kodi and video games. I'm using a Logitech Harmony activity to switch the TV on, power the AV receiver, change to the PC input, etc. The only problem is that there's no way to turn on or off the PC via Harmony, so I often sit down and forget to turn it on, or go to bed and find that it has been running all night.…

Sidekiq and Logrotate: Why Is My Disk Usage Increasing?

One of our servers recently experienced an issue in that its disk usage was consistently growing to illogical, unmanageable proportions. This would trigger an OpsGenie alert and wake me up, so in a groggy state I'd delete some extraneous log files (we log a lot), promise myself to look into it tomorrow, and go back to bed. First I thought we were just logging "too much" — actually we require…

Testing APIs in Ruby with RSpec

Testing API calls is a little bit hairy. We can assume that the API will return the results specified in their documentation, but we'd still like to see what our API client returns; this may differ considerably from what the API itself gives us. The last thing we want to do is hit the actual endpoints: this is slow, may incur charges or rate limiting, the server may be down at test time, endpoints…