Skip to content

Instantly share code, notes, and snippets.

@cameroncking
cameroncking / log-system-prompts.js
Created February 12, 2026 06:50
Easily debug OpenCode system prompts
// .opencode/plugins/log-system-prompts.js
// log system prompts to .opencode/system-prompts.jsonl
//
// This makes it easier to directly investigate how OpenCode constructs
// system prompts and what environment data is being provided to the model.
// This does not include tool call schema information.
//
import fs from "fs/promises"
import path from "path"
@cameroncking
cameroncking / request-instructions.js
Last active February 13, 2026 04:46
OpenCode plugin to provide custom request instructions
// .opencode/plugins/request-instructions.js
// replaces requestInstructions (model-specific coding instructions) with
// the contents of .opencode/REQUEST_INSTRUCTIONS.md
//
// When using OpenCode for non-coding tasks (such as creative writing or
// knowledge management), this reduces coding-related context poisoning
// when paired with a general purpose prompt.
//
import fs from "fs/promises"
import path from "path"
"""Tools for memory management and utilities."""
import os
import urllib.request
import urllib.parse
import json
import datetime
import zoneinfo
#!/bin/bash
set -e
# Parse repository URL and extract username/reponame
parse_repo_info() {
local url="$1"
# Handle git@github.com:username/repo.git format
if [[ "$url" =~ ^git@github\.com:(.*)\.git$ ]]; then
#!/usr/bin/perl -wT
use strict;
use warnings;
%ENV = ();
$ENV{'PATH'} = '/bin:/usr/bin';
sub untaintfp {
my $keyfp = shift or die "untaintfp missing parameter: keyfp\n";
my $utkeyfp = '';
@cameroncking
cameroncking / code.py
Last active January 9, 2023 05:17
QtPy Keyboard
import board
import neopixel
import touchio
from time import sleep
import usb_hid
from adafruit_hid.keyboard import Keyboard
from adafruit_hid.keycode import Keycode
# pin that the NeoPixel is connected to
PIXEL_PIN: Pin = board.NEOPIXEL
@cameroncking
cameroncking / markdown-cli.go
Last active May 31, 2022 21:21
golang markdown-cli
package main
import (
"io/ioutil"
"bytes"
"fmt"
"os"
"github.com/yuin/goldmark"
"github.com/yuin/goldmark/extension"
"github.com/yuin/goldmark/parser"
"github.com/yuin/goldmark/renderer/html"
@cameroncking
cameroncking / minecraft
Last active May 31, 2022 21:22
minecraft rc file (freebsd)
#!/bin/sh
# from https://minecraft.fandom.com/wiki/Tutorials/FreeBSD_startup_script
#
# PROVIDE: minecraft
# REQUIRE: LOGIN DAEMON NETWORKING mountcritlocal
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf.local to enable the minecraft server:
#
# minecraft_enable="YES"
import turtle
print("Hello World.")
t = turtle.Turtle()
t.color('white')
t.left(90)
t.forward(100)
t.left(270)
#!/usr/bin/perl
#$Id$
use strict;
use warnings;
my $VERSION=1.000;
=head1 NAME
check_port80.pl