Notes

JavaScript

Security notes, SOC lab write-ups and tested code by Mahir Faysal, a SOC Level 1 cybersecurity learner in Bangladesh, plus notes from my Next.js and Gemini projects. Sample posts are marked and drafts stay in the admin area.

Regex for Email Validation in JavaScript (Tested)
Coding tips

Regex for Email Validation in JavaScript (Tested)

A simple email regex for JavaScript forms, compared with a strict pattern and the browser's own check on ten addresses, plus a regex that froze for 1.5s.

October 4, 2026 · 8 min read · 414 views

Dark Mode Toggle With JavaScript and localStorage
Coding tips

Dark Mode Toggle With JavaScript and localStorage

A dark mode toggle that remembers the choice in localStorage, follows the system setting on a first visit and never flashes white on reload. Tested code.

October 4, 2026 · 8 min read · 109 views

JavaScript Fetch POST JSON Example (With Errors)
Coding tips

JavaScript Fetch POST JSON Example (With Errors)

Send JSON with fetch(): method, Content-Type and JSON.stringify, the two mistakes that send an empty body, response.ok checks, timeouts and FormData.

October 4, 2026 · 9 min read · 152 views

JavaScript Debounce Function Example, Explained
Coding tips

JavaScript Debounce Function Example, Explained

A ten-line JavaScript debounce function with real output: fast typing turned into one search, keeping this, cancel(), and a leading-edge version for buttons.

October 4, 2026 · 9 min read · 57 views

Build an Offline Habit Tracker With localStorage
Coding tips

Build an Offline Habit Tracker With localStorage

A small offline habit tracker in plain HTML and JavaScript: habits saved as JSON in localStorage, streaks from local dates, a 7-day row and a JSON backup.

October 2, 2026 · 10 min read · 121 views

JavaScript Async/Await Tutorial for Beginners
Coding tips

JavaScript Async/Await Tutorial for Beginners

A beginner async/await tutorial: async functions, try/catch, fetch with response.ok, Promise.all for parallel work, retries, and the forEach mistake to avoid.

October 2, 2026 · 11 min read · 238 views

0%