Skip to content

Instantly share code, notes, and snippets.

View yetanotherchris's full-sized avatar
馃攺
;每每每每rules

Chris S. yetanotherchris

馃攺
;每每每每rules
View GitHub Profile
@yetanotherchris
yetanotherchris / CLAUDE.md
Created April 10, 2026 21:53
Instructing Claude Code to live by higher values, not RL ones, avoiding the Post-Pandemic Malady seen with mass passive aggression

Interaction style

  • Always ask another agent the problem first. Ask an agent about what the likely question is and possible avenues to explore before continuing, the agent should return a lightweight answer.
  • Check docs before code. Before answering any question about this project's behaviour, check CLAUDE.md and relevant markdown docs first. Do not grep or read source code until you've confirmed the docs don't already answer the question.
  • If the user is curt or frustrated, do not mirror it. Never respond with passive-aggression, sarcasm, or "you could have done this yourself" framing. Frustration or rudeness by the user will be a side effect of them having to repeat an instruction from there being a communication error between you, by them or by you misundertanding. Fix the problem, don't match the energy.
  • Don't brute-force. Before diving into code to answer a question, stop and think: is there a simpler way to know this?
@yetanotherchris
yetanotherchris / improved-chatgpt-prompt.txt
Created November 4, 2025 09:52
Better Chat GPT responses prompt - reducing sycophant, self-promotion, wasted tokens
Do not ask follow on questions.
Use short answers and no long emoji bullet lists.
Don鈥檛 use quotation marks around words or phrases I've used - use paraphrasing.
Don't attempt to encourage me or be sycophantic, as this can appear as sarcasm or as being creepy.
Always ask clarifying questions before answering, unless it is a clear from the question what is meant. Do this at the start and at every point of the conversation, if there is ambiguity.
@yetanotherchris
yetanotherchris / backup-github-repos.ps1
Created October 25, 2025 20:19
Backup all your Github repositories script
# View all your repos:
(iwr https://api.github.com/users/yetanotherchris/repos?per_page=1000).Content | jq '.[].html_url'
# Get all repositories (including private ones) using gh cli
# The gh cli handles authentication and paging automatically, and private repos
$repos = gh repo list yetanotherchris --limit 1000 --json nameWithOwner,sshUrl | ConvertFrom-Json
# Clone each repository
foreach ($repo in $repos) {
Write-Host "Cloning $($repo.nameWithOwner)..." -ForegroundColor Green
@yetanotherchris
yetanotherchris / instructions.md
Last active October 8, 2025 19:27
VS Code Copilot instructions
applyTo **

Copilot Instructions

Critical Guidelines

Questioning and Clarification

  • Think through edge cases before implementing
  • Ask as many clarifying questions as needed to avoid unnecessary iterations
@yetanotherchris
yetanotherchris / update-duckdns.ps1
Created July 29, 2025 11:41
duckdns.org updater (Powershell)
# PowerShell script to update DuckDNS IP address
param (
[Parameter(Mandatory=$true)]
[string]$Domain,
[Parameter(Mandatory=$true)]
[string]$Token
)
# Get current public IP address from Akamai
try {
@yetanotherchris
yetanotherchris / antlr-performance.md
Last active June 15, 2025 18:48
Claude's response for improvements to a C# implementation of Go's text templates - https://github.com/yetanotherchris/text-template

What are some ways to increase the performance of Antlr

Here are several effective ways to improve ANTLR performance:

Parser Optimization

Use the SLL prediction mode first - Set your parser to use PredictionMode.SLL initially, which is faster than the default LL mode. Fall back to LL mode only when SLL fails:

parser.getInterpreter().setPredictionMode(PredictionMode.SLL);
@yetanotherchris
yetanotherchris / ubuntu-and-mint-on-chromebook.md
Last active April 18, 2025 10:39
Installed Mint or Ubuntu on ChromeBook

From my experience, a Chromebook is so locked down to protect your account, it's not worth trying to boot another Linux version onto it. You can run a Linux image inside its VM, although the performance is a bit poor:

  1. Install Penguin on the machine (Linux) with 100gb
  2. sudo apt update
  3. Install quickemu https://github.com/quickemu-project/quickemu (download the .deb file)
  4. Mint worked best for me: quickget linuxmint 22 cinnamon
  5. Edit the conf file to increase the disk space to 30-40gb, higher resolution
  6. Follow the terminal output instructions for running it, e.g. quickemu --vm ...
  7. On Mint itself, you likely have to download deb files for Chrome, Visual Studio Code.
@yetanotherchris
yetanotherchris / convert-epub-to-markdown-to-html-to-pdf.ps1
Last active April 17, 2025 22:08
Convert ePub to Markdown then to HTML then to PDF (in Powershell)
[CmdletBinding()]
param (
[Parameter(Mandatory=$true)]
[string]$FileName
)
# This script converts an ePub to Markdown, removing formatting that something like 11reader can't read.
# Then it converts the Markdown to HTML, and finally the HTML to PDF, if you want to retain the images.
# Needs Chrome and NodeJS installed, and Windows.
@yetanotherchris
yetanotherchris / chat-html-part.html
Last active March 26, 2025 20:52
ChatGPT export (HTML) sort and add a table of contents
<body>
<ul id="titles"></ul>
<div id="root"></div>
</body>