π§©Code Snippetsthat reflect my coding style β simple, practical, and built the way I like to write code.
9 snippets
This pagination approach normalizes and validates query parameters (page and limit) and converts them into safe numeric values. It also calculates the correct offset for database queries, ensuring consistent and reusable pagination logic across all API routes. By centralizing it into a utility, it eliminates duplication and keeps pagination behavior uniform throughout the application.
Production-ready HTTP server setup with context-based graceful shutdown on OS signals.
Wire up Better Auth with Google + GitHub OAuth, email/password, and session caching.
A clean pgTable definition with UUID primary keys, arrays, booleans, and auto-updating timestamps.
Connect to a Neon PostgreSQL database with Drizzle ORM β the exact setup used in this portfolio.
Fetch GitHub profile + contribution graph data concurrently with revalidation caching.
Reusable Zod v4 schemas for validating blog and snippet form data on the server.
Conditionally filter published rows and chain multiple orderBy clauses.
Type-safe insert + returning pattern used across the portfolio's server actions.