#Programming Language
156 posts
Modern Python in Practice #5: Async and Background Tasks
Where async routes fit, post-response processing with BackgroundTasks, the boundary where external queues (Celery, ARQ) become necessary, and how to safely mix sync libraries.
Modern Python in Practice #4: Authentication — OAuth2 Password Flow + JWT
Password hashing (argon2/bcrypt), the OAuth2 password flow, JWT issuance/verification, and a clean current_user dependency for authenticated routes.
TypeScript Advanced #7: Practical patterns and anti-patterns
Criteria that separate good types from over-typing — any/unknown/never, as const and satisfies, plus the anti-patterns people fall into and how to fix them.
Modern Python in Practice #3: Connecting a DB — SQLAlchemy 2.x + Alembic
SQLAlchemy 2.x's new style — Mapped/mapped_column, async sessions, integration with FastAPI's dependency injection, and Alembic migrations.
TypeScript Advanced #6: Modules and .d.ts
How to handle and extend the types of external libraries — declaration files (.d.ts), the declare keyword, module augmentation, and adding global types.
Modern Python in Practice #2: Routing, Pydantic Models, and Dependency Injection
Splitting routes with APIRouter, defining input/output schemas with Pydantic v2, and unraveling shared logic cleanly with Depends.
TypeScript Advanced #5: Discriminated unions and type guards in depth
Modeling for safely handling data of multiple shapes — discriminated unions, user-defined type guards, assertion functions, and branded types.
Modern Python FastAPI #1 Getting Started and Setup
Why FastAPI, first project setup with uv, Hello FastAPI, automatic OpenAPI/Swagger UI generation — all in one place.
TypeScript Advanced #4: Template literal types
Tools that compose strings at the type level — the `${...}` pattern, Capitalize/Uppercase built-ins, and real-world patterns for modeling route/event names as types.
Modern Python Advanced #7 Performance — cProfile, py-spy, Memory Profiling
A toolbox for finding and fixing slow Python code — timeit, cProfile, py-spy, line_profiler, memray, and common optimization patterns.
TypeScript Advanced #3: Conditional types and infer
The if statement of the type level — the distributive behavior of T extends U ? X : Y and the patterns that pull values out of a type with infer. Build ReturnType and Awaited yourself.
Modern Python Advanced #6: Advanced typing — Variance, ParamSpec, Self, overload
Next step from intermediate typing — covariance/contravariance, ParamSpec and Concatenate, Self, TypeGuard/TypeIs, and @overload.