StackPractices

Mathias Paulenko

Software Engineer & Founder of StackPractices

Mathias Paulenko

Mathias Paulenko

Software Engineer

Software engineer with 12+ years of experience building production systems across Python, JavaScript, React, and DevOps. I have contributed to enterprise projects spanning CI/CD pipelines, API design, cloud infrastructure, and full-stack development.

StackPractices is my personal project, born from a simple belief: great documentation should be copy-paste ready. Every recipe, pattern, and guide on this site is designed to save you time and help you ship faster.

Published Works (1032)

intermediate

Run LLMs Locally with Ollama for Private Inference

Install and use Ollama to run open-source LLMs locally with Python, including streaming,...

intermediate

Compare Text Semantic Similarity with OpenAI Embeddings

Generate text embeddings with OpenAI and compute cosine similarity to measure semantic similarity...

intermediate

Structured JSON Output from OpenAI Function Calling

Use OpenAI function calling and structured outputs to get reliable JSON from LLMs with Pydantic...

python openai function-calling ai
intermediate

a Local RAG Pipeline with ChromaDB and Sentence Transformers

Implement retrieval-augmented generation locally with ChromaDB, sentence-transformers embeddings,...

intermediate

Store and Query Embeddings in Pinecone Vector Database

Use Pinecone to store, query, and filter vector embeddings for semantic search with metadata...

intermediate

JavaScript Fetch Retry Logic with Exponential Backoff

Retry failed HTTP requests in JavaScript with exponential backoff

intermediate

Node.js WebSocket Real-Time Communication with Socket.io

Build real-time WebSocket applications in Node.js with Socket.io

intermediate

Python API Rate Limiting with Token Bucket

Implement token bucket rate limiting in Flask and FastAPI with Redis support

intermediate

Node.js JWT Authentication: Verify and Refresh Tokens

Implement JWT authentication in Node.js with access and refresh tokens

intermediate

Node.js OAuth2 GitHub Login with Express

Implement GitHub OAuth2 login flow in Node.js with Express and Passport

intermediate

CDN Cache Invalidation Strategies and Patterns

Implement CDN cache invalidation using purge APIs, surrogate keys, tag-based invalidation, and...

advanced

Multi-Level Cache with In-Memory L1 and Redis L2

Implement a two-level cache combining in-memory L1 and Redis L2 for low-latency reads with...

intermediate

Implement an LRU Cache in Node.js

Build a least-recently-used cache in Node.js with O(1) get and set operations using a Map-based...

intermediate

Cache Function Results with Redis and TTL in Python

Build a Python decorator that caches function return values in Redis with configurable TTL, key...

intermediate

Implement the Cache-Aside Pattern with Redis

Use the cache-aside pattern to read and write data through Redis, handling cache misses, stale...

advanced

Distributed Locking with Redis and Redlock

Implement distributed locks with Redis for mutual exclusion across processes, using SET NX with TTL...

intermediate

Redis Pub/Sub for Cross-Process Messaging

Use Redis pub/sub channels to broadcast events between processes, handle subscriptions, and...

advanced

Rate Limiting with Redis Token Bucket Algorithm

Implement a distributed token bucket rate limiter using Redis atomic operations for API throttling...

intermediate

Build a Real-Time Leaderboard with Redis Sorted Sets

Use Redis sorted sets to implement real-time leaderboards with rank tracking, score updates, and...

intermediate

Make Concurrent HTTP Requests with Python and aiohttp

Fetch multiple APIs concurrently using asyncio and aiohttp. Covers connection pooling, rate...

intermediate

Extract Data from HTML Pages with Python and BeautifulSoup

Parse HTML and extract data using BeautifulSoup. Covers CSS selectors, navigation, tables,...

intermediate

Node.js Caching with Redis: Cache-Aside and TTL Patterns

Cache API responses in Node.js with Redis using cache-aside and TTL patterns

intermediate

Docker Compose Dev/Prod Split: Separate Environments

Separate development and production Docker Compose configs with overrides