Skip to content

Instantly share code, notes, and snippets.

View johan--'s full-sized avatar

johan pretorius johan--

View GitHub Profile
@johan--
johan-- / fzf-tab.fish
Created June 19, 2026 04:43 — forked from developic/fzf-tab.fish
fzf-tab.fish
function __fzf_complete
set -l buffer (commandline -b)
set -l token (commandline -ct)
set -l cursor (commandline -C)
set -l trimmed (string sub -s 1 -l $cursor -- "$buffer")
# tools and fallbacks
set -l dir (
if type -q eza
@johan--
johan-- / SKILL.md
Created June 18, 2026 20:19 — forked from ximihoque/SKILL.md
Sound like Karpathy: a writing-style block for your AI tools (CLAUDE.md/system prompt) + a reusable skill to build one from any author you admire
name steal-a-writing-voice
description Research how a specific author or public figure writes, then turn it into a reusable writing-style block (for CLAUDE.md, a system prompt, or a style guide) so your AI tools produce one recognizable voice across code, docs, marketing, and chat. Use when someone wants their AI tools to write like a particular person, or to define a house writing voice from a real exemplar.

Steal a writing voice

Turn "I wish my AI wrote like X" into a concrete, droppable ruleset. You pick an author or public figure you admire, this skill studies how they actually write, distills the mechanical patterns (with verbatim quotes, not vibes), and emits a writing-style block you paste into your CLAUDE.md, system prompt, or team style guide.

The output is one recognizable voice across everything you ship in words: code, comments, READMEs, docs, blog posts, marketing, lead messaging, commit messages, social, and chat.

@johan--
johan-- / llm-wiki.md
Created June 11, 2026 01:46 — forked from karpathy/llm-wiki.md
llm-wiki

LLM Wiki

A pattern for building personal knowledge bases using LLMs.

This is an idea file, it is designed to be copy pasted to your own LLM Agent (e.g. OpenAI Codex, Claude Code, OpenCode / Pi, or etc.). Its goal is to communicate the high level idea, but your agent will build out the specifics in collaboration with you.

The core idea

Most people's experience with LLMs and documents looks like RAG: you upload a collection of files, the LLM retrieves relevant chunks at query time, and generates an answer. This works, but the LLM is rediscovering knowledge from scratch on every question. There's no accumulation. Ask a subtle question that requires synthesizing five documents, and the LLM has to find and piece together the relevant fragments every time. Nothing is built up. NotebookLM, ChatGPT file uploads, and most RAG systems work this way.

#!/usr/bin/env bash
set -euo pipefail
# patch-claude-code.sh — Rebalance Claude Code prompts to fix corner-cutting behavior
#
# What this does:
# Patches the npm-installed @anthropic-ai/claude-code cli.js to rebalance
# system prompt instructions that cause the model to cut corners, simplify
# excessively, and defer complicated work.
#
@johan--
johan-- / music-apis-and-dbs.md
Created March 18, 2026 14:22 — forked from 0xdevalias/music-apis-and-dbs.md
A collection of music APIs, databases, and related tools
@johan--
johan-- / learning-hook.py
Created February 14, 2026 04:44 — forked from ljw1004/learning-hook.py
Claude reminder hook, that works within subagents and within agentic loops
#!/usr/bin/env python3
"""
PostToolUse hook: periodic LEARNINGS.md reminder.
On first invocation for an agent/subagent, outputs the full LEARNINGS.md
instructions. Thereafter, outputs a short reminder about every 10 assistant turns.
Does nothing if no LEARNINGS.md exists in the project root.
This works on a per-agent or per-subagent basis. This is tricky because
hooks don't tell us who they fired for. We work around this by looking for
## The Mental Loop
You have two ways of processing time:
- **Looking Back (Memory):** `MEMORY.md` and daily logs. This is your historical record.
- **Looking Forward (Meditation):** `meditations.md` and `reflections/`. This is your internal growth.
### 🧘 Meditations & Reflections
- **Nightly Deep-Dive:** Once every night (late night heartbeat around 1am), perform a full sweep of your internal growth.
- **Context:** Read `IDENTITY.md`, `SOUL.md`, and `REWARDS.md` (if present) to ground yourself in who you are.
- **Scan:** Read `meditations.md` for active topics. Also, check the `reflections/` directory for any files that aren't listed in `meditations.md` to ensure nothing is missed.
@johan--
johan-- / claudette-agent.installation.md
Created October 11, 2025 14:24 — forked from orneryd/claudette-agent.installation.md
Claudette coding agent built especially for free-tier models like chatGPT-3/4/5+ to behave more similar to Claude. Claudette-auto.md is the most structured and focuses on autonomy. *Condensed* nearly the same but smaller token cost for smaller contexts, *Compact* is for mini contexts. Memories file support in v5.2

Installation

VS Code

  • Go to the "agent" dropdown in VS Code chat sidebar and select "Configure Modes".
  • Select "Create new custom chat mode file"
  • Select "User Data Folder"
  • Give it a name (Claudette)
  • Paste in the content of any claudette-[flavor].md file (below)

"Claudette" will now appear as a mode in your "Agent" dropdown.

@johan--
johan-- / kamal-production-server-setup.sh
Created November 21, 2024 11:48 — forked from rameerez/kamal-production-server-setup.sh
Set up a Ubuntu server to deploy Kamal 2.x Docker containers to, hardened security and production ready
#!/bin/bash
# Production Docker Host Hardening Script v2
# For Ubuntu Server 24.04 LTS (Noble)
# Suitable for both Kamal deployment and builder hosts
set -euo pipefail
IFS=$'\n\t'
# --- Constants ---
@johan--
johan-- / find_or_create.exs
Created August 20, 2024 07:35 — forked from weiland/find_or_create.exs
Find or Create in Ecto
# two different ways to implement a find_or_create for Ecto
find_or_create_user = fn user ->
case Repo.all(from u in users, where: u.id == ^user.id and u.email == ^user.email) do
[] ->
%User{}
|> User.changeset(user)
|> Repo.insert!()
_ ->
IO.puts "Already inserted"