Blog

Thoughts from my daily grind
Posted by Ziyan Junaideen 19 August 2023
UUID v7 overcomes the limitations of v4 by including an 48 bit epoch timestamp along side random data. Here we discuss how you can enable UUID v7 on PostgreSQL and use it on a Ruby on Rails project.
Posted by Ziyan Junaideen 15 April 2023
DRY your test code by generalizign repetitive tests in to RSpec shared examples.
Posted by Ziyan Junaideen 11 March 2023
Not everyone has the luxury of having a beefed-up MacBook. I have wondered if 8GB of RAM will be sufficient for my work, and the answer is yes. But I do recommend at last 16GB.
Posted by Ziyan Junaideen 12 February 2023
Install and manage multiple versions of Ruby using the ASDF. ASDF allows you to manage multiple runtimes in one tool. I use it for Ruby, Elixir/Erlang and Node JS.
Posted by Ziyan Junaideen 14 January 2023
Rswag is a useful tool when it comes to documenting an API that is both OpenAPI and Swagger compatible. Here we discuss how we can work around unsupported attributes like servers.
Posted by Ziyan Junaideen 07 January 2023
ArgumentError: Missing host to link to is an error that has bugged me for over ten years. This post covers how you can set default URL options for routes in a Rails application.
Posted by Ziyan Junaideen 24 December 2022
The missing guide on how you can install and configure Hanami Views with a new Hanami 2.0 project to work with Slim and Erb (and any other templating engine supported by Tilt).
Posted by Ziyan Junaideen 19 November 2022
Ruby 3 introduced Endless Method definitions that help us write cleaner, neater and better code. Here I discuss examples of how you can use these functions.
Posted by Ziyan Junaideen 26 October 2022
Fix Library not loaded: /usr/local/lib/libpq.5.4.dylib error after you upgrade your Homebrew packages.
Posted by Ziyan Junaideen 07 October 2022
VCR is a tool that can be of immense help for developers testing against 3rd party APIs. This post discusses how to track down unused VCR cassettes for remvoal.
Posted by Ziyan Junaideen 22 July 2022
Delegation is a commonly used in software design to enforce the Law of Demeter. This article discusses how we can delegate methods in Ruby (using the standard library) and also using Rails.
Posted by Ziyan Junaideen 16 July 2022
Enter the world of socket programming with Ruby. Create a simple TCP/IP server and client with just.a few lines of Ruby code.
Posted by Ziyan Junaideen 06 June 2022
The "NSCFConstantString initialize error" bugged me right after a macOS Monterey installation on a Ruby on Rails v7 project. The solution is quick and simple. Why it happens though is a curious matter I would leave for later.
Posted by Ziyan Junaideen 18 May 2022
If you are testing RoR mailer views using RSpec and FFaker gem, you could randomly experience match failures. This post explains how you can use HTML escape to bring escape the name before matching.
Posted by Ziyan Junaideen 19 April 2022
gRPC, a remote-procedure-call framework by Google, is by far one of the preferred RPC frameworks in the wild. Here is a comparison between gRPC and JSON HTTP APIs for interconnecting services.
Posted by Ziyan Junaideen 14 April 2022
A Ruby developer will often require to work with different versions of a Ruby gem. This article discusses the installation and use of a ruby gem with a specific version in the terminal.
Posted by Ziyan Junaideen 18 April 2020
Bring sanity to your code and avoid massive expectation pyramids by chaining multiple conditions inside a single `expect` block.
Posted by Ziyan Junaideen 02 January 2020
The Ruby-retry method allows us to effortlessly retry a met a code block or an error handled method when an error is raised. This posts explains the retry method with an example use.
Posted by Ziyan Junaideen 10 November 2016
Make your code less noisy with the help of the dot-parenthesis shorthand. Start using the .(args)` instead of the .call method in services and other applicable instances.