RSSAmplifier

Blog

Gajus Blog

Gajus blog posts.

gajus.comRSS feed ↗107 posts

Latest posts

Compile Zod (30x faster Zod validation)

Learn how to optimize Zod validation by 30x using aot compilation.

Finding What to Fine-Tune with Ablation

Ablation lets you disable parts of a model one at a time to figure out what each part does. Once you know which components handle a specific capability, you can fine-tune just those parts instead of retraining the whole model.

3 pnpm Settings to Protect Yourself from Supply Chain Attacks

Supply chain attacks are surging. If you use pnpm, three settings can significantly reduce your exposure.

Applying Sentry Component Annotations Client-Side Only

Sentry's Babel component annotate plugin bloats SSR HTML with attributes that are only useful in the browser. Here's how to apply it client-side only using a custom Vite plugin.

Isolated Development Environments for Agentic Development

Branches and worktrees isolate code, but not services. In the age of agentic development, that gap becomes a real problem. Here's how combining Git worktrees with OrbStack VMs gives every agent its own world.

Batching Redis lookups with DataLoader and MGET

How to use DataLoader to batch individual Redis GET calls into a single MGET roundtrip.

This Blog Was Made by AI

I rebuilt my entire blog without writing a single line of code. Here's how Claude Code, voice dictation, and autonomous agents made it happen.

Test Markdown

A comprehensive test of all markdown edge cases and styling scenarios.

X "For You" Algorithm Explained

Summary of X's For You algorithm.

Twitter (most likely) regrets adding Follow

Lists is a better form of social categorization.

Fine-tuning OpenAI models

Run-through of how to train OpenAI models with a custom data sets, and a summary of what to expect in terms of accuracy, speed, and cost.

Understanding and avoiding visually ambiguous characters in IDs

Designing a dictionary of visually unambiguous characters for IDs.

Setting up PostgreSQL for running integration tests

Setting up PostgreSQL for tests is crucial for achieving performance and reliability. In this article, I'll explain how to set up PostgreSQL for tests and discuss some common pitfalls to avoid.

Designing one-to-one relationships in PostgreSQL

Discovering a new perspective on a familiar path. Unveiling the inherent flaws in a longstanding one-to-one design pattern and embracing a superior approach

The case for native assertions in PostgreSQL

Dangers of DISTINCT and implicit assumptions in SQL queries

How to add Sentry tracing to your Node.js app

Challenges adding OpenTelemetry and Sentry tracing to a Node.js app

What makes great engineering teams?

Sparse notes on what makes great engineering teams

Testing Rehype Pretty Code

A playground for testing Rehype Pretty Code and styling code blocks.

Integrating Fastify with Slonik

In the world of Node.js development, the combination of Fastify, a high-performance web framework, and Slonik, a robust SQL query builder and executor, offers an enticing proposition.

Integrating Slonik with Express.js

A comprehensive guide to integrating Slonik, a battle-tested SQL query building and execution library, with Express.js for Node.js applications.

Attempting Large Code Refactor using LLMs

How to use GPT-4 to automate large code refactors, transforming 83 files with a React component export pattern change, including gotchas and lessons learned.

Detecting unnecessarily mounted React components in a large app

My learnings from tracking down dead code in a frontend application.

Debugging mysterious traffic from Boardman, OR

A journey of debugging mysterious traffic spikes coming from Boardman, OR.

Bulk inserting nested data into the database (part II)

Using jsonb to process and insert large and complex datasets into the database in a single query.

How a few lines of code reduced database load by a few million queries

Discover how using jsonb_to_recordset instead of unnest can dramatically reduce database query load when inserting large datasets with nested data structures in PostgreSQL.

Routing PostgreSQL queries between read-write & read-only instances

Load balancing application between read-write and read-only PostgreSQL instances using query routing.

Building advanced SQL search from a user text input

Learn how to build a program that parses user search queries and converts them into SQL statements, supporting field-specific searches, exclusions, range queries, and boolean operators.

Writing composable SQL using JavaScript

A walkthrough of common patterns of writing SQL queries in JavaScript with the help of Slonik.

Fully qualified names vs a jungle of imports

Exploring a simpler approach to imports in Node.js by using fully qualified names from a single entry point, eliminating the need to remember complex file paths.

Rewriting tests from Cypress to Playwright using GPT3

Using OpenAI's text-davinci-002 model to rewrite tests from one framework to another.

Migrating from Cypress to Playwright using GPT3

Learn how to use GPT-3 to automatically migrate 400+ Cypress tests to Playwright, saving massive amounts of manual work by leveraging AI for code transformation.

Validating PostgreSQL results & inferring query static types

Learn how to use Zod and Slonik to add runtime validation to PostgreSQL queries while inferring static types, preventing database drift issues and catching schema mismatches before they cause problems.

What makes a good commit

Learn how to create atomic commits that make code reviews easier, enable safe reverts, and demonstrate good engineering practices through proper interactive staging and thoughtful git workflow.

CTO vs Head of Engineering

Understanding the difference between CTO and Head of Engineering roles at a growing startup, including when to split these responsibilities and how they complement each other.

Redesigning Remote Team Culture

As the world becomes "virtual first", businesses need to step up their company culture game beyond motivational posters in the office. Learn the 5 pillars of success for maintaining vibrant remote team culture.

How I got my first Node.js job

A story of shameless persistence to inspire those who are seeking their first job in IT.

.gitignore mistake that everyone makes

Learn why .gitignore should be a whitelist, not a blacklist, and how to properly configure it to avoid common mistakes.

Onboarding email with 80% response rate

How to get feedback from early product adopters

Why Remote Working Is Bad

Tips for when the novelty of remote working wears off

The Magic of Engineered Serendipity

What I learned from OnDeck & why you should join it too

5 tips for remote job seekers

Tips based on experience evaluating hundreds of remote work job applications daily.

How to execute effective daily standups using Slack?

A practical guide to running effective daily standups using Slack, focusing on meaningful communication rather than just ticket IDs

Solving social isolation

A video chat roulette for distributed teams as a way to stay in touch with each other when working from home

Stack Overflow is leaking user emails

Unsafe use of md5 hashes

Mocking PostgreSQL queries in Node.js

How to test database interactions without a database using Slonik

Ultimate guide to concurrent logging in Node.js

How to use domains and Roarr to associate context with asynchronous call chains

Using HTTP proxy with Puppeteer

I had requirement to evaluate remote JavaScript using Headless Chrome, but requests had to be routed through an internal proxy and different proxies had to be used for different URLs.

Traveling and working remotely from Japan. 20 oddities

I am traveling and working remotely on my startup from Japan. As I travel, I keep making notes of things that surprise me that I share with my friends and family. In no particular order, below is a summary of 20 oddities.

How to terminate a HTTP server in Node.js?

One of the most popular support questions I answer is a variation of "how to terminate a HTTP server" or "why does HTTP server not stop after calling server.close()".

Why IMDb IDs cannot be trusted and why not to use padded IDs

We can all agree that IDs should be unambiguous, i.e. if I told you to fetch a resource "1", I expect to get the same resource every time. I also expect that I can store a reference to that same resource by storing this ID and use that reference to fetch the same resource at a later date.