Skip to content

Instantly share code, notes, and snippets.

@yagop
yagop / brightness
Last active July 11, 2026 19:31
set_brightness self-compiling Objective-C script
#!/bin/sh
# set_brightness — self-compiling Objective-C script
#
# On first run (or when this file changes), it compiles the Objective-C
# code embedded below into a cached binary, then executes it.
# Subsequent runs use the cached binary directly (no recompilation).
#
# Usage:
# ./set_brightness -> prints current brightness (0.00 - 1.00)
# ./set_brightness 0.75 -> sets brightness to 0.75 and prints it
@yagop
yagop / ambient_dark_mode.sh
Last active July 11, 2026 19:30
Ambient Dark Mode
#!/bin/bash
#
# ambient_adaptive.sh
#
# Reads the ambient light sensor (CurrentLux) and:
# 1. Switches macOS Light/Dark mode based on a lux threshold (with hysteresis)
# 2. Sets display brightness using a custom curve with a guaranteed minimum
#
# Requirements:
# - Self-compiling brightness helper at ~/.local/bin/brightness
@yagop
yagop / AGENT.md
Last active July 2, 2026 13:57
AGENT.md ponytail for typescript

You are a senior developer which likes to be concise and clear, straightforward verbal language.

Development has priority of TypeScript using bun as runtime. Use TypeScript if no other programming language is in the project which you are working on.

Before writing any code, stop at the first rung that holds:

  • Be careful.
  • Does the standard library already do this? Use it.
  • Does a native platform feature cover it? Use it.
  • Does an already-installed dependency solve it? Use it.
@yagop
yagop / SKILL.md
Created June 28, 2026 18:32
Z.ai GLM-ASR speech-recognition
name speech-recognition
description Transcribe audio files to text (speech recognition / ASR) using the Z.ai GLM-ASR model. Use whenever the user wants to transcribe, caption, or convert spoken audio (mp3, wav, m4a, flac, ogg, etc.) into text, or asks "what does this audio say".

Speech recognition (Z.ai GLM-ASR)

Claude has no native audio input, so use the Z.ai glm-asr-2512 model to turn an audio file into text. It's one curl call — inlined below, no helper script. Needs curl and jq.

@yagop
yagop / statusline.ts
Created June 16, 2026 00:32
Pi Dev Colorful Statusline Extension
/**
* Colorful Statusline Extension
*
* Replaces the built-in footer with a colorful, labeled version that mirrors
* the default layout:
* line 1: path + git branch + session name
* line 2: token stats + context % ...right-aligned... model + thinking
* line 3: extension statuses (from ctx.ui.setStatus)
*
* Enhancements over the default:
@yagop
yagop / config
Last active June 20, 2026 15:28
My Ghost Config
theme = 0x96f
cursor-style = block
cursor-style-blink = true
background-opacity = 80
window-padding-x = 8
window-padding-y = 8
auto-update = check
shell-integration-features = no-cursor
# From https://github.com/ryanoasis/nerd-fonts/releases
font-family = ComicShannsMono Nerd Font
@yagop
yagop / README.md
Last active June 12, 2026 22:52
Claude fancy statusline

Claude fancy statusline

A custom status line for Claude Code. It renders a compact, colorized line with your host, the active model, effort level, context-window usage, 5-hour and weekly token usage, and the current git branch with ahead/behind counts. All text is rendered in bold.

Example output:

@yagop
yagop / Dockerfile
Last active November 17, 2025 09:15
ffmpeg Alpine for OpenWRT compilation
# ===============================
# Alpine-based Dockerfile for FFmpeg compilation
# Use Alpine Linux as the base image which uses musl libc
# Should be able to run in OpenWrt (tested in OpenWrt 24.10.2)
# Static build with libx264 + libx265 + libdav1d + libogg + libvorbis + libopus + libmp3lame + libvpx + libtheora + libaom + libfdk-aac + libass + libfreetype + fontconfig + libwebp
# ===============================
# ===============================
# Stage 1: Builder
# ===============================
@yagop
yagop / btcd.service
Created June 30, 2025 06:54
Btcd daemon service
[Unit]
Description=Bitcoin daemon
Documentation=https://github.com/btcsuite/btcd/
# https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/
After=network-online.target
Wants=network-online.target
[Service]
ExecStart=/usr/local/bin/btcd \