Skip to content

Instantly share code, notes, and snippets.

View bojanrajkovic's full-sized avatar

Bojan Rajkovic bojanrajkovic

View GitHub Profile
@bojanrajkovic
bojanrajkovic / migrate.js
Created May 26, 2026 00:46
Copy Chrome localStorage entries from one origin to another (rewrites LevelDB directly)
#!/usr/bin/env node
// Copies Chrome localStorage entries from one origin to another.
// Chrome must be closed before running.
//
// Usage:
// node migrate.js <old-origin> <new-origin> [chrome-profile-path]
//
// Examples:
// node migrate.js https://old.example.com https://new.example.com
// node migrate.js https://old.example.com https://new.example.com "/path/to/Chrome/Default"
@bojanrajkovic
bojanrajkovic / atc-analytics.html
Created May 24, 2026 00:00
ATC Analytics — 3-Day Snapshot
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>ATC Analytics — 3-Day Snapshot</title>
<style>
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: Georgia, 'Times New Roman', serif;
@bojanrajkovic
bojanrajkovic / check-session-age.sh
Created April 25, 2026 02:40
Claude Code UserPromptSubmit hook: warn/block on stale prompt cache
#!/bin/bash
# UserPromptSubmit hook: block when the prompt cache is stale, warn when close.
# Anchored to the last `type: "user"` entry in the transcript — those are the
# cache-refresh events on Anthropic's side. Falls back to file mtime on parse
# failure. Fails open on any error.
set -e
INPUT=$(cat)
TRANSCRIPT=$(printf '%s' "$INPUT" | jq -r '.transcript_path // empty')
[ -z "$TRANSCRIPT" ] || [ ! -f "$TRANSCRIPT" ] && exit 0
@bojanrajkovic
bojanrajkovic / atc-playground-anon.html
Created April 17, 2026 21:44
ATC — Action Traffic Control UI Explorer (playground)
<!DOCTYPE html>
<html lang="en" data-theme="radar">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ATC — Action Traffic Control UI Explorer</title>
<style>
/* ============================================
OKLCH COLOR SYSTEM
Neutral ramp driven by --hue. Switching
@bojanrajkovic
bojanrajkovic / atc-topbar-mockups.html
Created April 15, 2026 12:16
ATC Top Bar Layout Exploration — 3 approaches with OKLCH design system
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ATC Top Bar Layout Exploration</title>
<style>
/* ATC OKLCH Design System — Radar theme (default) */
:root {
--hue: 155;
@bojanrajkovic
bojanrajkovic / research-claude-code-terminal-notifications.md
Created March 28, 2026 15:07
How Claude Code sends terminal notifications — detection chain, OSC sequences, and embedding guide (reverse-engineered from v2.1.86)
date 2026-03-28
category research
labels
claude-code
terminal
osc

How Claude Code Sends Terminal Notifications

@bojanrajkovic
bojanrajkovic / atc-playground.html
Last active March 21, 2026 21:56
ATC — Action Traffic Control UI Explorer
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ATC — Action Traffic Control UI Explorer</title>
<style>
:root {
--bg: #0a0e14;
--bg2: #131820;
@bojanrajkovic
bojanrajkovic / reanchoring-rendered-mode.html
Last active March 9, 2026 19:37
Loupe: Rendered-Mode Comment Re-Anchoring — Four Anchor States Prototype
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Loupe — Rendered-Mode Re-Anchoring States</title>
<style>
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
@bojanrajkovic
bojanrajkovic / reanchoring-states.html
Last active March 9, 2026 19:15
Loupe: Comment Re-Anchoring — Four Anchor States Prototype
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Loupe — Comment Re-Anchoring States</title>
<style>
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
@bojanrajkovic
bojanrajkovic / reanchoring.md
Created March 9, 2026 19:02
Loupe: Comment Re-Anchoring Design Doc

Comment Re-Anchoring Design

Summary

When a reviewer leaves a comment on a specific line or passage, that anchor point refers to a particular version of the file. As the author continues working — pushing new commits, rebasing, or amending — the underlying content shifts. Without re-anchoring, comments become misleading: they point to wrong lines or silently disappear. This design introduces a three-layer pipeline that keeps comments positioned correctly as branches evolve, and gives each comment a precise state describing how confident the system is in its current placement.

The pipeline works by combining two complementary techniques that no existing tool does together. Layer 1 applies git's own diff math: given the commit the comment was created against and the current HEAD, it builds a LineAdjustmentMap that translates line numbers through the diff hunks deterministically. Layer 2 verifies that the translated position still contains the expected text. If it does not, Layer 3 searches the file usi