# Andreas Bergström > Personal site and engineering blog of Andreas Bergström, a full-stack and AI > engineer in Stockholm, Sweden. Posts are short, specific write-ups on tooling > behaviour — usually a gotcha verified against a pinned version, rather than > introductory material. ## Pages - [Home](https://andreasbergstrom.dev/): profile, featured projects, open-source repositories. - [Resume](https://andreasbergstrom.dev/resume): career history, skills and professional background. - [All posts](https://andreasbergstrom.dev/posts): full chronological archive. - [Tags](https://andreasbergstrom.dev/tags): posts grouped by topic. ## Posts - [The best bug reports were written by the suspect](https://andreasbergstrom.dev/posts/advisory-llm-verdicts-on-held-invoice-orders): In a project I worked on — the order back office for a group of e-commerce shops — a rule engine decides which orders ship automatically.… (2026-06-12 · llm, openai, ai, security) - [The X-Inertia cache trap: Cloudflare, Vary, and edge-cached HTML](https://andreasbergstrom.dev/posts/inertia-cloudflare-cache-poisoning): I clicked the logo on one of my sites and the homepage opened inside a modal. Dimmed backdrop, rounded corners, the full page — header,… (2026-06-11 · laravel, inertia, cloudflare, caching, laravel-cloud) - [The Last Human-First Programming Language](https://andreasbergstrom.dev/posts/the-last-human-first-programming-language): Java's garbage collector hid lifetimes. Ruby hid types. Rails hid HTTP. Hibernate hid SQL. EC2 hid hardware. For three decades,… (2026-05-06 · llm, ai, programming, tooling) - [The LLM-shaped hole in your XGBoost pipeline](https://andreasbergstrom.dev/posts/the-llm-shaped-hole-in-your-xgboost-pipeline): Every team I've worked with that ships a tabular ML model has, at some point in the last two years, been asked the same question by… (2026-05-04 · llm, machinelearning) - [Keeping the Prisma CLI out of a Bun runtime image](https://andreasbergstrom.dev/posts/keeping-the-prisma-cli-out-of-a-bun-runtime-image): This site's runtime Docker image was 423 MB. A large share of that was Prisma CLI tooling the server never imported — migration engines,… (2026-04-25 · bun, prisma, docker, railway) - [Shipping TanStack Start and Bun to Railway](https://andreasbergstrom.dev/posts/shipping-tanstack-start-and-bun-to-railway): This site runs on TanStack Start with Bun, backed by a Railway-managed Postgres. Railway's autobuild (Nixpacks) detects Bun projects just… (2026-04-25 · railway, docker, bun, tanstack) - [Wiring Prisma 7 into TanStack Start on Bun](https://andreasbergstrom.dev/posts/wiring-prisma-7-into-tanstack-start-on-bun): This site runs on TanStack Start with Prisma 7 against PostgreSQL, on the Bun runtime. The three of them fit together cleanly, but there… (2026-04-22 · prisma, tanstack, bun, typescript) - [Cutting a MySQL table in half with one line](https://andreasbergstrom.dev/posts/cutting-a-mysql-table-in-half-with-one-line): We had a wide MySQL table — think analytics events: one row per visit, lots of text columns for URLs, referrers, UTM parameters, click… (2026-04-22 · mysql, database, performance) - [Using FastMCP with OpenAI and Avoiding Session Termination Issues](https://andreasbergstrom.dev/posts/fastmcp-openai-session-termination): FastMCP is the lightweight Python framework for building MCP servers — the kind of server that exposes tools to an AI agent. OpenAI's… (2025-08-10 · ai, fastmcp, openai, mcp) - [Redirecting mobile users to App or Play Store in NextJS](https://andreasbergstrom.dev/posts/nextjs-mobile-app-store-redirect): You want one URL — printed on a sticker, stamped into a QR code, pasted in an email — that takes a visitor to your app in the store… (2023-11-27 · nextjs, mobile, javascript, typescript) - [Python del vs assigning to None](https://andreasbergstrom.dev/posts/python-del-vs-none): Python's runtime handles memory for you, but every so often you'll see code that tries to give it a nudge. The two ways that come up are:… (2023-11-11 · python, performance) - [Node 21 brings built-in WebSocket support](https://andreasbergstrom.dev/posts/node-21-built-in-websocket): Node has shipped a built-in WebSocket client. It landed experimentally in Node 21 (October 2023), graduated to stable in Node 22 LTS, and… (2023-10-16 · node) - [Configure TypeORM migrations in 5 minutes](https://andreasbergstrom.dev/posts/typeorm-migrations-nestjs): TypeORM still ships with NestJS templates and still works fine, but the ergonomics have aged badly compared to Drizzle and Prisma. If… (2023-10-15 · nestjs, typeorm, javascript, typescript) - [Easily style active links in Tanstack Router](https://andreasbergstrom.dev/posts/tanstack-router-active-link-styles): TanStack Router gives you two ways to style the active link in a navbar — activeProps for component-level prop merging, and a… (2023-10-14 · javascript, react, webdev, ux) - [Finally you can skip dotenv in Node](https://andreasbergstrom.dev/posts/node-built-in-env-file-no-dotenv): For years, every Node project started the same way: npm install dotenv, require('dotenv').config() at the top of index.js. Node 20.6 (Sep… (2023-09-09 · node, javascript, npm) - [How to style for print in Tailwind](https://andreasbergstrom.dev/posts/tailwind-print-styles): Default browser print stylesheets look broken on most websites — navs, footers, dark themes, and interactive elements all carry over to… (2023-08-13 · tailwindcss, webdev, css) - [Understanding Cache-Control and ETag for efficient web caching](https://andreasbergstrom.dev/posts/http-cache-control-etag): HTTP caching done well saves bandwidth, server load, and round-trip time at once. Done badly, it ships stale content or hits the origin on… (2023-08-10 · http, webdev, webperf, caching) - [Simplify TypeScript builds with esbuild and skip tsc/tsx](https://andreasbergstrom.dev/posts/esbuild-typescript-skip-tsc): The "esbuild over tsc" pitch has narrowed since 2023 — Node 22 added --experimental-strip-types, Node 23+ runs TypeScript files directly… (2023-08-09 · node, typescript, javascript, webdev) - [package.json: Not just a file, but a Developer's Toolkit](https://andreasbergstrom.dev/posts/package-json-npm-scripts-toolkit): The package.json scripts block is the one configuration surface every Node project agrees on. It's also where most projects accumulate the… (2023-08-08 · node, npm) - [The future of AI assistants might begin in your app settings](https://andreasbergstrom.dev/posts/ai-assistants-app-settings): In today's software-driven world the complexity of applications and their settings often overwhelms users. Every app seems to come with… (2023-08-07 · llm, ai, machinelearning, chatgpt) - [How to effectively use ChatGPT as a developer](https://andreasbergstrom.dev/posts/chatgpt-for-developers): 2026 update. I wrote this in May 2023, when "use ChatGPT as a developer" basically meant pasting code into chat.openai.com and reading… (2023-05-30 · chatgpt, tooling, programming, productivity) - [Everything you need to know about AWS CLI Profiles](https://andreasbergstrom.dev/posts/aws-cli-profiles-keychain-sso): The AWS CLI uses two files in ~/.aws/: ~/.aws/credentials — access keys, one section per profile. ~/.aws/config — region, output format,… (2023-05-24 · aws, cli, devops, cloud) - [Dockerfiles for Node and TypeScript: Slim Containers with Distroless](https://andreasbergstrom.dev/posts/node-typescript-distroless-dockerfile): The full node:22 image is well over a gigabyte uncompressed and ships with the entire Debian userspace — bash, apt, perl, a dozen… (2023-05-20 · node, typescript, docker, backend) - [Easily upgrade npm dependencies with npm-check-updates](https://andreasbergstrom.dev/posts/npm-check-updates-bulk-upgrade): On smaller projects, dependencies drift out of date faster than you can keep up, and npm itself doesn't ship a bulk-upgrade command — npm… (2023-04-28 · node, npm, webdev) - [Enhanced Security in Node.js v20: The New Permission Model](https://andreasbergstrom.dev/posts/node-20-permission-model): A Node process inherits the user's full filesystem and process-spawn rights by default, which means any third-party dependency you install… (2023-04-22 · node) - [When to Use Force Push for Clean Git Branch Histories](https://andreasbergstrom.dev/posts/git-force-push-clean-history): Force-pushing is fine on personal branches and topic branches with no other contributors; it's a footgun anywhere else. The safer command… (2023-04-19 · git) - [patch-package: The Lifesaver for both Bleeding Edge and Legacy Projects](https://andreasbergstrom.dev/posts/patch-package-dependency-fixes): patch-package lets you keep a local diff against an installed dependency and replay it on every install — useful when an upstream bug… (2023-04-18 · javascript, npm, node) - [Finding the Balance: When to Use Object Destructuring and When to Avoid It](https://andreasbergstrom.dev/posts/javascript-object-destructuring-tradeoffs): Object destructuring of function parameters is the right default for any function with three or more parameters, any optional ones, or a… (2023-04-16 · typescript, javascript) - [Rethinking Security: The Need for Cookie Support in Native Mobile Applications](https://andreasbergstrom.dev/posts/native-mobile-cookie-support-security): In 2023 I argued native mobile apps were missing HttpOnly cookie support and that web apps had a security advantage as a result. Three… (2023-04-15 · security, mobile) - [One SVG to Rule Them All: The Dynamic Way](https://andreasbergstrom.dev/posts/dynamic-svg-icons-react): When you ship icons in a React Native app, it's tempting to export a separate file for every stroke width and color. You don't have to.… (2023-04-13 · javascript, reactnative) - [A history of web layout techniques: From Frames to WebAssembly](https://andreasbergstrom.dev/posts/history-web-layout-frames-webassembly): Layout on the web has cycled through five or six paradigms in thirty years. Each one looked permanent at the time. Here's the trail, with… (2023-04-12 · html, css, web) - [Rename a MongoDB database in two commands](https://andreasbergstrom.dev/posts/rename-mongodb-database): MongoDB has no native rename-database command. The move is mongodump followed by mongorestore into the new name — the old database stays… (2023-04-12 · mongodb, nosql, database) - [Quick and Handy Tips for Everyday PostgreSQL Tasks](https://andreasbergstrom.dev/posts/everyday-postgresql-tips): A handful of PostgreSQL one-liners I keep going back to. Filter rows from today onwards CURRENT_DATE is promoted to a timestamp at… (2023-04-12 · postgres, sql) - [Using Axios in Node? Have a look at got](https://andreasbergstrom.dev/posts/node-got-vs-axios): Axios is the Node HTTP client most people reach for by default, but got and Node's built-in fetch (Node 18+, backed by undici) are both… (2023-04-12 · node, javascript) - [The history of HTTP in under 5 minutes](https://andreasbergstrom.dev/posts/history-of-http): A 5-minute trip through HTTP, version by version: what each one added, what stuck, and what quietly didn't. HTTP/0.9 (1991) Tim… (2023-04-12 · web, http, networking, browsers) - [Suspend and resume shell processes](https://andreasbergstrom.dev/posts/shell-suspend-resume-jobs): Ctrl+Z sends SIGTSTP and stops the foreground job — it's frozen, not running, consuming no CPU until resumed. Ctrl+C (SIGINT) terminates… (2023-04-11 · terminal) - [Change computer name displayed in Terminal (Mac)](https://andreasbergstrom.dev/posts/change-mac-terminal-hostname): The macOS hostname is split across three scutil keys, and the one that drives your shell prompt isn't the only one you usually want to… (2023-04-11 · scutil, mac, terminal, macos) - [Easily switch between multiple Node versions without using nvm](https://andreasbergstrom.dev/posts/switch-node-versions-without-nvm): If you already have Homebrew, you don't need nvm to juggle Node versions on macOS. brew unlink / brew link handles it. Install a versioned… (2023-04-11 · node) - [Immutability vs. Mutability in JavaScript: Performance Trade-offs and the Role of JIT](https://andreasbergstrom.dev/posts/javascript-immutability-mutability-jit-performance): Originally published April 2023, in a series with Parts 1 and 2 of the perf gotchas posts. Modern V8 / Maglev / Turbofan have made the… (2023-04-11 · javascript, performance, node) - [5 More JavaScript Performance Gotchas](https://andreasbergstrom.dev/posts/javascript-performance-gotchas-part-2): Originally published April 2023, follow-up to Part 1. Modern V8 / SpiderMonkey / JavaScriptCore have made parts of this advice obsolete —… (2023-04-11 · javascript, performance, node) - [JavaScript Performance Gotchas: Avoid scaling issues through under-the-hood knowledge](https://andreasbergstrom.dev/posts/javascript-performance-gotchas-part-1): Originally published April 2023. Modern V8 / SpiderMonkey / JavaScriptCore have made most of this advice less load-bearing than it was —… (2023-04-11 · javascript, performance, node) - [How to set the initial route in Expo Router](https://andreasbergstrom.dev/posts/expo-router-initial-route): Originally written for Expo Router v1 in April 2023. The API has since moved — what's below is the current pattern as of Expo Router v3+… (2023-04-05 · expo, reactnative, javascript, mobile) - [Kill a process using a specific port (MacOS)](https://andreasbergstrom.dev/posts/kill-process-on-port-macos): Find what's holding a port and kill it: lsof -t prints just PIDs; -iTCP:PORT -sTCP:LISTEN narrows to listeners on that port so you don't… (2023-03-27 · systems) - [error: src refspec refs/heads/foo matches more than one](https://andreasbergstrom.dev/posts/git-src-refspec-matches-more-than-one): The error error: src refspec production matches more than one appears on git push production when the unqualified ref resolves to both… (2022-11-13 · git) - [Convert string dates to Date-type in MongoDB](https://andreasbergstrom.dev/posts/mongodb-convert-string-dates-to-date): Sorting and range queries against date fields silently break when the values are stored as strings. Convert them in place — the pipeline… (2022-11-05 · mongodb, database, javascript) - [Stop Xcode 14 from signing pods (React Native solution)](https://andreasbergstrom.dev/posts/xcode-14-disable-pod-signing-react-native): Historical note: this is an Xcode 14 / React Native <0.70.3 issue. Modern Xcode 16/17 plus RN 0.74+ (New Architecture default in 0.76)… (2022-10-16 · reactnative, xcode, swift) - [Remove all tables in a Postgres schema](https://andreasbergstrom.dev/posts/postgres-drop-all-tables-in-schema): When working with initial migrations in a project it is often helpful to drop all tables and then re-run all migrations. Instead of… (2022-10-11 · postgres) - [Make VS Code look a bit more smooth (on Mac)](https://andreasbergstrom.dev/posts/vscode-smoother-rendering-mac): Default VS Code text rendering on macOS Retina can look fuzzy because the editor doesn't pick up the system's font smoothing. One setting… (2021-03-11 · vscode) - [Set Xcode build numbers to incremented or timestamps](https://andreasbergstrom.dev/posts/xcode-auto-increment-build-numbers): Archive, upload, get rejected because the build number didn't change. Automate the bump and stop hand-editing it before every TestFlight… (2021-02-23 · xcode, ios, mobile) - [Setting up an EC2-instance for load testing with k6](https://andreasbergstrom.dev/posts/ec2-k6-load-testing-setup): Running Grafana k6 at meaningful load from a fresh EC2 box hits two snags before any test runs: the kernel and shell defaults aren't tuned… (2020-11-24 · k6, loadtest, aws) - [How to make VS Code read dotenv file when debugging](https://andreasbergstrom.dev/posts/vscode-debug-dotenv-launch-config): When VS Code launches a Node program for debugging, it doesn't pick up the variables from your project's .env file. The instinct is to… (2020-09-17 · vscode, debug) ## Notes - Feeds: https://andreasbergstrom.dev/rss.xml (RSS), https://andreasbergstrom.dev/sitemap.xml (sitemap). - Content is authored by Andreas Bergström. Attribution with a link back to the canonical URL is appreciated when this material is quoted or summarised.