Skip to content

Instantly share code, notes, and snippets.

View kornysietsma's full-sized avatar

Korny Sietsma kornysietsma

View GitHub Profile
@kornysietsma
kornysietsma / SKILL.md
Created February 7, 2026 21:08
Obsidian skill for LLMs
name description
obsidian-markdown
Guide for reading and writing Obsidian markdown files. This skill should be used when working with Obsidian vaults, creating or editing notes for Obsidian, or when the user mentions Obsidian markdown syntax. Covers wikilinks, embeds, callouts, tags, front matter, and other Obsidian-specific extensions to standard markdown.

Obsidian Markdown Guide

This skill provides guidance for reading and writing markdown files compatible with Obsidian.

Front Matter Convention

@kornysietsma
kornysietsma / view-image.py
Created February 3, 2026 08:27
Using a trivial MCP server to bypass Github Copilot's inability to view images
#!/usr/bin/env -S uv run --script
# /// script
# dependencies = [
# "mcp>=1.0.0",
# "pillow>=10.0.0",
# ]
# requires-python = ">=3.12"
# ///
"""
@kornysietsma
kornysietsma / sort_games.py
Created December 23, 2025 19:24
Claude generated script to sort a markdown file
#!/usr/bin/env -S uv run --script
# /// script
# dependencies = []
# requires-python = ">=3.12"
# ///
import re
from pathlib import Path
@kornysietsma
kornysietsma / statusline.py
Created December 14, 2025 07:46
Claude Code statusline with context
#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.10"
# ///
"""
Claude Code statusline script
Shows: directory | git:branch ±changes | model | ctx:XX%
Context percentage uses the most recent API response's usage (resets on /clear)
"""
@kornysietsma
kornysietsma / basic-mermaid.md
Created October 9, 2025 18:19
Snippets for my Agent Mermaid blog post

Mermaid.js Guide for Claude Code

This is an advanced guide to building mermaid diagrams

My prefrences

  • I like light backgrounds, so any text displayed on the background should be black or dark
  • For text on shapes, you should make sure that either you use light text on a dark shape, or dark text on a light shape.

Quick Reference

@kornysietsma
kornysietsma / update_repos.sh
Created August 5, 2024 12:22
simple script to update all git repos in child directories
#!/bin/bash -e
RED='\033[0;31m'
GREEN='\033[0;33m'
NC='\033[0m'
for dir in */; do
echo "processing $dir"
cd "$dir" || continue
@kornysietsma
kornysietsma / fetch_org_repos.rb
Created November 14, 2022 12:38
script to clone all repos for an organisation
#!/usr/bin/env ruby
require "graphql/client"
require "graphql/client/http"
require "json"
require 'set'
require 'pp'
MAX_PAGES = 999
const fooMembers = new Set([1,2]);
const barMembers = new Set([1,3]);
const groups: Map<Set<number>, String> = new Map();
groups.set(fooMembers,"foo");
groups.set(barMembers,"bar");
console.log(groups.get(fooMembers));
console.log(groups.get(new Set([1,2])));
#![forbid(unsafe_code)]
#![warn(clippy::all)]
#![warn(rust_2018_idioms)]
pub mod mymodule;
use std::ffi::OsString;
use std::fs;
use std::path::Path;
use std::path::PathBuf;
use std::process::Command;
@kornysietsma
kornysietsma / main.rs
Created September 7, 2019 18:17
byte regex fail
use regex::bytes::Regex;
fn main() {
let re = Regex::new(r"^(.*)$").unwrap();
let line: Vec<u8> = vec![
46, 45, 191, 87, 110, 176, 108, 158, 46, 45, 191, 87, 110, 176, 108, 158,
];
let s = std::str::from_utf8(&line);
if s.is_err() {
println!("Error in converting from utf8:{:?}", s);