Skip to content

Instantly share code, notes, and snippets.

@joshlarsen
joshlarsen / audit-your-codebase.md
Created August 17, 2026 01:02 — forked from aarondfrancis/audit-your-codebase.md
A read-only, agent-orchestrated codebase audit prompt for data structures, state modeling, algorithms, and ownership.

Audit this entire codebase for materially useful simplifications in its data structures, state representation, control flow, algorithms, and ownership.

This is an audit-only exercise. Do not edit files, run tests, implement recommendations, commit, or push. Read-only inspection commands are allowed.

You are the coordinator. Continue until the complete codebase has been reviewed and the final audit is validated.

  1. Establish the coverage contract

Inspect the repository and inventory every identifiable subsystem.

@joshlarsen
joshlarsen / idiomatic_go_v2.md
Created February 11, 2026 19:52 — forked from ashokallu/idiomatic_go_v2.md
Idiomatic Go Programming Guide 2025+ - Gold Standard Edition

Idiomatic Go Programming Guide 2025+ - Gold Standard Edition

"Go is about making software engineering more effective, not just making programmers more productive." - The Go Team

Target Go Version: Go 1.23+ (examples align with 1.23–1.24 features)


Executive Summary

@joshlarsen
joshlarsen / organize-imports.luau
Created October 22, 2025 19:20 — forked from nightcycle/organize-imports.luau
I wrote this because Synty Studios uses texture maps for their assets, but it's more convenient to recolor the mesh directly in Roblox Studio. This splits it into multiple OBJ based on the color the UV points to.
--!strict
-- Run this in command line after you import the meshes
-- Services
-- Packages
-- Modules
-- Types
-- Constants
local SEPARATION = 1
local MAX_X_OFFSET = 50
-- Variables
@joshlarsen
joshlarsen / tmux.conf
Last active July 4, 2022 16:03
tmux config
# split panes using | and -
bind | split-window -h
bind - split-window -v
unbind '"'
unbind %
# color terminal
set -g default-terminal "xterm-256color"
# Disable mouse mode
@joshlarsen
joshlarsen / ssh.sh
Created June 14, 2022 01:22
gcloud ssh port forwarding
gcloud compute ssh --ssh-flag="-L 5555:localhost:5432" "instance-1"
@joshlarsen
joshlarsen / redis
Created October 13, 2021 20:05
Rails binstubs
#!/bin/bash
#
# Make sure to stop/start the Redis Docker container properly.
#
CONTAINER_NAME="redis-container"
DOCKER_START="docker start -ai ${CONTAINER_NAME}"
DOCKER_RUN="docker run --name ${CONTAINER_NAME} -p 6379:6379 redis"
# is there an existing container named 'redis'?
@joshlarsen
joshlarsen / 0-opa-json-cheatsheet.md
Created August 20, 2021 20:30 — forked from onelittlenightmusic/0-opa-json-cheatsheet.md
Document for `jr`, `jb` or `jp`

jr, jp, jb (alias to opa eval): Cheatsheet

jr, jp and jb are commands for JSON modification.

Basic usages

$ data='{"name":"chris", "friends":["alice", "bob"]}'
# jr
$ echo $data | jr 'i.name'
@joshlarsen
joshlarsen / deploy.sh
Last active September 2, 2022 03:11
Basic Jekyll Deploy Action
#!/bin/bash
set -e
DEST="${JEKYLL_DESTINATION:-_site}"
REPO="https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
BRANCH="gh-pages"
BUNDLE_BUILD__SASSC=--disable-march-tune-native
echo "Installing gems..."
@joshlarsen
joshlarsen / netcat_web_server_one_liner.sh
Created April 22, 2021 20:48
netcat web server one liner
while true; do echo -e "HTTP/1.1 200 OK\n\n $(date)" | nc -l localhost 4000; done
@joshlarsen
joshlarsen / app.rb
Last active February 28, 2021 15:45
Faktory polyglot speed tests
require 'connection_pool'
require 'faktory'
T = ARGV[0].to_i
puts "Starting #{T} jobs for each (ruby, node, python)"
puts Time.now()
SomeRubyWorker = Faktory::Job.set(queue: 'ruby', jobtype: 'RubyWorker')
SomeNodeWorker = Faktory::Job.set(queue: 'node', jobtype: 'nodeWorker')
SomePythonWorker = Faktory::Job.set(queue: 'python', jobtype: 'python_worker')