Skip to content

Instantly share code, notes, and snippets.

@joonas
joonas / audit-your-codebase.md
Created August 23, 2026 02:14 — 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.

@joonas
joonas / hk.pkl
Last active December 29, 2025 19:17
minimal `hk.pkl` setup to run check-conventional-commit built-in for commit messages
amends "package://github.com/jdx/hk/releases/download/v1.28.0/hk@1.28.0#/Config.pkl"
import "package://github.com/jdx/hk/releases/download/v1.28.0/hk@1.28.0#/Builtins.pkl"
hooks {
["commit-msg"] {
steps {
["conventional-commit"] = Builtins.check_conventional_commit
}
}
}
@joonas
joonas / jwt.sh
Created May 21, 2024 15:10
Zero dependency (bash doesn't count) JWT decoding command-line utility
#!/bin/bash
# pad base64URL encoded to base64
paddit() {
input=$1
l=`echo -n $input | wc -c`
while [ `expr $l % 4` -ne 0 ]
do
input="${input}="
l=`echo -n $input | wc -c`
resources:
- name: project-a
type: git
source:
uri: https://github.com/msarahan/ci_test.git
- name: project-b
type: git
source:
uri: https://github.com/msarahan/ci_test.git
#!/usr/bin/env bash
VERSION_TAGS=$(git log --pretty=oneline --grep '[0-9]$' \
--branches=origin/remote -- www/version.txt | cut -d ' ' -f1)
for commit_hash in $VERSION_TAGS
do
version=$(git show $commit_hash:www/version.txt)
git tag $version $commit_hash
done
@joonas
joonas / gist:4186011
Created December 2, 2012 00:00
Unicorn script
#!/bin/sh
set -e
# Feel free to change any of the following variables for your app:
TIMEOUT=${TIMEOUT-60}
APP_ROOT=/srv/www/appname/current
PID=$APP_ROOT/tmp/pids/unicorn.pid
RAILS_ENV=production
CMD="cd $APP_ROOT; bundle exec unicorn -D -c $APP_ROOT/config/unicorn.rb -E $RAILS_ENV"
AS_USER=ubuntu
@joonas
joonas / 0-readme.md
Created October 25, 2012 04:27 — forked from sj26/0-readme.md
ruby-1.9.3-p194 cumulative performance patch.

Patched ruby 1.9.3-p194 for 30% faster rails boot

What is?

This script installs a patched version of ruby 1.9.3-p194 with patches for boot-time performance improvements (#66 and #68), and runtime performance improvements (#83 and #84). It also includes the new backported GC from ruby-trunk.

Huge thanks to funny-falcon for the performance patches.

{
"run_list": [
"recipe[nginx::source]",
"recipe[rbenv::ruby_build]"
],
"rbenv": {"group_users": ["ec2-user"]}
}
@joonas
joonas / fileless_file.rb
Created July 7, 2012 01:40 — forked from mkrogh/fileless_file.rb
Carrierwave proccess zipfile contents
#A nice little carrierwave IO faker class
class FilelessFile < StringIO
attr_accessor :original_filename
end
@joonas
joonas / fakeout.rb
Created July 7, 2012 00:02 — forked from matthutchinson/fakeout.rb
fake.rake - a takeout approach and rake task that generates some random fake data for a rails app (using ffaker)
# place this in lib/fakeout.rb
require 'ffaker'
module Fakeout
class Builder
FAKEABLE = %w(User Product)
attr_accessor :report