2025-12-30

Grateful in Dubai

There's a cafe I go to for my daily midday tea breaks. It occupies a street corner where you place an order through a window while peering into a kitchen slightly bigger than the size of a food truck. It sells a small cup of kadak chai for 1.50 dirhams. Across the street is a Starbucks which sells a medium cup of tea for 14 dirhams. The disparity used to shock me initially but now I don't bat an eye.

Laborers, delivery men, and hospitality staff frequent this cafe due its low price point. Sometimes I see a man in a suit. Seldom do I see foreigner. I like it because it's not pretentious and makes a killer chai.

Show more

2025-11-19

How to Use Cloudfront for Sendgrid Click Tracking

Nothing like a Cloudflare outage to inspire another blog post. I learned from the last incident and was able to turn off the CF proxy early on while it was still possible to do so. This kept my website up during most of the outage as requests were bypassing CF and hitting my origin servers directly.

However, in turning off the CF proxy, I noticed one flaw in my infrastructure. When I turned off the CF proxy for links.mydomain.com, which is the subdomain I use to wrap links in outgoing emails, any user who clicked a link in our emails saw a SSL certificate not valid error.

Show more

2025-11-07

An Idea to Not Get Phished

Anyone who is remotely tech savvy doesn't need Google to tell them 'Phishing is one of the top ways bad actors intrude and steal data.' We recently witnessed a phishing attack on the npm supply chain. Luckily it was caught before having major repercussions. But it got me thinking: what steps can we take to prevent it from happening again? Or at least reduce the probability.

Recently I was doing some cookie stuff and learned about the Public Suffix List. I found it interesting because it admits 'there was and remains no algorithmic method' for a software problem: helping browsers figure out how to restrict cookie sharing across domains. It's not often I see software engineers, myself included, accept algorithmic defeat. I also loved how dead simple the solution is. What can be easier than maintaining a list of suffixes.

Show more

2025-10-10

Implementing ZADD If Key Exists

I recently had to make some performance optimizations. These are my favorite kind of coding task as they usually require some sort of creativity and tradeoff. This time around I also learned more about Redis and practiced using AI to generate code.

During my refactor, I came across a need to upsert a (member, score) into a Redis sorted set only if the Redis sorted set exists. This upsert would be done hundreds of times a second for different keys, so it had to be fast.

The basic ZADD command offers a XX flag which adds a (member, score) only if the member exists in the sorted set. But what I was looking for was a flag to add a (member, score) only if the sorted set exists. Unfortunately, no flag exists for this use case. If no sorted set exists, Redis will create a new one with just that (member, score). I didn't want that.

Show more

2025-09-15

Apartment Hunting Tips in Dubai

I recently moved into a one bedroom apartment in Marsa Dubai (a.k.a. Dubai Marina). Being my first time renting in Dubai, it has been quite the learning experience. In this post, I share some observations and tips. I assume the following:

  • You already have an Emirates ID and are in Dubai

  • You're looking to rent an apartment for one year

  • You want to sign a rental contract within 2-3 weeks

Narrow down target neighborhoods

Dubai has many residential neighborhoods. If you want to be efficient, you need to cast a small-ish net. Since I'm not planning to buy a car, I automatically eliminated the neighborhoods with poor metro connectivity. I was fortunate to have three acquaintances who had lived or were currently living in Dubai. With their advice, I narrowed down my list further to: Dubai Marina, JLT, and Downtown Dubai.

Show more

2025-08-28

Simple Measures to Make Axios and Express Production Ready

On August 21, 2025 PagerDuty alerted me that my Node server is taking way too long to respond.

What made this event stressful is that when I tailed the server logs, I had never seen this kind of issue before. My knowledge of devops is shaky to begin with. Meanwhile users were suffering and messages were piling up on HelpScout (this unfortunately occurred during peak hours).

Even though the issue ended up being Cloudflare’s fault which I discovered a few days afterwards, I learned a lot from this experience. It also emboldened me to take a hard look at my Node server code and, after much research, implement simple measures to make it more resilient in production. I describe these measures at the end of this post.

Show more

2025-08-16

Moving To Dubai for Remote Work

Recently, I decided to move to Dubai under their Virtual Work visa scheme. This is a one-year renewable visa for remote workers making more than $3500 USD per month. In this post, I outline the process I went through in case it helps someone else looking to do the same.

Why Dubai

Since I started my SaaS business, I've had the luxury of being able to work from anywhere. I've been moving from place to place every few months, fully embracing the nomad life. While this has given me perspective and adventure, it has also eroded my sense of 'home'. Committing to Dubai for one year is my way of injecting some much needed 'home' into my life.

Show more

2025-08-10

Simple Productivity Hack

I'm working on something which is not interesting nor time critical. Before I realize what I've done, I’ve opened a new tab, typed in Y or R and pressed Enter. The page loads in milliseconds. My eyes are feasting on my Reddit or Youtube feed, hunting for a quick dopamine boost to distract me from the mundane task at hand. Courtesy of their sophisticated recommendation algorithms, I usually succeed.

Over the years, I've tried several strategies to curb this impulse. Most of them have involved the use of Chrome extensions to block entire domains while working. But this approach has backfired when I've genuinely needed to access a specific Reddit post or a YouTube video (ex. for background coding music). The hassle of temporarily disabling the block in these situations has turned me against the approach completely.

Show more

◀ prev