Lockdown lesson #1: Reducing grocery waste

I’ve been working from home since 2018, so you can say I was “used to” working from home when the lockdown happened in 2020. But no, that was different. It was brutal. It sucked. And it was lonely and stressful.

We all have bad memories of that period, but I have a few good ones too. The first one is reducing my food waste. Which helped me reduce a lot of my stress.

Before the lockdown, whenever I go grocery shopping, I get back with a lot of vegetables, fruits, milk, etc. Seeing a full fridge at home was a satisfactory thing for me.

But a few days later, I usually end up throwing away the majority of it. Rotten vegetables and fruits, expired products, opened milk bottles, you name it. And whenever I throw something, I feel bad about it.

I feel bad because 1) I’m wasting resources that other people would benefit from, 2) I’m not helping the environment and just adding more waste.

That started to change during the lockdown. With fewer “travels” to the grocery store, I needed to change my behavior and better manage my groceries.

Cooking at home during the lockdown helped in that a lot. I started using most of the groceries while cooking, and finding the recipes that use the same ingredients.

A few weeks later, I started throwing empty boxes, empty bottles and finishing most of the products. It felt so good! I still feel immense joy whenever I throw an empty box.

After the lockdown finished, and restaurants were open again. I started eating less at home. But that doesn’t mean I got back to my previous “throw-away” life.

Instead, I started buying only what I need every two to three days. No more groceries for the whole week. That means fresh vegetables, fruits, meat, etc. for every meal. Which is awesome!

Having a supermarket within walking distance really helps. But I’m sure everyone can adapt this to their need and use case.

In summary, I started eating more fresh food. Throwing away less to no food. And as a bonus, I reduced my grocery bill.

Remote.ma: from a blog to a platform

It’s been two years since I started remote.ma, but I didn’t share why I started it before. So today, I’m going to share this with you. It all started when I wanted to work remotely:

The story

I applied to Automattic for three reasons:

  • I wanted to work on something with an impact. And for someone who loves writing, working on WordPress is a dream.
  • I wanted to take ownership of my tasks. I hate micro-managing.
  • I wanted to work remotely.

Few interviews and code tests later, I got the job.

Up to that point, I had no idea how I was going to do this legally, but I knew there should be a solution. I’m not the first one working remotely from Morocco right?

So I did what every millennial do: I searched for answers on Google. And to my surprise, there was nothing! I couldn’t find a single blog post, article, or forum speaking about this.

It was that time when I decided that once I figure out how to do this, I’ll write about it. And that’s how everything started.

Few meetings with an accountant, and a few weeks of preparation, I got everything sorted out. That’s when I wanted to write about it. But I only had this blog.

At first, I was going to use this blog for them, but then I thought this should be a separate blog about remote work. There is none in Morocco anyway! And this is when I started looking for domain names.

I remember I was excited when I searched for remote.ma domain and it was free. I bought it right away. I also bought make.ma the same day.

That’s it. I got the domain and I started writing.

Fast forward to now, those legal blog posts helped a lot of people. I still respond to questions about them to this day. It’s crazy how an evergreen post can still serve years after its writing.

What’s next?

I have plans for remote.ma. Yes, it started as a blog, but it shouldn’t be like that forever. I want it to be home for anyone working from home. Remote workers, freelancers, entrepreneurs… There are few of them now, but I believe we’ll see a surge shortly.

remote.ma will be a platform for training, jobs, consulting, a closed community… Some of this is already live like the job board. And others are in the work, like the closed community.

Some of this will be surely paid to support the growth, but more on that later 🙂

Is it bad practice to choose your own document ID in Firestore or a NoSQL database?

What if you’re left to choose the IDs of your documents on a NoSQL database like Firestore? Will you use a random string for your IDs, or try to use a combination of your document fields?

Let’s take books for example. A good candidate for a unique ID is the ISBN, it’s a book identifier and is supposed to be unique. Until now, using the ISBN as an ID looks promising. But what happens if you start supporting self-published (e)books? Or local books? Or old books with no ISBN? Well… things can be tough!

Whenever you use a document property, like ISBN, book title, etc… as a unique id for your document, you’ll quickly hit some edge cases down the road. This without talking about what happens if you change a property due to a typo for example? Will you go and change the ID everywhere?

All this sounds like you should never use a document property as a unique ID, and it’s true. But what should you use instead? A random string? It may sound strange, but that’s the safest option.

Using long, random strings, make IDs independent from the document itself. This will help you avoid a collision (two documents or more sharing the same ID) and you’ll not need to update the ID if you change something in the document.

How to choose unique IDs?

Well, you can choose a random ID if you want. But if you’re using Firestore, you can let it do the work for you. By default, Firestore can create strong unique IDs for your documents if you don’t force your own IDs. When creating a new document, just insert it directly to the collection of documents. This will automatically create a new ID for it:

// This is how it looks with Firestore for the Web
const res = await db.collection('books').add({
  name: 'The Book Of Good Dogs',
  country: 'Morocco',
  isbn: '123456890',
  price: 0

// To get the id of the document
console.log( res.id );

Other examples for other platforms can be found in the official documentation.

If you still want to generate a random ID yourself, you will need to use doc() before:

const randomId = generateSomeRandomId();
const res = await db.collection('books').doc( randomId ).set({
	name: 'The Book Of Good Dogs',
  country: 'Morocco',
  isbn: '123456890',
  price: 0

That’s it! Next time you’re tempted to come with a way of creating new IDs for your document, stop what you’re doing, and use random strings.

Do not miss my next post! Drop your email in the box below and get it straight to your inbox:

Acquiring my first Internet project: okjob.io

A few months ago, I acquired my first project ever: okjob.io, a remote jobs board.

The following is a recap of why I acquired it instead of building it myself and how I’m planning to use it. But first…

Why the heck a job board?

It’s been a while since I wanted to build a remote jobs board. Yes, there are thousands out there, and I’m not trying to compete with them, but I wanted to build a board for Moroccans. Why? Because not all remote companies hire from Morocco.

Some companies only hire from the US, Europe, Canada… For Moroccans like me, it’s hard to find a remote job. You need to manually check companies to see if they hire from Morocco.

Most job boards include a “Global” filter, which supposedly, should show you companies hiring “worldwide”. But given most companies call themselves “worldwide” if they hire outside of the US (but not necessarily everywhere), that filter doesn’t work for the majority of cases.

Why acquiring?

I wasn’t thinking of acquiring to start with. But when the opportunity presented itself, I reached out to the maker and we worked out a price.

It was a win-win situation. For the seller, it encourages him to focus on other projects. And for me, the project is built with technologies I’m comfortable with (Node.js, Express, and Next.js), was fairly priced, and helped me move quicker with my idea.

What to expect next?

I didn’t change much on the okjob.io site itself, but I took the same technology and started using it for the Moroccan Remote Jobs board: jobs.remote.ma.

The list of companies is hand picked for now. That way, I know for sure they are hiring from Morocco. The project is currently in the testing phase but will be officially launched in the next few weeks.

Curious about entrepreneurship and building things on the Internet? Follow me for more stories:

Why developers hate Ruby on Rails

Hey I’m Ahmed, a self taught software engineer. In my path of self learning, I tried multiple languages and frameworks; and one of them was Ruby on Rails.

That was at least 5 years ago, and I hated it. I didn’t know why, but it just felt different in a bad way at that time.

A few years after, exactly 3 months ago, I started learning Ruby on Rails again. But this time I was shocked! Why didn’t I learn it before? Look at how things are easier here? Why are we spending so much time in other frameworks while this is working out of the box?…

The hobby phase

As a developer, you start your coding journey as a hobby. You discovered code and how you can turn your ideas to life. Now, you’re hooked. You spend a lot of time coding and working with technology! In fact, according to this StackOverflow survey, 80% of developers code as a hobby.

Before the technology boom, people used to hate their day job. It was a source of income so they can do other things on the side. But for code, it’s different. It’s a hobby and a daily job.

It’s a no brainer that, we as developers, tend to over-architect things, build things from scratch, re-invent the wheel, etc… It’s a hobby and we want to experience the most out of it. And as a fresh software engineer discovering this new hobby, you want languages and frameworks giving you more flexibility to create, architect, and play with technology.

You can spend hours trying to make two frameworks play nicely together. Create the perfect build process. Architect your todo app. Deploy your simple app to a multi-region cloud provider, etc. And in the end, you feel happy. You don’t feel like you wasted time, because it’s your hobby! And we don’t waste time on hobbies. They are a source of happiness.

You’re in the hobby phase.

The get-things-done phase

As you get more experience in the field, you’re more likely move out of the hobby phase. This is due to different causes, and some of them are:

  • You don’t have enough time outside work to play with code (family, children, other new hobbies…)
  • Your past experiences show it’s not worth it to spend so much time early on trying to optimize
  • You’re now happier to see a product launch more than the technology behind it
  • You have a broad knowledge about the product inside your organization
  • And others…

As you reach this new phase, you do not care about frameworks and languages anymore. You want what gets the job done as your objectives are greater than the technology. You want a set of frameworks that plays nicely together and get the job done as quickly as possible. And that’s when you’ll find something like Ruby on Rails.

Ruby on Rails is a set of tools and frameworks that plays nicely together as long as you use what’s given to you. You don’t have the freedom to use new frameworks or build things the way you want. But if you abide by the Ruby on Rails rules, you’ll move faster.

You’re in the get-things-done phase. Being on the get-things-done phase is a prerequisite to liking Ruby on Rails. No one likes something that limits their “creativity” if they are still in the hobby phase.

According to the same StackOverflow survey, 67% of developers have less than 9 years of experience (40% have less than 5 years). That means, 67% are likely to be in the hobby phase. And this is one of the reasons why a lot of developers hate Ruby on Rails.

Skipping the hobby phase

Being on the hobby phase isn’t bad. In your journey as a developer, you’ll start in the hobby phase. And with time, you’ll move slowly out of it. The timing it takes depends on each individual however.

But can you avoid it altogether? Yes, there are some exceptions. These are people coming from other disciplines. They are marketers, sales, and other non-technical people who discovered they can do more with code. Their primary objective isn’t to code. It’s to get help from code.

They are less likely to pick up new technologies or frameworks. They just want something that works and helps them in their job. They are more likely to pick something like Ruby on Rails. Or better, no-code tools.

I’m Ahmed, a software engineer from Morocco talking about technology, and entrepreneurship. You can follow me on Twitter.

Do not miss my next post! Drop your email in the box below and get it straight to your inbox:

The day I accidentally built a nudity/porn platform

I didn’t know that my next project will turn into a nudity platform and a home for spammers. But it did happen while I wasn’t paying attention. And here are the details.

For the next 5/10 years, I’ve decided that my mission will be: “Can a Moroccan build an online business and make a living from Morocco?“. I currently launch multiple projects and give them some time to take off. My blog remote.ma, my jobs board okjob.io, and other projects are all examples of this. The project I’m talking about today, was also serving the same purpose in theory, but it was a flop.

That project is mylink.fyi, a personal and unique link for all your other links. I built it during my weekends given I already have a full-time job and it took me two months approximately. It’s like linktree and other competitors, but I tried to make it different. No ads, no logo, a clean interface, a 100% score in performance… My idea was: take a competitor product, remove all features you don’t need, and make it crazy fast. You have a 14 days free trial to test it out, but you need to upgrade your account afterwards.

I launched it in February 2020 with a completely different identity. I took my name, and thus my followers and my authority, out of the equation. I wanted to replicate “someone starting from scratch” as close as possible. I did use the service for my links (and remote.ma‘s links) but I never advertised the service on my personal account. You can see the Product Hunt launch, and the imaginary Twitter account I created.

Given how I built the app, I optimized it in a way I’ll only pay hosting fees when the site is having a lot of traffic. Like 1M+ visits per month. So I forgot about it, and kept an eye on the bills I get. Two weeks after launch, I had 100 users. No premium account.

Three months went by with 0$ bills. But in June, I received my non-zero bill, it’s exciting the app is taking off! I logged to Firebase (the infrastructure I’m using) and found a total of 1000 users! Wow, that’s a lot.

I took a look at the emails, and quickly saw that something was off. I’ve seen multiple accounts with the same email structure, something like emily123@gmail.com, emily456@gmail.com… I knew something isn’t right given there is a lot of them. So I decided to take a closer look and see the links they are sharing.

That’s when I discovered they were sharing porn and nudes links. These links aren’t permitted on social media, so they used mylink.fyi to “shadow” them. For these platforms, they are mylink.fyi links. But once you visit it, you’ll see a link for the banned site. There were hundreds of accounts doing this. And new ones get created every day. Once the trial period is over, they create a new email, a new account, and then repeat the same process. Oups!

I decided to remove all my links from the platform given it’s probably known for “porn and nudes” now. I logged to Instagram, and got a weird message: “Your profile link is not working“. I didn’t know what that means, but once I visited my profile, I’ve seen I can’t click on the mylink.fyi link. Wow, what’s that? I visited my other profile, and got the same message and the same problem! I later discovered that Instagram banned all mylink.fyi links from the platform. A customer also confirmed to me via email that Snapchat started blocking links. Heh, I’m banned by Instagram and Snapchat! From all scenarios I had in mind, this is not something I prepared for.

The first thing I tried is reducing the trial period from 14 days to 5 days. I was hoping I’ll make them stop. But nothing changed, I can’t outplay them. Damn it! Other solutions include: requiring credit cards for trial periods, ban all adult content from the platform… But they all require me to put extra effort in the project. And I don’t have time for that.

I disabled signups on mylink.fyi for now, and after all trials reach their end, I’ll take the service off. If you’re interested in acquiring the domain name, and/or the app, let’s talk.

That’s it for your daily dose of weird Internet anecdotes.

If you’re interested in stories about building online products and businesses, follow me on Twitter, or consider joining my mailing list 🙂

Do not miss my next post! Drop your email in the box below and get it straight to your inbox:

The green presence dot

Nowadays, every app with a chat feature has a presence indicator. It comes with different flavors, like a green dot, an “online” mention, or a “last seen” feature. But they all serve the same purpose.

It’s a trap.

Every one of them fights for your attention, trying to spend more time with you while using your friends as a weapon.


No one wants to let their friends down. They want you to feel bad if you are seen “online” but didn’t respond in time. Feel bad about that message you didn’t read…

Fight back.

I still fail for this sometimes. But it’s good to have some reminders. And today, I wanted to share my reminder with you.

Online indicators are a trap. Beware. Fight back.

Article image drawn by me on an iPad using Procreate

Do not miss my next post! Drop your email in the box below and get it straight to your inbox:

Reversible decisions and tomato purĂ©e

We freak out when we hear “decisions”. We don’t want to make them. We prefer to avoid making decisions.

We think decisions are hard because they are irreversible. Once you make a decision, it will haunt you all your life. But the truth is, the majority of decisions are reversible. You can choose a path, and if something doesn’t work, you can change it.

From big life plans to groceries, reversible decisions are everywhere. We just need to better spot them. Make it a habit, and you’ll get good at spotting those. Here’s a grocery example: tomato purĂ©e.

You are getting groceries and you don’t know if you should pick that big bottle of tomato puree or two small ones. The problem is you know when you open the big bottle you need to use it in the next 3 days. And you are not sure if you can do it. But financially, the big bottle is less expensive.

Now which one you should pick? What’s the reversible decision?

What can happen if you pick the big bottle? If you use it all, that’s good. If you didn’t, you need to use it in the next 3 days, or you will throw it away. SO MUCH STRESS TOMATOES! Calm down.

If you pick two small ones and end up needing a lot of purée, you can use both. If you only need a small amount, you can open one and let the other for another time. No 3 days limit, no rush, no stress.

Picking two small bottles is always the best choice. Even if you don’t end up using the tomato puree, you are better throwing a small bottle than a big one. For the price difference, which is usually some cents, it isn’t worth the mental overhaul. If you can save your mind from thinking about this every time you are in a supermarket, just pay those extra cents.

This exercise is a good investment in the long run. And a good example of reversible decisions.

Next time you have a decision, take the reversible one. There is always one out there.

Do not miss my next post! Drop your email in the box below and get it straight to your inbox:

The timing is never right

For all the important things. Timing always sucks.

The stars will never align. And the traffic lights of life will never be all green at the same time.

The universe doesn’t conspire against you. The universe will not line up things for you either.

Conditions are never perfect. “Someday” is a disease that will take your dreams to the grave with you.

If it’s important to you and you want to do it. Do it. And correct course along the way.

Taken from The 4 hour work week book.

Do not miss my next post! Drop your email in the box below and get it straight to your inbox:

On being rich

A little story.

Let’s start from the same base. You and your friend have the same amount of money, say 200$. Who is richer? We can’t decide yet.

Your friend decides to spend his money on this new crazy experience, jumping from an airplane. You decide to keep the money.

After this experience, your friend has 50$, and you still have 200$. Who’s richer now?

… Well, it’s complicated.

If being rich is measured by the amount of money you have in your bank account, then you are richer. If being rich means being alive, living the full life, trying new experiences… then your friend is richer.

When people say “I want to be rich”. What they mean is “I want to live like rich people”. Being rich isn’t always about money. Money’s value is multiplied when you spend it on experiences you like or with the people you love. A dollar is a dollar. How you spend it is what makes the difference. It’s what makes you live like rich people.

Do not miss my next post! Drop your email in the box below and get it straight to your inbox: