A Humbly Arrogant Blog

Posts about software development

Code Review: Sanity Checks

For the most part, sanity checks are put into the code to ensure there are no bugs. For this reason, guaranteeing sanity checks are done correctly becomes necessary. If you do not check to see if the data is valid, and it is invalid, then you’re going to allow invalid data to proceed. Here, I’m going to discuss how I think we should do sanity checking in PHP. Asserting Valid Data What I’ve seen a lot is people are asserting for invalid data when they’re doing their sanity check. ... Read more

Code Review: Single Responsibility Principle

Single Responsibility Principle (SRP) is probably one of the most well-known principles from SOLID. At its core is a desire to prevent classes from becoming overwhelming and bloated. While enabling the ability to change how a single thing works by only changing a single class. So the benefits of SRP are that you have an easier codebase to maintain since classes are less complex and when you wish to change something you only have to change a single class. In this blog, I will go through some ways to try and help avoid breaching SRP while doing code review. ... Read more

OVH & Docker - Failed to register layer: devmapper

I’ve been using OVH’s dedicated server range recently. When ever I tried to use docker with the Ubuntu latest LTS I ended up with an error failed to register layer: devmapper:. The solution is rather simple, OVH dedicated servers use rather old and unsupported kernel versions. The solution is upgrade linux kernel. ... Read more

Go dep in Docker

Go’s dependency handling has been an area which has been needing unification, over the years. Multiple package managers have been created. The Go community has been working on creating a dependency manager recently, which they plan on getting added to the official toolchain. I’ve decided to jump on the bandwagon and start using this tool. Here’s how I’ve been using it in docker. ... Read more

RabbitMQ One consumer blocking others

I’ve been working on a distributed application that requires multiple workers to process items from a queue. I decided to use RabbitMQ as the queue. However I noticed that there was a 10 minute pause or whenever the consumer started up. After looking into it further I noticed that it appeared that only one consumer could run at any given time. ... Read more