Skip to main content
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder
View all authors

Understanding Off-by-One Errors in JavaScript

· 2 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

Off-by-one errors (OBOEs) are among the most common logic bugs, even for seasoned developers. These bugs occur when a loop or operation goes one iteration too far or one iteration too short—leading to incorrect results, missed elements, or crashes.

They usually occur in:

  • Loops
  • Array indexing
  • Ranges
  • Substring operations

What is an Off-by-One Error in Python? (Explained for Kids!)

· 2 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

Have you ever counted your toys and accidentally said you had 11, but really only had 10? That’s kind of what an off-by-one error is in Python!

It’s a tiny mistake where your program counts 1 too many or 1 too few. These mistakes are super common, even for professional programmers.

Drawbacks of Msgspec Compared to Pydantic: A Deep Dive with Examples

· 3 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

msgspec is gaining attention in the Python ecosystem due to its incredible speed and minimalist design. It's written in Rust, supports JSON and MsgPack, and uses type hints for validation. But like every tool, it’s not perfect — and when compared to the battle-tested and feature-rich Pydantic, there are several key trade-offs to be aware of.

In this article, we’ll explore what msgspec lacks compared to Pydantic, illustrated with code examples and practical reasoning.

Handling Environment Variables in OpenAPI Server URLs

· 3 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

When defining server URLs in OpenAPI specs, you often need to reference environment-specific values (like staging or production subdomains). But using raw environment variables can result in placeholder values like default: unknown, which may confuse tools like Swagger UI, ReDoc, or code generators.

This guide explains the issue and offers clean solutions — with practical examples.

Python Data Serialization in 2025 - Alternatives to Pydantic and the Future Landscape

· 3 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

As of 2025, Pydantic remains a cornerstone of data validation and serialization in the Python ecosystem. Yet, with the evolving needs of performance-critical applications and broader standardization efforts in the language, new contenders have emerged — and old ones are adapting.

In this article, we explore the current landscape of Python data serialization libraries, their strengths, weaknesses, and futures.

Best Practices for Using Pydantic with Flask for Request and Response Serialization

· 3 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

Pydantic is widely known for its powerful data validation and parsing capabilities using Python type hints. While it's most popular with FastAPI, it can be elegantly integrated with Flask to improve request validation, input parsing, and response formatting.

This article outlines best practices for combining Flask with Pydantic in a clean, maintainable way.

Improved: Count Docs Posts in Docusaurus Including Folders

· 2 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

🔄 Update to: Count Number of Blog Posts in Docusaurus and Vercel

In my previous post, I shared a method to count the number of docs posts in a Docusaurus project and display it on your homepage, fully compatible with Vercel and static builds.

That method works great—if all your docs posts are plain .md or .mdx files in the docs/ directory.

But if you're like me and prefer organizing docs posts in folders (e.g., docs/folder/index.md), the previous approach silently misses those.

Improved: Count Blog Posts in Docusaurus Including Folders

· 3 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

🔄 Update to: Count Number of Blog Posts in Docusaurus and Vercel

In my previous post, I shared a method to count the number of blog posts in a Docusaurus project and display it on your homepage, fully compatible with Vercel and static builds.

That method works great—if all your blog posts are plain .md or .mdx files in the blog/ directory.

But if you're like me and prefer organizing blog posts in folders (e.g., blog/my-post/index.md), the previous approach silently misses those.

How to Display Blog Post Count on Docusaurus Homepage

· 3 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

Many developers using Docusaurus want to display the number of blog posts they have—especially on their homepage. While this may sound trivial, doing it the right way (that works on both your local dev and production builds like Vercel) requires some thought.

Here’s a simple and reliable way to implement this—no hacks, no unstable APIs, just clean engineering.

Git Rebase Onto Main (Full Guide, No Fluff)

· 3 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

You want to bring your feature branch up to date with the latest main, but you don’t want messy merge commits.

The solution: rebase.

Rebase reapplies your local commits on top of the latest main from remote. It keeps your commit history clean, linear, and easy to read — especially when preparing a pull request.