Skip to content

Instantly share code, notes, and snippets.

@kevinmichaelchen
kevinmichaelchen / cupid.md
Created September 19, 2025 13:55
Development principles and guidelines

CUPID: Properties for Joyful Code

CUPID is a framework for creating "joyful code" that humans can understand and enjoy working with. As Martin Fowler noted: "Good programmers write code that humans can understand."

The Five Properties

🧩 Composable

@kevinmichaelchen
kevinmichaelchen / prisma-vs-kysely-unordered-migrations.md
Last active September 12, 2025 19:37
Comparison of how Prisma and Kysely handle unordered migrations in parallel development

🔄 Prisma vs Kysely: Unordered Migrations Comparison

📋 Executive Summary

Prisma does not suffer from the same unordered migrations problem that affects Kysely. While Kysely strictly enforces alphabetical/chronological ordering of migrations and fails when migrations are executed out of order, Prisma uses a more flexible approach that tracks migration history in the database and provides tools to handle divergent migration histories.

⚠️ The Kysely Problem

@kevinmichaelchen
kevinmichaelchen / kysely-unordered-migrations.md
Created September 12, 2025 18:44
Kysely Migration Ordering: Handling Parallel Development - How to handle out-of-order migrations in team environments

Kysely Migration Ordering: Handling Parallel Development

The Problem

When multiple developers work on feature branches simultaneously, they often create migrations with timestamps that become out of order when merged. This is a common scenario:

  • Developer A creates migration 20240112_1200_add_users.sql on their feature branch
  • Developer B creates migration 20240112_1201_add_products.sql on their feature branch
  • Developer B merges first, production runs the 12:01pm migration
  • Developer A merges second, but now there's a problem...
@kevinmichaelchen
kevinmichaelchen / declarative-migrations.md
Last active September 12, 2025 18:38
Migration Systems: Traditional Timestamp-Based vs Atlas - Why timestamp-based migrations fail and how Atlas solves it

Migration Systems: Traditional Timestamp-Based vs Atlas

If you've ever seen Kysely return the error below, this post is for you.

☠️ Error: corrupted migrations: previously executed migration

The Problem with Traditional Timestamp-Based Migration Systems

@kevinmichaelchen
kevinmichaelchen / musicbrainz.md
Last active November 2, 2024 21:55
MusicBrainz API + Data Schema

GraphQL

https://graphbrainz.fly.dev lets you do cool GraphQL queries.

Page through an artist's albums

query {
  lookup {
    artist(mbid: "144ef525-85e9-40c3-8335-02c32d0861f3") {
@kevinmichaelchen
kevinmichaelchen / no-mo-homebrew.md
Last active November 14, 2023 18:41
Installing pkgx (Successor to Homebrew)

You don't really need Homebrew

[pkgx][pkgx] is a package manager that can basically do everything Homebrew can.

You can find full installation instructions [here][pkgx-install], but it's simplest to run:

curl -fsS https://pkgx.sh | sh
@kevinmichaelchen
kevinmichaelchen / gpg.md
Last active June 16, 2025 15:03
Public gpg key

Created with bpb:

-----BEGIN PGP PUBLIC KEY BLOCK-----

mQAzBGTipBYWCSsGAQQB2kcPAQEHQK/+Oj+06V3IFv4BEdKuXQ5godXI0Wg8cRqDXcamiIXOtQAn
S2V2aW4gQ2hlbiA8a2V2aW5taWNoYWVsY2hlbkBnbWFpbC5jb20+iQB7BBMWCAAjFiEE0kLROtLI
1OXia6+OP7v1LOaxiH4FAmTipBYCGwMCF4AACgkQP7v1LOaxiH5IxgD+IsUdRudiISj9DYgKUPTf
E2qKrrPfMCgCVthFwEAYHVAA/iXnG0LyF0yHn9plrV4Y3DiS09V+lVekLzXH3DSFSDgI
=4ktF
@kevinmichaelchen
kevinmichaelchen / tmux.conf
Last active October 29, 2020 14:04
tmux.conf
# lives in ~/.tmux.conf
set -g activity-action other
set -g assume-paste-time 1
set -g base-index 0
set -g bell-action any
# had to comment this out to g et it to work
#set -g default-command
set -g default-shell /usr/bin/zsh
set -g default-size 80x24
set -g destroy-unattached off
{
"meta": {
"theme": "elegant"
},
"basics": {
"name": "Kevin Chen",
"label": "Software Developer",
"picture": "https://avatars3.githubusercontent.com/u/5129994?s=400&v=4",
"email": "kevin.chen.bulk@gmail.com",
"phone": "(202) 738-4916",
@kevinmichaelchen
kevinmichaelchen / flatmap-stream-bitcoin-attack.md
Last active November 28, 2018 17:22
Understanding flatmap-stream Bitcoin attack