Skip to content

Instantly share code, notes, and snippets.

@OhadRubin
OhadRubin / cache_survey.md
Created April 20, 2026 09:28
A survey of caching stances across reference systems

A survey of caching stances across reference systems

Nine entries, each from a different family. Close cousins are collapsed: React Query stands in for SWR and Relay, Nix stands in for Bazel and Buck, Dagster stands in for Luigi and Prefect and Airflow. Content-addressed storage (Git, OCI, IPFS) is folded into Nix because for a subsystem designer it's the derivation stance that's instructive; pure object dedup is a weaker commitment.


1. Spark — lineage-based recovery with opt-in materialization (also Flink, Beam)

What you reach for: df.cache() or df.persist(StorageLevel.MEMORY_AND_DISK).

@OhadRubin
OhadRubin / v3_replication_status.md
Created April 16, 2026 06:22
V3 Replication Status: BN vs Direct IC Comparison

V3 Replication Status: BN vs Direct IC Comparison

What Exists in v3

PICon Evaluation Infrastructure — FULLY PRESENT

  • picon_env_v3.py: Complete PICon Internal Consistency environment.
    • PICONInternalConsistencyEnv class extending ChatEnv (multi-turn adversarial interrogation)
    • Questioner system prompt (AVH Forensic Interrogator style)
    • Internal consistency evaluator system prompt (conflict vs plausible per turn)
    • score_transcript() with parallel conflict judging via asyncio.gather
@OhadRubin
OhadRubin / tpu_inference_pr_1486.patch
Created March 12, 2026 18:46
PR 1486: prompt_logprobs support for TPU
From 848d3f5d4c2aa5bee58eecad8421b5947ec79334 Mon Sep 17 00:00:00 2001
From: catswe <212922539+catswe@users.noreply.github.com>
Date: Sat, 17 Jan 2026 18:36:09 -0600
Subject: [PATCH 1/9] Add prompt_logprobs
Signed-off-by: catswe <212922539+catswe@users.noreply.github.com>
---
tpu_inference/runner/tpu_runner.py | 101 +++++++++++++++++++++++++++--
1 file changed, 94 insertions(+), 7 deletions(-)
@OhadRubin
OhadRubin / improve_prompt.py
Created February 11, 2026 19:34
improve_prompt.py
# /// script
# dependencies = [
# "claude-agent-sdk",
# ]
# ///
from claude_agent_sdk import (
ClaudeSDKClient,
ClaudeAgentOptions,
AssistantMessage,
@OhadRubin
OhadRubin / persistent_agent.py
Created January 29, 2026 15:00
Persistent lunch reminder agent using Claude Agent SDK + Slack
# /// script
# requires-python = ">=3.12"
# dependencies = [
# "slack-bolt",
# "slack-sdk",
# "claude-agent-sdk",
# "aiohttp",
# "tqdm",
# ]
# ///
@OhadRubin
OhadRubin / howto_save_running_process.md
Created January 4, 2026 11:08
HOWTO: Save a Running Process You Forgot to Start in tmux

HOWTO: Save a Running Process You Forgot to Start in tmux

You started a long-running job and forgot to use tmux. Now you're stuck. Here's how to save it.

Option 1: Detach with disown (simplest, lose output)

# In the terminal where the process is running:
Ctrl+Z              # Suspend the process
bg # Resume in background
@OhadRubin
OhadRubin / json_scripts.sh
Created January 4, 2026 08:18
Bash function for JSON templating with environment variable substitution
#!/usr/bin/env bash
json_template_to_canon() {
# stdin: template with ${VARS}; output: canonical (minified) json
# Substitutes environment variables in a JSON template.
#
# NOTE: Variables MUST be exported (not just set) for this to work.
# NOTE: Unset variables are left as-is (safe_substitute behavior).
#
# Example 1 - single line:
@OhadRubin
OhadRubin / ast-grep-delete.py
Created December 17, 2025 05:41
ast-grep-delete.py
# /// script
# dependencies = [
# "ast-grep-py",
# ]
# ///
import sys
from pathlib import Path
from ast_grep_py import SgRoot
@OhadRubin
OhadRubin / md2drive
Created October 17, 2025 04:25
md2drive - convert markdown file to docx and upload it to google drive
#!/usr/bin/env bash
set -euo pipefail
# gcloud auth login --enable-gdrive-access
# Usage: ./md2drive <markdown_file>
# Example: ./md2drive example.md
# Requires: export FOLDER_ID=<your_google_drive_folder_id>
MD_FILE="${1:?usage: $0 path/to/file.md}"
# Check if markdown file exists
@OhadRubin
OhadRubin / explain_code.md
Created July 3, 2025 08:09
explain_code.md

Create a documentation file that explains code in natural language:

Part 1: Read the input file {filename} and create a new markdown file at docs/{filename}.md

Part 2: Create an initial todo list (let's call it list A) of functions/sections to document, give an complexity rating to each task.

Part 3: Group simple items together into single tasks.

  • This will ensure tasks have similar complexity levels.
  • Each item should require a similar amount of time to "think about"
  • This will result in list B that has a uniform level of complexity for each item.