Skip to content

Instantly share code, notes, and snippets.

View garyblankenship's full-sized avatar
🎩
I may be slow to respond.

Gary Blankenship garyblankenship

🎩
I may be slow to respond.
View GitHub Profile
@garyblankenship
garyblankenship / toolcalls.md
Created August 9, 2025 22:48
How Efficient are AI Tool Calls? #ai

LLM Tool Loops Are Slow - Here's What to Actually Do

The standard LLM tool-calling pattern is an anti-pattern for production. Every tool call costs 200-500ms of LLM latency plus tokens for the entire conversation history. Let me show you what actually works.

The Problem With Standard Tool Calling

Here's what happens in the naive implementation:

# What the tutorials show you
@garyblankenship
garyblankenship / gobest.md
Created August 4, 2025 17:26
Go Best Practices

Go CLI Architecture Standards - Complete Guide

Version: 2.0 (July 2025)
Go Version: 1.21+ (with Go 1.18+ generics patterns)
Target: Production-ready Go CLI applications

This is the complete, definitive guide to Go CLI architecture standards, combining all best practices, modern patterns, and production wisdom into a single comprehensive document.


@garyblankenship
garyblankenship / gitworktrees.md
Created July 30, 2025 15:52
Git Worktrees but Why? #git

Git Worktrees: How We Replaced Our Entire Branch Management Strategy With a Feature Nobody Uses

We had 14 developers, 3 active releases, and a monorepo that took 12 minutes to clone. Every context switch was killing us. That's when someone suggested using Git's most ignored feature as our entire development workflow.

Here's how we've been running our 400GB monorepo with instant context switching for 18 months—using a Git feature so obscure that most developers don't know it exists.

The Impossible Situation

Picture this: Critical production bug comes in. You're 800 lines deep into a refactoring. The junior dev who could handle it is knee-deep in their own feature branch. The senior who knows that code is reviewing a PR.

@garyblankenship
garyblankenship / sqlite-writers.md
Created July 29, 2025 16:04
SQLite Wants One Writer But You Have Twenty #sqlite

SQLite Wants One Writer But You Have Twenty: A Production Story

Everyone said SQLite can't handle concurrent writes. Everyone was wrong. They just weren't creative enough with their definition of "handle."

Here's how we've been running 50+ concurrent processes writing to a single SQLite database for 18 months—and why it's more reliable than the PostgreSQL cluster it replaced.

The Impossible Situation

We were building a distributed file scanner (props) that needed to catalog millions of files across multiple machines. The requirements were simple enough to make you weep:

@garyblankenship
garyblankenship / sqlite-redis.md
Created July 28, 2025 01:38
SQLite Is Lying to You About Concurrent Writes #sqlite

SQLite Is Lying to You About Concurrent Writes

I lost three days of customer data before I realized SQLite's "database is locked" errors were just the symptom. The real disease was silent corruption happening in production.

You've probably deployed SQLite thinking it handles concurrent writes. The documentation says it does. The internet says it does. Hell, even your tests pass. But there's a specific scenario where SQLite will corrupt your database so quietly you won't notice until your backups are also toast.

The Conventional Approach: Why WAL Mode Isn't Saving You

Everyone tells you to enable Write-Ahead Logging. "It solves concurrency!" they say. Let me show you the code that's probably in your production right now.

@garyblankenship
garyblankenship / cloudflare.md
Created July 19, 2025 00:38
The $0 Infrastructure Stack

The Complete Cloudflare Free Tier Guide

Generated on: 7/18/2025, 8:22:50 PM


The $0 Infrastructure Stack: Building Production Apps on Cloudflare's Free Tier

Introduction

@garyblankenship
garyblankenship / php2go.md
Created July 8, 2025 15:01
Go from a PHP Programmer #go #php

The Day I Stopped Fighting Go and Started Thinking Like a Compiler

I spent three years writing Go like it was PHP with different syntax. Then I debugged one race condition that changed everything.

You know that moment when you realize you've been fundamentally wrong about something? For me, it happened at 2am, staring at a goroutine panic that shouldn't exist. I'd been treating Go like a stricter PHP—same patterns, just more typing. That night, everything clicked: Go isn't PHP with static types. It's a completely different way of thinking about code.

The Unexpected Superpower: Your AI Actually Understands Go

Before we dive into my painful journey, here's something nobody told me about Go: LLMs write it scary well. I mean genuinely excellent, production-ready code. Not the "looks right but has subtle bugs" code you get with dynamic languages—actual working Go.

@garyblankenship
garyblankenship / rag.md
Created July 5, 2025 13:40
Your RAG pipeline is broken #rag

Your RAG Pipeline Is Broken (And You Don't Even Know It)

I spent six months debugging why our RAG system returned perfect chunks but completely wrong answers. The problem wasn't retrieval. It wasn't the embeddings. It was something so fundamental that once I saw it, I couldn't believe we'd all been doing it wrong.

Last week, I watched a senior engineer's RAG pipeline return a recipe for chocolate cake when asked about database migration strategies. The chunks were relevant. The embeddings were state-of-the-art. The reranker was tuned perfectly. And yet, the system was fundamentally broken in a way that affects 90% of production RAG deployments.

The Conventional Approach: The Pipeline Everyone Builds

Here's the RAG architecture in every tutorial, every blog post, every production system I've audited:

@garyblankenship
garyblankenship / physics.md
Created July 3, 2025 15:39
It's patterns all the way down #thoughts

We're All Traveling at 870,000 MPH and Nobody Told You Why That's the Most Important Number in Physics

You know that feeling when you're sitting perfectly still but you're actually hurtling through space at incomprehensible speeds? Yeah, about that—turns out the universe has favorite numbers, and we're living inside one of them.

Right now, as you read this, you're moving at 390 kilometers per second relative to the cosmic microwave background. That's 870,000 miles per hour. Not through space. Through spacetime itself. And here's the thing that sent me down a 3am physics spiral: this isn't just some random velocity. This number shows up everywhere in physics once you start looking, from electron behavior in superconductors to the expansion rate of reality itself.

The Velocity Stack: Or How Many Ways Can You Move Without Moving

Let me blow your mind with some basic addition that isn't actually addition at all.

@garyblankenship
garyblankenship / AI_notebook.md
Last active June 25, 2025 18:43 — forked from dneprovets/AI_notebook.md
AI Notebook #ai