HTTP Headers and Ruby 3

Upgrading your libraries and dependencies regularly is a must if you want to keep up with application security and performance. Sometimes though, things do not go as planned and part of your code breaks because of the upgrade.

This happened when we upgraded our Ruby version from 2.7 to 3.0. Suddenly, all of our requests to Amazon’s API started failing. As this was a critical part of the business, we had to investigate the root cause of the problem. Continue Reading

The True Cost of Things

The True Cost of Things

When we acquire things, mostly by buying or when someone gives it to us, we associate this object by its cost. “This costs half my monthly salary“, or “This looks cheap!”. While this may seem obvious from our perspective, in reality, this is only a part of its true cost.

There is an excellent article from Raptitude about this, titled Everything Must Be Paid for Twice. The author said that the first price is what we pay to gain possession of something. Once we obtain it, we must also then pay a second price, which is the effort needed to utilize and reap the benefits of that thing. Continue Reading

Autovivification in Ruby

Recently, I came across a problem where I need to store values inside a nested Hash. The catch is, the keys within that Hash are unknown, and each key can also have a nested Hash within. In addition to that, the final value of this nested Hash is an Integer that needs to be accumulated.

In Ruby, we need to define the Hash keys first before we can get or modify the value. If you try and access a key that does not exist yet, it will return nil. When you try and access another key within that non-existent key, it raises an exception: Continue Reading

Don’t just consume, create!

Don’t just consume, create!

How do you usually spend your day?

You wake up on a weekday, annoyed at the alarm clock for reminding you once again to go to work. Phone in hand, you take a quick glance at social media to get the freshest news. After a quick breakfast, you prepare your things and head to work. To maximize your time commuting, you listen to your favorite podcast while in your car. Continue Reading

Rage against the dying of the light

Rage against the dying of the light

If there is one recognizable aphorism on how we should live our days to the fullest, it would be carpe diem. This is famously known to mean “seize the day”, but it is actually mistranslated. Its true meaning is closer to “gather while the day is ripe”.

This year has been hard for many of us. The pandemic brought widespread disruption in people’s lives by losing loved ones, layoffs, closed businesses, and isolation. Our family was not spared as well. This year I lost my sister to cancer. Several uncles and relatives passed away. This led me to think about the shortness of this life. Was gathering while the day is ripe enough? How can I even know if the day is ripe or not? Continue Reading