Skip to content

Instantly share code, notes, and snippets.

View kjanat's full-sized avatar
💭
med student

Kaj Kowalski kjanat

💭
med student
  • KJANAT
  • Amsterdam
  • 06:38 (UTC +02:00)
View GitHub Profile
@kjanat
kjanat / memhogs.bash
Last active April 11, 2026 16:59
Grouped memory usage by application
#!/usr/bin/env bash
# memhogs — grouped memory usage by application
# Usage: memhogs [INTERVAL] [-w|--watch] [-k|--kill|--rescue]
# PRIORITY: rescue target must be available IMMEDIATELY.
# update_rescue runs FIRST, before flags, before anything.
# Every code path must have RESCUE_NAME set before any slow work or traps.
RESCUE_NAME=""
RESCUE_RSS=""
@kjanat
kjanat / attw.schema.json
Last active April 3, 2026 22:24
Schema for .attw.json used by @arethetypeswrong/cli
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://gist.githubusercontent.com/kjanat/46efa8c04bf3ed10c406d1965c546177/raw/attw.schema.json",
"$dynamicAnchor": "attw",
"title": "ATTW configuration",
"description": "JSON Schema for .attw.json files used by @arethetypeswrong/cli.",
"markdownDescription": "JSON Schema for `.attw.json` files used by `@arethetypeswrong/cli`.\n\nThe config file is a camelCased mapping of CLI flags. This schema is intentionally annotated for editor hover text and validation ergonomics.",
"type": "object",
"additionalProperties": false,
"$comment": "ATTW reads a JSON config file, defaulting to ./.attw.json. The CLI source rejects configPath inside the config file itself, validates profile and ignoreRules explicitly, and ignores help/version when applying config values. Examples below are instance examples, not standalone schema-bearing config files, so $schema is intentionally not repeated in each one.",
@kjanat
kjanat / cloudflared.schema.json
Last active March 5, 2026 20:48
Configuration file for cloudflared (Cloudflare Tunnel). Place at ~/.cloudflared/config.yml or /etc/cloudflared/config.yml.
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/cloudflared.json",
"$comment": "Docs: https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/do-more-with-tunnels/local-management/configuration-file/",
"title": "cloudflared configuration",
"description": "Configuration file for cloudflared (Cloudflare Tunnel). Typically placed at <code>~/.cloudflared/config.yml</code> or <code>/etc/cloudflared/config.yml</code>.\n\nDocs: https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/do-more-with-tunnels/local-management/configuration-file/",
"type": "object",
"additionalProperties": true,
"definitions": {
@kjanat
kjanat / bun_completions.ps1
Last active November 5, 2025 22:53
PowerShell argument completer for Bun's command-line interface.
<#
.SYNOPSIS
PowerShell argument completer for the Bun command-line interface.
.DESCRIPTION
This script provides tab completion for Bun commands in PowerShell.
- Completes top-level commands (e.g., 'bun add', 'bun run').
- Completes script names from 'package.json' when using 'bun run'.
.NOTES
Author: Kaj Kowalski
Version: 1.0
@kjanat
kjanat / argocd-application-schema.json
Last active February 25, 2026 03:52
Schema for ArgoCD Application Custom Resource Definition (BEWARE, AI GENERATED!!! Comment below if issues identified!) Based on: https://github.com/argoproj/argo-cd/blob/f5eaae7/docs/operator-manual/application.yaml. Refer to it using: https://gist.githubusercontent.com/kjanat/556796a0a363a338ee9453a2613cfd53/raw/argocd-application-schema.json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "ArgoCD Application",
"description": "Schema for ArgoCD Application Custom Resource Definition",
"type": "object",
"required": ["apiVersion", "kind", "metadata", "spec"],
"properties": {
"apiVersion": {
"type": "string",
"const": "argoproj.io/v1alpha1",
#!/usr/bin/env bash
# brightness.sh - DDC/CI Monitor Brightness Control Utility
#
# Intelligent monitor brightness control with sophisticated caching system.
# Supports multiple monitors, relative adjustments, and atomic cache operations.
#
# Installation:
# curl -o ~/.local/bin/brightness https://gist.github.com/kjanat/0efbcfef3026498bb9f21cd1518dd001/raw/brightness.sh
# chmod +x ~/.local/bin/brightness
@kjanat
kjanat / js_ts_manual.md
Last active July 17, 2025 01:35
JavaScript & TypeScript Beginner's Manual
@kjanat
kjanat / claude-mcp-install.md
Last active September 12, 2025 23:18
Claude Code MCP Servers | Greatest Hits

Claude Code MCP Servers | Complete Installation Guide

Official MCP documentation: docs.anthropic.com/en/docs/claude-code/mcp

This guide provides comprehensive installation instructions for MCP (Model Context Protocol) servers, enabling Claude Code to interact with external tools and services.


Prerequisites

@kjanat
kjanat / gemwrap.sh
Last active January 14, 2026 13:10
Gemini token-usage logger for interactive sessions.
#!/usr/bin/env bash
#
# !!!!!!!!!!!!!!
# SCRIPT IS BROKEN FOR NOW, NOT GOT NO TIME TO CHANGE, SORRY
# MIGHT GET UPDATED IN A MONTH OR SO... :(
# !!!!!!!!!!!!!!
#
# gemwrap: run gemini, mirror its output, and log token stats + git root.
# Can also parse existing gemini output from stdin when used with --parse-only
#