Notes

Cybersecurity, SOC & coding notes

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.

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

How to Read a CSV File in Python Without Pandas
Coding tips

How to Read a CSV File in Python Without Pandas

Read CSV files in Python with only the built-in csv module: csv.reader, DictReader, numbers and blank cells, Excel's BOM, semicolons and writing a CSV.

October 4, 2026 · 8 min read · 118 views

Git Undo Last Commit but Keep Changes (Tested)
Coding tips

Git Undo Last Commit but Keep Changes (Tested)

Undo your last Git commit and keep the changes with git reset --soft HEAD~1, plus mixed, hard, reflog recovery, --amend and revert, each run on a real repo.

October 4, 2026 · 7 min read · 45 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 · 59 views

Gemini Structured Output With Zod in Next.js
Coding tips

Gemini Structured Output With Zod in Next.js

Describe the JSON once in Zod, send z.toJSONSchema() to Gemini as responseJsonSchema, then validate the reply with safeParse and retry once with the errors.

October 2, 2026 · 9 min read · 137 views

0%