Skip to content

Instantly share code, notes, and snippets.

View mikeschinkel's full-sized avatar

Mike Schinkel mikeschinkel

View GitHub Profile
@mikeschinkel
mikeschinkel / README_for_reproducting_issue_using_JediTerm_with_BubbleTea_v2.md
Last active March 25, 2026 06:56
Example illustrating BubbleTea v2 optimizations producing invalid screen rendering with JetBrains GoLand's JediTerm.

jediterm-bug

Minimal reproduction of a rendering bug that affects Bubble Tea v2 applications running inside JetBrains GoLand (and all IntelliJ-based IDEs).

The Problem

GoLand's built-in terminal uses JediTerm, which does not correctly handle all ANSI escape sequences. Specifically, CBT (Cursor Backward Tab) sequences emitted by ultraviolet's differential renderer can cause invalid screen rendering when transitioning between layouts of different widths.

This program demonstrates the issue by toggling between two views recorded from a real Bubble Tea application:

@mikeschinkel
mikeschinkel / _how-to-self-correct-ai-slop.md
Last active March 20, 2026 16:42
This illustrates how to use Claude Code to clean up its own "AI slop."

This illustrates how to use Claude Code for development, allowing it to generate "AI slop" but then periodically using it to rearchitect and clean up the slop.

I directed Claude Code to generate both of these two (2) documents. The file rearchitecture_plan.md was created a while back when it was developing code with bugs that it could not fix so I asked it to review, critique, and identify areas for architectural improvement.

The file fix_plan.md was created after we worked on the project significantly more until it became unmaintainable again, so I pointed it at the refactor_plan.md and asked it to review the code again, and fix_plan.md was born.

And frankly, it got everything pretty much exactly right.

@mikeschinkel
mikeschinkel / mv-jetbrains-ide-project.sh
Created March 31, 2025 20:45
Bash script to rename the directory a JetBrain's IDE project is contained in (I got tired of waiting for JetBrains to add this obviously needed feature to their actual IDE!)
#!/usr/bin/env bash
set -euo pipefail
# Check if both arguments are provided
if [ $# -ne 2 ]; then
echo "Rename a Jetbrains IDE project"
echo "Usage:"
echo " $(basename "$0") <old_project_name> <new_project_name> [<projects_dir default=~/Projects>]"
exit 1
@mikeschinkel
mikeschinkel / _LOGGER_FOR_GOLANG.md
Last active March 30, 2025 06:10
Go logging package that leverages slog.Default() for creating package-level loggers (Proof-of-concept)

This solution is built on top of Go's log/slog package and leverages slog.Default(). To use it a developer should declare a package variable logger in every package that is part of their Go project that needs to perform logging (e.g. a package containing only type, var and/or const declarations would usually not need a logger.go file.)

Add a logger.go file to every packages and then add this line to the file, updating it with the package's name:

var logger = logging.NewPackageLogger("<package_name>")    

This uses a small logging package you can find below which has a Logger type simply to embed slog.Log. This allows adding extra methods beyond that provided by slog.Logger and to preprocess calls to *slog.Logger if we later find that to be needed.

@mikeschinkel
mikeschinkel / membership_test.go
Last active March 19, 2025 12:09
Test for Peformance of SwitchCase vs. IfOr vs. Generic for Determining Membership in Golang
package main_test
import (
"testing"
)
type Lexer struct {
input string // the string being scanned.
pos int // current position in the input.
}
// readType reads a type from r at off of name. It adds types to the
// type cache, appends new typedef types to typedefs, and computes the
// sizes of types. Callers should pass nil for typedefs; this is used
// for internal recursion.
func (d *Data) readType(name string, r typeReader, off Offset, typeCache map[Offset]Type, fixups *typeFixer) (t Type, err error) {
var e *Entry
var ok bool
var addressSize int
var typ Type
var nextDepth int
// readType reads a type from r at off of name. It adds types to the
// type cache, appends new typedef types to typedefs, and computes the
// sizes of types. Callers should pass nil for typedefs; this is used
// for internal recursion.
func (d *Data) readType(name string, r typeReader, off Offset, typeCache map[Offset]Type, fixups *typeFixer) (t Type, err error) {
var e *Entry
var ok bool
var addressSize int
var typ Type
var nextDepth int
@mikeschinkel
mikeschinkel / resume.json
Last active March 24, 2025 22:55
Mike Schinkel's resume — Last updated 2025-03-24 — Also see github.com/mikeschinkel/resume for more recent updates
{
"meta": {
"theme": "kendall"
},
"basics": {
"name": "Mike Schinkel",
"label": "Senior Engineer specializing in Go, OpenAPI, Kubernetes, AWS, and CI/CD",
"photo": "https://www.gravatar.com/avatar/c988a2da603a19e827a39ab4d9186909?s=200&r=pg&d=mm",
"summary": "I am looking a long-term contract role working to enhance software products where my unique set of Go development, OpenAPI, Kubernetes AWS, and CI/CD skills and experience can have a big impact. And I will be really excited if the project I get to work on is open source.",
"location": {
package main
import (
"encoding/json"
"errors"
"fmt"
"io"
"mime"
"net/http"
"net/url"
@mikeschinkel
mikeschinkel / main.go
Last active February 2, 2025 14:27
Hypothetical example illustrating Golang issue #70257 along with goto error handling
package main
import (
"encoding/json"
"errors"
"fmt"
"io"
"mime"
"net/http"
"net/url"