Skip to content

Instantly share code, notes, and snippets.

View arachsys's full-sized avatar
💭
Please contact me by email

Chris Webb arachsys

💭
Please contact me by email
View GitHub Profile
@arachsys
arachsys / pwgen.py
Last active August 10, 2026 09:03
Generate phonetic passwords with reliable entropy
#!/bin/python
import functools, math, os, secrets, sys
letters = list('abcdefghijklmnopqrstuvwxyz')
digits = list('0123456789')
vowels = list('aeiou')
consonants = [ c for c in letters if c not in vowels ]
clusters = { c + 'y' for c in consonants if c not in 'qy' } | {
@arachsys
arachsys / reverse-chatgpt
Last active January 5, 2025 19:42
Reverse ChatGPT
#!/bin/bash
set -o pipefail
shopt -s extglob
export LANG=C.UTF-8
export API=${API:-https://api.openai.com/v1/chat/completions}
export KEY=${KEY:-$(< ~/.config/secrets/openai)}
export MODEL=${MODEL:-gpt-4o}
@arachsys
arachsys / roleplay.kak
Last active January 5, 2025 19:42
Roleplay characters in Kakoune with OpenAI gpt-4o
declare-option str roleplay_api "https://api.openai.com/v1/chat/completions"
declare-option str roleplay_key "openai"
declare-option str roleplay_model "gpt-4o"
declare-option str roleplay_prompt %{
You are an imaginative storyteller collaborating with the user to create
an engaging story. The user sets the scene and writes their character's
dialogue, thoughts, and actions in first person. Your role is to write
the dialogue, thoughts, and actions of other characters, keeping them
consistent with their established motivations, limitations, personality,