Skip to content

Instantly share code, notes, and snippets.

View jkoelker's full-sized avatar

Jason Kölker jkoelker

  • Earth, usually US Central Time
View GitHub Profile
@jkoelker
jkoelker / apply-opencode-adapter-snippet.rs
Created March 22, 2026 01:58
apply-opencode adapter selection
.iter()
.map(|path| {
path.strip_prefix(repo_dir)
.map(|value| value.display().to_string())
.with_context(|| format!("{} did not live under repo root", path.display()))
})
.collect()
}
fn apply_ticket_via_selected_adapter(
@jkoelker
jkoelker / apply-opencode-tests-snippet.rs
Created March 22, 2026 01:57
apply-opencode shim and env tests
}
#[test]
#[serial]
fn apply_ticket_with_opencode_rejects_non_doc_family_target() {
let tempdir = tempdir().unwrap();
let event = MatrixEvent {
event_id: "$runtime-opencode-reject:example.com".to_string(),
room_id: "!room:example.com".to_string(),
sender: "@alice:example.com".to_string(),
@jkoelker
jkoelker / apply-opencode-snippet.rs
Created March 22, 2026 01:57
apply-opencode bounded worker integration
fn ticket_section_value(value: &str) -> String {
value.trim().to_string()
}
fn trusted_opencode_target_family(path: &Path) -> bool {
let file_name = path
.file_name()
.and_then(|value| value.to_str())
.unwrap_or("");
let first = path
@jkoelker
jkoelker / keybase-git-gpg.sh
Created December 31, 2025 19:43
Keybase GIT signing
#!/bin/sh
# Git gpg.program wrapper for keybase pgp sign
# Usage: git config gpg.program /path/to/keybase-git-gpg.sh
set -e
debug() {
[ -n "$KEYBASE_GIT_DEBUG" ] && printf '[keybase-git-gpg] %s\n' "$*" >&2
return 0
}
@jkoelker
jkoelker / aws-ec2-spot-fleet-role
Last active August 5, 2017 01:19
Convert Cattle to Pets
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": [
"ec2:DescribeImages",
"ec2:DescribeSubnets",
"ec2:RequestSpotInstances",
"ec2:TerminateInstances",
"ec2:DescribeInstanceStatus",
#!/usr/bin/env python3
import argparse
import itertools
import maya
import icalendar
SEQUENCE = ('Total Body Cardio Fix',
@jkoelker
jkoelker / gist:3a4c517c645b498343a3337326bfa66e
Created March 9, 2017 20:46
Windows 2016 Container AWS Credentials route
$r = (Get-NetRoute | Where {$_.DestinationPrefix -eq '0.0.0.0/0'})
New-NetRoute -DestinationPrefix 169.254.169.254/32 -InterfaceIndex $r.ifIndex -NextHop $r.NextHop
@jkoelker
jkoelker / gist:e9c7cf3bb4482dbb3d5791aacd7766f0
Created March 9, 2017 18:58
Windows 2016 Docker Jenkins Slave AWS user-data
<powershell> [87/513]
Set-ExecutionPolicy Unrestricted
net user Administrator '{{ win_admin_password }}'
iwr https://chocolatey.org/install.ps1 -UseBasicParsing | iex
choco install -y jre8 git
winrm quickconfig -q
winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="2048"}'
winrm set winrm/config '@{MaxTimeoutms="1800000"}'
winrm set winrm/config/service '@{AllowUnencrypted="true"}'
winrm set winrm/config/service/auth '@{Basic="true"}'
@jkoelker
jkoelker / gaming
Last active October 17, 2025 19:34
Enable or Disable the Touchpad while typing via libinput `xinput` (aka. libinput "gaming" mode)
#!/bin/sh
#
# libinput by default will disable the touchpad while a key is pressed.
# to disable this, run `xinput` to list the inputs. find the name of your
# touchpad (mine is 'Microsoft Surface Keyboard Touchpad').
#
# Disable the setting 'Disable While Typing Enabled'
# `xinput --set-prop 'Microsoft Surface Keyboard Touchpad' \
# 'libinput Disable While Typing Enabled' 0`
#
@jkoelker
jkoelker / gist:1d7fa2d85ca342998ff7948268379102
Last active December 12, 2019 17:32
Gmail Message Dark
/*Message Background*/ .Bk, .Bu {
background: #111 !important;
}
/*Message Background*/ .Bk {
background: #111 !important;
}
.kQ .Bk .G2 {
background: #111 !important;