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.
// notes/
Coding tips and build notes by Mahir Faysal, a student web developer in Bangladesh: tested Python, HTML, CSS, JavaScript and PHP tutorials, plus notes from my Next.js and Gemini projects. Sample posts are marked and drafts stay in the admin area.
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.
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.
JavaScript map, filter and reduce explained with practical examples: transform, keep and combine array items, chain them, and avoid the classic mistakes.
How to validate and sanitize PHP form input: trim, filter_var, mb_strlen and allow-lists, then escape output with htmlspecialchars, add CSRF and redirect.
Python list comprehension examples I actually use: basic syntax, filtering with if, if/else, nested loops, dict and set comprehensions, and common mistakes.
Python f-string formatting examples for decimals, thousands separators, percentages, alignment, dates and = debugging, plus what's new in Python 3.12 and 3.14.
// filter
This view is only the category, tag, or search you asked for. Sample warnings still apply on any article that carries them. Drafts are still hidden. The full list is the learning notes page, which also explains how a note is written and why some posts are marked Sample.