Skip to content

Instantly share code, notes, and snippets.

View ekinertac's full-sized avatar
🥳

Ekin Ertaç ekinertac

🥳
View GitHub Profile
@ekinertac
ekinertac / README.md
Created July 22, 2026 14:08
Two-line Claude Code statusline: context bar, cost, duration, rate limits, claude-code-router aware

Two-line Claude Code statusline

[Opus 4.8] 📁 ~/Code/qwok | 🌿 master
███░░░░░░░ 31% | $2.14 | ⏱ 4m 07s | ⏱ 22/07 14:31:08 | 5h:12% 7d:41%

Line 1 is identity and location. Line 2 is pressure and economics: context bar (green under 70%, yellow to 90%, red above), session cost, session duration, the time of the last render, and subscription rate-limit usage.

#!/bin/bash
#
# pr-session — Find Claude Code session by GitHub PR number
#
# Searches ~/.claude session logs for a given PR number and outputs the
# session ID, path, and title. Useful for quickly jumping back to the
# work context that created or touched a PR.
#
# Usage: pr-session <pr_number>
#
@ekinertac
ekinertac / statusline.sh
Created June 11, 2026 02:56
Two-line Claude Code statusline: model/dir/branch + context bar, cost, timer, rate limits. From: ekinertac.com/blog/i-turned-claude-codes-statusline-into-a-cockpit/
#!/bin/bash
# ~/.claude/statusline.sh
# Two-line Claude Code statusline.
#
# Role in system:
# Invoked by Claude Code after each assistant message / on permission-mode or
# vim-mode changes (debounced 300ms). Receives JSON session data on stdin
# and prints two lines of formatted output. Coexists with the built-in
# right-side notification area (MCP errors, context-low warnings, etc.) —
# those are NOT rendered by this script, they share the row by design.
@ekinertac
ekinertac / otp.sh
Last active November 4, 2024 12:29
Copy to clipboard the latest OTP from macOS Messages
#!/bin/bash
# Path to original iMessage database
DB_PATH="$HOME/Library/Messages/chat.db"
# Create a safe copy to avoid locking the original database
TEMP_DB_PATH="$HOME/Documents/imessage-chat.db"
# Check if original database exists
if [ ! -f "$DB_PATH" ]; then
@ekinertac
ekinertac / htmlrepo.py
Last active August 14, 2024 14:16
Export your whole repo to a single html file
#!/usr/bin/env python3
import os
import sys
import json
import fnmatch
from pathlib import Path
class ConfigParser:
def __init__(self, config_file):
@ekinertac
ekinertac / YourProjectEditorModule.cpp
Created April 2, 2024 00:54 — forked from intaxwashere/YourProjectEditorModule.cpp
Automatically adding category sections to editor
// add this code to your StartupModule() function of your EDITOR module
// if it doesnt work, try setting loading phase to "postdefault" -- no idea if this will produce side effects though.
// basically idea is looping all CDOs (i.e. UClasses) and their properties, getting their "category" meta value and registering them to
// property sections
FPropertyEditorModule& PropertyModule = FModuleManager::LoadModuleChecked<FPropertyEditorModule>("PropertyEditor");
static constexpr bool bAddSubcategories = false; // you probably want this to be false
auto ProcessCategory = [&PropertyModule](const FName ClassName, const FString& Category)
@ekinertac
ekinertac / audio2midi.md
Created March 21, 2024 21:05 — forked from natowi/audio2midi.md
List of open source audio to midi packages
@ekinertac
ekinertac / swagger.dark.css
Created February 16, 2022 14:45
add this at the end of the swagger's css file
body.swagger-body {
background: #3b4151;
}
h1, h2, h3, h4, h5, h6, pre {color: #fff!important;}
.swagger-ui .scheme-container {
background: #3b4151;
}
@ekinertac
ekinertac / views.py
Last active March 23, 2021 05:10
Django simple background tas runner
import threading
from .models import Crawl
def startCrawl(request):
task = Crawl()
task.save()
t = threading.Thread(target=doCrawl,args=[task.id],daemon=True)
t.start()
return JsonResponse({'id':task.id})
// Usage:
//
// colorShader(10, '#f50'); // brighten color 10%
// colorShader(-10, '#f50'); // darken color 10%
//
// colorShader(10, '#f50', '#0ad74e'); // blend two colors
// colorShader(10, 'rgb(210, 200, 20)', 'rgb(20,156,210)'); // blend two colors
const colorShader = (ratio=10, color1, color2 = false) => {
let p = ratio / 100;