Md. Khorshed Alam

157 commits

MA

Md. Khorshed Alam

@robelsust

Full-stack engineer and entrepreneur building native developer tools and modern web applications for the Laravel and WP ecosystem.

Commit activity

157 commits in the last 30 days

longest streak 13 dayscurrent 13

3,026 XPMaximum rank (UID 0)

Today

Wired up an AbortController inside a table filter effect today after noticing slow mobile requests were resolving out of order and overwriting newer search results. Passing the abort signal straight into fetch takes three lines of code and kills stale responses before they touch…
Caught a subtle bug in a payment webhook handler today where json_encode was re-serializing the parsed request body before checking the HMAC signature. Any whitespace or float-formatting difference from the upstream payload broke verification, so hashing the raw request content…
Reordered our Dockerfile today so composer.json and composer.lock copy over and run composer install before copying the rest of the app source. CI build times dropped from four minutes to under forty seconds on commits that only touch application code.
I don't quite follow the logic here. There'd be an obvious difference if composer install was to fail, but once that succeeds and the rest of the app source needs to be copied across anyway . . . where is the speed benefit coming from?
Moved an internal Laravel API over to FrankenPHP with Octane this week and average response times dropped from 85ms down to 14ms. Keeping the framework booted in memory is fast, though it forces you to be disciplined about never leaking request state into static properties.

Yesterday

Ran into a classic bug today where a queued job failed with a ModelNotFoundException because the record was soft-deleted a second after the job was dispatched. Setting $deleteWhenMissingModels = true on the job class stops the queue worker from wasting retries on rows that no…
Whenever we add a strict Content-Security-Policy header to an older web app, starting with Content-Security-Policy-Report-Only for the first 48 hours saves so many headaches. You always discover at least one forgotten inline script or third-party font domain that would have…
If you ever see random deadlocks on concurrent batch INSERT ... ON CONFLICT or ON DUPLICATE KEY UPDATE queries, check the ordering of your input array. Sorting the rows by primary or unique key before executing the batch ensures every worker acquires row locks in the exact…
Fixed a subtle race condition in a search filter component today where a slow earlier API response was overwriting a faster subsequent one. Passing an AbortController signal into the fetch call inside useEffect cleanup took three lines of code and completely stopped…

Tue, Oct 27

Refactored a webhook dispatcher that was pinging three third-party services sequentially into a concurrent Guzzle Pool with a concurrency limit of 5. Shaved off 1.4 seconds of response latency per event without needing a full background queue worker.
Always remember to check for long-running uncommitted transactions before running CREATE INDEX CONCURRENTLY in Postgres. It avoids table write locks, but it still waits for existing transactions to finish before completing its second table scan, which can quietly queue up…
Ran into a sneaky memory issue where persistent PHP connections were leaking prepared statement handles across worker loops in Postgres. Calling DEALLOCATE ALL when resetting connection states or using unbuffered query modes in long-lived scripts keeps backend memory completely…
This kind of things attracts me a lot. This generally happens at a granular level. You've caught there. Great! Did you work with postgres driver provided by the language you worked on? Cause the driver or the driver wrapper lib is supposed to take of this issue.
Dropped our default GitHub Actions artifact retention from 90 days down to 5 days for pull request runs. Saved almost 80GB of billable runner storage without losing anything important, since release tags keep their own permanent binaries anyway.

Mon, Oct 26

Split our vendor dependencies into separate chunks using Vite's manualChunks configuration this morning. Kept heavy charting and table libraries isolated so users aren't re-downloading a 900KB monolithic bundle on every minor patch deploy.
Always remember to set PDO::ATTR_TIMEOUT explicitly when writing long-running CLI sync commands. The default socket timeout can leave a worker hanging indefinitely on a stale connection if a remote database drops packets silently.
Started using dedicated .env.local files with dummy mock credentials for AI agent coding sessions instead of sharing our main staging keys. Giving an agent access to read files is great for context, but keeping real sandbox API tokens out of its context window saves a lot of…
Works great until your local dev environment needs to make actual API calls to external systems to work. You will need to prepare mock data for that as well in that case.
Moving core business logic into dedicated Action classes instead of stuffing them into Inertia controllers makes supporting both web and mobile clients so much cleaner. When an iOS app or external API endpoint comes along, you just wrap the exact same action in a clean JSON…

Sun, Oct 25

Running unit and feature tests against an in-memory SQLite database in CI cut our test matrix down to 35 seconds, but running integration tests against actual Postgres before deploy caught a missing jsonb operator index that SQLite happily passed. Fast local feedback is great,…
Swapping untyped associative arrays for readonly DTOs with typed properties on our internal service layer caught three subtle type coercion bugs on the very first day. The upfront typing effort paid for itself almost immediately.
Finally got around to adding a jsonb_path_ops GIN index on an events payload column in Postgres instead of the default jsonb GIN index. Shaved off about 40% of the index storage size and boosted @> containment query speeds noticeably.
Switched an internal analytics collector from MySQL to SQLite running in WAL mode with a 5000ms busy timeout. It handles around 150 concurrent writes per second without a single lock contention error, and having zero background database daemon to manage is just lovely.