TypeScript Branded Types for Nominal Typing
Add nominal typing to TypeScript using branded types so you cannot accidentally mix UserId, OrderId, raw strings, or money values.
1745 posts · page 33 of 37
Add nominal typing to TypeScript using branded types so you cannot accidentally mix UserId, OrderId, raw strings, or money values.
Understand TypeScript's modern standard decorators: how they differ from the legacy proposal, the context API, and practical class and method examples.
A practical guide to Astro components and layouts — frontmatter, typed props, slots, named slots, and the BaseLayout pattern every Astro project converges on for shared shell HTML.
A practical guide to Astro content collections — defining a zod schema in src/content/config.ts, using the glob loader, fetching entries with getCollection, and building a dynamic [...slug].astro route.
A practical walkthrough for scaffolding an Astro 5 project — installing Node.js, running npm create astro, understanding the file layout, writing your first .astro page, and producing a production build.
A clear introduction to Astro — what it is, why zero JavaScript by default matters, how content collections and islands work, and the kinds of sites Astro is the right tool for.
A beginner-friendly tour of Amazon EC2 — instance types, AMIs, key pairs, security groups, launching via the console, SSH access, the free tier, and the difference between stopping and terminating an instance.
A beginner-friendly tour of AWS Lambda — the handler signature, runtime choices, triggers from API Gateway and S3 and EventBridge, cold starts, packaging, and the IAM execution role every function needs.
A realistic plan for software engineer interview prep — what the loops look like, where to study, how to practice deliberately, mock interviews, talking while coding, and behavioral STAR.
A practical guide to production deploys with GitHub Actions — environments, secrets, OIDC, deploy-on-tag vs deploy-on-main, and pushing images to AWS, Vercel, or Fly.
Use the Django admin to get a free CRUD interface for every model — createsuperuser, register models, customise list_display and search_fields, and add inline admins.
A hands-on Django setup guide — virtual environments, pip install django, startproject, runserver, and creating your first app. Get to a working dev server in ten minutes.
A practical tour of Django's ORM — defining models, common field types, makemigrations and migrate, QuerySet filtering, foreign keys, and simple aggregations.
Wire Django models to web pages — function-based views, render(), URL routing with path(), template tags like {% for %} and {% if %}, and template inheritance with {% extends %}.
A practical introduction to Django — its newsroom origins, the batteries it ships with (ORM, admin, auth, templates), and when to pick it over FastAPI or Flask.
How to feed configuration into Docker containers without baking it into the image — ENV vs ARG, --env-file, Compose env, BuildKit secret mounts, and Docker Swarm secrets, with safe defaults.
What an embedding is, why cosine similarity works, how dimensionality and chunking choices affect retrieval, and a tiny numpy example you can run in your head.
Why a normal database struggles with vector search, how ANN indexes like HNSW and IVF work, and a clear comparison of pgvector, Qdrant, Pinecone, Chroma, and Weaviate so you can pick one.
A practical guide to async path operations and Depends() in FastAPI — when async actually helps, per-request DB sessions, auth dependencies, and how sub-dependencies compose.
A practical guide to FastAPI with SQLAlchemy 2.0 — typed models with Mapped and mapped_column, sessionmaker, get_db dependency, CRUD endpoints, and where Alembic fits.
A practical guide to FastAPI routing and Pydantic v2 — path operations, path/query/body parameters, model validation, response_model, and response_model_exclude_unset.
A deeper look at git rebase — the mechanics, interactive rebase with squash/fixup/edit/drop, the golden rule of published branches, conflict resolution, and rerere for repeated conflicts.
The everyday array patterns every DSA learner should know — traversal, linear search, insertion, deletion, reversal, rotation, prefix sums, Kadane's preview, and the one-pass habit.
A beginner's introduction to arrays — contiguous memory, indexing, the Python list vs C array caveat, time complexity of read/write/insert/delete, and 1D vs 2D arrays.
Ten classic array interview problems with examples, approach, complexity, and clean Python solutions — Two Sum, Best Time to Buy/Sell Stock, Kadane's, Rotate Array, Product Except Self, and more.
A practical guide to Big-O notation — O(1), O(log n), O(n), O(n log n), O(n^2), and beyond, with code examples, best/average/worst case, and a brief look at amortized and space complexity.
A practical introduction to binary trees — the TreeNode class, terminology (full, complete, perfect, balanced), height vs depth, BSTs, and the small calculations you need to reason about tree problems.
A practical guide to the four canonical binary tree traversals — recursive and iterative versions, when to use each, and the patterns that make them click.
Eight classic binary tree interview problems with examples, approach notes, and clean Python solutions — max depth, same tree, invert, symmetric, path sum, LCA, validate BST, and serialize/deserialize.
A practical introduction to bit manipulation in Python — binary representation, the bitwise operators, two's complement, and the common operations to set, clear, toggle, and check individual bits.
Six classic bit manipulation problems — Single Number, Number of 1 Bits, Power of Two, Counting Bits, Missing Number, Reverse Bits — plus the tricks that make them tick: n & (n-1), n & -n, and XOR cancellation.
Eight classic dynamic programming problems — Climbing Stairs, House Robber, Coin Change, LIS, Word Break, 0/1 Knapsack, Edit Distance, and LCS — each with Python solutions and DP tables.
An introduction to dynamic programming — overlapping subproblems, optimal substructure, top-down memoization, and bottom-up tabulation, with worked examples in Python.
A practical guide to BFS and DFS on graphs — recursive and iterative DFS, BFS with a deque, shortest paths on unweighted graphs, connected components, cycle detection, and five classic practice problems.
A practical introduction to graphs — directed vs undirected, weighted vs unweighted, cyclic vs acyclic, and the three main representations (adjacency list, adjacency matrix, edge list) with Python code.
An introduction to greedy algorithms — when the locally best choice gives a globally optimal answer, when it doesn't, the exchange argument, and six classic problems.
How hash functions, hash maps, and hash sets work — the intuition behind buckets and collisions, chaining vs open addressing, average and worst-case complexity, and the Python containers built on them.
Eight classic hash map problems with worked Python solutions — Two Sum, Group Anagrams, Subarray Sum Equals K, Longest Consecutive Sequence, Top K Frequent Elements, and more.
The core operations every linked list problem builds on — inserting at head/tail/middle, deleting by value, reversing iteratively and recursively, finding the middle, and detecting a cycle.
A practical introduction to linked lists — what a node is, singly vs doubly linked, head and tail, how arrays and linked lists differ, and a clean Python implementation you can build on.
Eight classic linked-list interview problems — reverse, detect cycle, merge sorted lists, remove Nth from end, cycle start, palindrome, add two numbers, and intersection — each with a worked Python solution.
A practical introduction to recursion — the base case, the recursive case, the call stack, and how to think about problems that solve themselves through smaller versions of themselves.
A practical guide to binary search — the classic template, off-by-one traps, Python's bisect module, and the binary-search-on-answer pattern, with six worked problems.
A practical guide to sliding window — fixed-size vs variable-size windows, expand/shrink invariants, and six classic problems with worked Python solutions.
A tour of the five sorting algorithms every programmer should know — their ideas, Big-O time and space, stability, and Python implementations, plus when to just use sort().
A practical introduction to stacks and queues — LIFO vs FIFO, using a Python list as a stack, collections.deque as a queue, and the real-world problems each one solves cleanly.
Eight classic stack and queue interview problems with worked Python solutions — Valid Parentheses, Min Stack, Daily Temperatures, Sliding Window Maximum, and more.
An introduction to strings for data structures and algorithms — immutability, indexing, slicing, common operations, ASCII versus Unicode, and the two-pointer and frequency-counter patterns you will use everywhere.