Hi, I’m Hassan

I’m a lazy-self-taught Software Developer. Spend my free time reading, gaming, blogging, and sleeping.

Find and Delete All Sub Directories/Files Exclude Some Directory

I need to remove all sub-directory excluding some directories. The solution I found is using find and xargs.

2023-01-22 · 1 min · 116 words

Disk Usage du and df Useful Snippets

Useful df and du snippets that I frequently used

2023-01-09 · 2 min · 368 words

Go: Load Env File with godotenv and envconfig

Simple setup to load .env file with godotenv and envconfig for type safety

2022-12-11 · 1 min · 196 words

Validate MongoDB Objectid.isValid vs Regex

ObjectId.isValid is not really good to validate an ObjectId

2022-10-29 · 2 min · 242 words

MongoDB: Subquery to Another DB in The Same Server

Last week, I needed to find articles by user in different DB on the same server.

2022-08-27 · 1 min · 150 words