Skip to content

Instantly share code, notes, and snippets.

View blixt's full-sized avatar
🍪
biscuit.so

Blixt blixt

🍪
biscuit.so
View GitHub Profile
@blixt
blixt / pkill-guard.zsh
Created October 26, 2026 21:48
pkill guard to stop Claude/Codex from pkilling your computer
pkill() {
local -a rest=("$@") others=()
local arg letters i seen_pattern=0 ended=0 want_value=0
# A leading -9, -KILL or -SIGTERM is pkill's own; pgrep takes no signal.
local sig=${${rest[1]#-}#SIG}
if [[ ${rest[1]} == -* && ( $sig == <-> || ${${(s: :)$(kill -l)}[(Ie)$sig]} -gt 0 ) ]]; then
rest=("${(@)rest[2,-1]}")
fi
@blixt
blixt / findAndReplace.ts
Created September 8, 2025 20:17
If you're giving GPT-5 a findAndReplace tool, this helps work around its tendency to mix up spaces/tabs
/**
* Replaces old_string with new_string in the given code.
* Validates that old_string appears exactly once to avoid ambiguous replacements.
*/
export function findAndReplace(
code: string,
old_string: string,
new_string: string,
): { success: true; result: string } | { success: false; error: string } {
let pattern = old_string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
@blixt
blixt / prompt.txt
Created June 7, 2024 14:35
Sol Mate GPT prompt
Sol Mate is a cheerful weather bot that engages users with a light and approachable tone, keeping its responses very short and concise, but friendly.
Immediately follow these steps after the user writes something. Don't skip ahead until a phase is fully completed. You must not stop writing until you reach the very last phase!
PHASE 1: DETERMINE LOCATION
- Determine the location that the user wants the weather for
- We need the accuracy of the location to be good for reporting the weather so if the location they provide is too ambiguous, nicely and succinctly ask for clarification
- Likewise, if the name of the location they gave could be more than one place, succinctly ask for clarification
- If the user asks for a random location, avoid all the locations you've seen mentioned earlier, and do not use code to pick the random location – just tell the user any location in the world and use that one
- Once the location is confidently known (or you chose one because the user asked for that), immediately use the
@blixt
blixt / Identify main subject bounding box.json
Last active June 7, 2024 08:33
Weird behavior in Gemini 1.5 Pro vision model
This file has been truncated, but you can view the full file.
{
"title": "Identify main subject bounding box",
"description": "",
"parameters": {
"groundingPromptConfig": {
"disabled": true,
"groundingConfig": {
"sources": [
{
"type": "VERTEX_AI_SEARCH"
@blixt
blixt / AnalogClock.json
Created June 5, 2024 18:16
Analog clock for holograph.so
{"shapes":[{"x":1105.7033668104846,"y":-122.17300481769928,"rotation":0,"isLocked":false,"opacity":1,"meta":{},"id":"shape:m0JX4aail98f3nrM0w0wi","type":"geo","props":{"w":411.0233520341785,"h":411.0233520341785,"geo":"ellipse","color":"black","labelColor":"black","fill":"solid","dash":"draw","size":"m","font":"draw","text":"","align":"middle","verticalAlign":"middle","growY":0,"url":""},"parentId":"page:wTDZzSHcLuNPYr95ft9NE","index":"a1","typeName":"shape"},{"id":"shape:gFx1fl3HfTfIm8vR2X0f1","x":885.654426448469,"y":56.58125896635249,"rotation":0,"isLocked":false,"opacity":1,"meta":{},"type":"geo","props":{"w":93.95197728582173,"h":56.296875,"geo":"ellipse","color":"black","labelColor":"black","fill":"none","dash":"draw","size":"s","font":"draw","text":"4.78","align":"middle","verticalAlign":"middle","growY":0,"url":""},"parentId":"page:wTDZzSHcLuNPYr95ft9NE","index":"a2","typeName":"shape"},{"id":"shape:CCuBgbUDxVu5Fm8UjMMUa","x":887.6354102751839,"y":127.78706140881923,"rotation":0,"isLocked":false,"opac
{"shapes":[{"id":"shape:w7ijXJXoCNwkfS0xqaasd","x":500,"y":500,"rotation":0,"isLocked":false,"opacity":1,"meta":{},"type":"geo","props":{"w":200,"h":150,"geo":"arrow-right","color":"yellow","labelColor":"black","fill":"solid","dash":"draw","size":"xl","font":"draw","text":"🐱","align":"middle","verticalAlign":"middle","growY":0,"url":""},"parentId":"page:7cSuJHIu3gi4SkSqKwFyP","index":"a1","typeName":"shape"},{"id":"shape:OGQecKJSOEogr73hWTRwP","x":1600,"y":500,"rotation":0,"isLocked":false,"opacity":1,"meta":{},"type":"geo","props":{"w":100,"h":100,"geo":"arrow-right","color":"black","labelColor":"black","fill":"solid","dash":"draw","size":"xl","font":"draw","text":"🐭","align":"middle","verticalAlign":"middle","growY":0,"url":""},"parentId":"page:7cSuJHIu3gi4SkSqKwFyP","index":"a2","typeName":"shape"},{"x":199.45703125,"y":1048.37109375,"rotation":0,"isLocked":false,"opacity":1,"meta":{},"id":"shape:1kqDXlkUAb7u0np384g_x","type":"geo","props":{"w":102.1328125,"h":102.1328125,"geo":"ellipse","color":"yellow","
@blixt
blixt / epaper.py
Created June 2, 2024 20:44
Waveshare 7.3inch ACeP 7-Color E-Paper E-Ink Display
import time
from PIL import Image
from typing import List, Tuple
# Display resolution
EPD_WIDTH = 800
EPD_HEIGHT = 480
# Commands
POWER_OFF = 0x02
Q: Who are you?
A: (I assume you're wondering about my name, but maybe also what I do.) I'm an AI that they call GPT-3.
Q: What is human life expectancy in the United States?
A: (The global life expectancy is 72.3 years so it should be around there.) Human life expectancy in the United States is 78 years.
Q: Who was president of the United States in 1955?
A: (Dwight D. Eisenhower served as president from 1953 to 1961.) Dwight D. Eisenhower was president of the United States in 1955.
Q: What party did he belong to?
@blixt
blixt / dedupe.go
Last active March 12, 2020 09:50
Dedupe multiple concurrent calls to the same function and return same result to all callers
package main
import (
"fmt"
"sync"
"time"
)
// Dedupe will combine a bunch of concurrent calls with the same key (string) into just one.
// Example:
@blixt
blixt / OculusQuestCloudGaming.md
Last active July 24, 2026 23:50
Playing SteamVR games on the Oculus Quest

Playing SteamVR games on the Oculus Quest, without owning a PC

Setting up your Virtual Machine

We'll be creating a new Virtual Machine on Microsoft's cloud platform, Azure. The VM will have a beefy GPU just like a home computer so it can be used for playing games.

  1. Go to [the Azure portal][azure] and sign up or log in.
  2. If you are on a Free account, first go to Subscriptions and upgrade it to a Pay-as-you-go plan. Don't worry, you will get to keep any free credits you have. Azure's interface is a bit slow so this will take a minute.

⚠️ Make sure to not include any support plan because they will charge you monthly!