I would rather be ashes than dust!

I would rather be ashes than dust!

James climbed up the ladder until he reached the top of the bunker. He just called in a missile strike to his location in order to destroy this virus laboratory. He knew it would be the end. After saying goodbye to his loved ones, he looked at the vast and beautiful ocean for one last time, and accepted his final fate.

After hearing the news of his death, his colleagues gave him a final toast with these words: Continue Reading

Pay it forward, to yourself!

Pay it forward, to yourself!

We all know the concept of paying it forward. When someone does something for you, instead of paying it back to that person, you instead do something for another person. By doing this, the good deed spreads around the community instead of being constrained between two parties.

What is another person, exactly? A good definition is: someone other than yourself. This could be a neighbor, a friend, a family member, or even a complete stranger. But think about this: are you the same person ten years ago? Do you think that you will be ten years from now? Perhaps we can extend the definition to include you from the past or the future. Continue Reading

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