Skip to main content

How to Use Check Constraints in Supabase for Data Integrity

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

Data types are great, but they are often too "blunt" for real-world business logic. You might know a column is an integer, but you also need to ensure that it's never a negative number, or that a discount_price is always lower than the original_price.

In Supabase (which runs on PostgreSQL), the Check Constraint is your first line of defense for data integrity. It sits directly in the database engine, meaning no matter how a user tries to insert data (API, Dashboard, or CLI), the rule is impossible to bypass.

How to Merge Branches in Git (Without Creating "Spaghetti" History)

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

Merging code used to be the most terrifying part of a developer's week. You would type git merge, hold your breath, and pray you didn't accidentally delete your coworker's entire feature.

Today, modern Git workflows (and platforms like GitHub and GitLab) have completely changed the game. The goal in 2026 isn't just to combine code; it's to maintain a clean, readable, and linear history so that when something breaks 6 months from now, you can actually figure out why.

Here is the modern playbook on how to merge your branches without creating a chaotic "spaghetti" history.

Git fetch vs git fetch origin: whats the difference?

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

When you are typing away in your terminal, git fetch and git fetch origin probably feel exactly the same. In fact, if you only ever work on standard, single-team projects, you might go your entire career without realizing there is a difference at all.

However, Git is highly configurable. The moment you step into open-source development or complex team architectures, that little missing word (origin) suddenly completely changes how Git behaves.

Here is the candid truth about what Git is actually doing behind the scenes.

How to delete origin and local branch in Git

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

Deleting a branch is a bit like taking out the trash: if you only do it in the kitchen (locally), the bin outside (remotely) stays full. To truly clean up your project, you need to perform a two-step operation.

Here is how to safely and effectively wipe a branch from existence both on your machine and on the server.

Fix Firestore Error: A Document Must Have an Even Number of Path Elements

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

If you are working with Firebase and suddenly see the error fatal: A document must have an even number of path elements, don't worry-you haven't broken your database. This is Firestore's way of telling you that you've gotten lost in the "Map" of your data.

In Firestore, there is one unbreakable rule: Collections and Documents must always alternate.

How to Find a Bug with `git bisect` (Binary Search Debugging)

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

Finding a bug is like detective work-except the crime scene is your code, and the suspect is one of your last 200 commits. You know the code worked last week, and you know it's broken now, but finding the exact moment it failed can take hours of manual checking.

Enter git bisect. It uses a binary search algorithm to find the offending commit with mathematical efficiency. Instead of checking every commit, it cuts the search area in half every single time.

Difference between git rebase origin/branch vs git rebase origin branch

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

It looks like a tiny typo, but in Git, the difference between a slash and a space is the difference between a simple update and a complete context switch.

If you are staring at your terminal wondering why one works and the other throws an error (or moves you to a different branch entirely), here is the breakdown of the "Invisible Space" mystery.

Use `git worktree` for Hotfixes: A Better Alternative to Stash

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

We have all been there: you are deep in the zone, half-way through building a complex new feature, and your terminal is full of uncommitted changes. Suddenly, you get a message from your team: "Critical bug in production! We need a hotfix right now!"

The traditional response is to use git stash, switch to main, fix the bug, and then try to un-stash your messy feature branch later. But if you have complex dependencies (like node_modules or .venv) or untracked files, stashing can lead to absolute chaos.

This is where git worktree comes in. It is the professional's secret weapon for parallel development.

How to Fix 'fatal: cannot delete branch used by worktree' in Git

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

Git is usually pretty good at protecting us from our own mistakes. When you try to delete a branch and get hit with the fatal: cannot delete branch 'xyz' used by worktree at '/path/to/folder' error, Git is essentially acting as a safeguard.

It is telling you: "I can't delete this branch because it is currently checked out and actively being used in another folder on your computer!"

Here is exactly why this happens and how to resolve it safely.

How to create a 5-color palette where EVERY color is readable against EVERY other color with Python

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

Creating a color palette where every color is readable against every other color is a high-level design challenge. As the number of colors in your palette increases, the "contrast space" shrinks significantly.

In this article, we’ll build a script that uses an iterative "Collision-Check" algorithm. It generates a candidate color, checks it against every color already in the palette, and only keeps it if it passes the WCAG AA threshold against all of them.

Looking for more content?
Hrekov Blog contains 275 articles. Browse the blog archive or Explore the full timeline.