Skip to content

Instantly share code, notes, and snippets.

View shntnu's full-sized avatar

Shantanu Singh shntnu

View GitHub Profile
@shntnu
shntnu / setting-up-a-mac-with-claude.md
Created November 4, 2026 16:26
Setting up a replacement Mac with Claude Code and Nix

Setting up a replacement Mac with Claude Code and Nix

A replacement laptop can be set up remotely when you already have a working Mac with a Nix configuration and can connect to the new machine over SSH. In this example, Claude Code ran on the existing Mac, adapted the configuration for a loaner, built the system, and deployed it to the loaner. The owner enabled access, entered passwords, and signed in to services on the laptop.

The existing setup used nix-darwin for macOS settings, Home Manager for user packages and shell configuration, Homebrew for GUI apps, and chezmoi for additional dotfiles. It also had a deploy-rs configuration for remote deployment. The procedure below describes that setup, with placeholders and adjustments for other repositories. It assumes you have permission to administer the new machine and an existing, working configuration to adapt.

@shntnu
shntnu / cs_logo.py
Last active June 14, 2026 20:21
Carpenter-Singh Lab GitHub org logo, generated from a real Cell Painting morphological profile (2025_Kalinin_mAP). Run: uv run <raw-url>
# /// script
# requires-python = ">=3.10"
# dependencies = ["pandas", "pyarrow", "matplotlib"]
# ///
"""Generate the Carpenter-Singh Lab GitHub org logo from Cell Painting data.
This is a data-derived visual mark, not a full phenotypic-profile analysis. It
uses one matching well/profile for the requested compound (the first row with
that perturbation name), not an aggregate across replicate plates.
@shntnu
shntnu / dataset_reference.py
Last active June 12, 2026 13:27
JUMP dataset reference - self-contained marimo (PEP 723) viewer of the public S3 datastore
# /// script
# requires-python = ">=3.12"
# dependencies = [
# "marimo",
# "polars",
# "pyyaml",
# "snakemake>=9.14.6,<10",
# "python-dotenv",
# "loguru",
# "cloudpathlib[s3]",
@shntnu
shntnu / simplest_agent_notebook.py
Created May 15, 2026 21:12
Simplest agent loop, unrolled in a marimo notebook. Run: uvx marimo edit <url>
# /// script
# requires-python = ">=3.10"
# dependencies = ["marimo", "ollama"]
# ///
import marimo
__generated_with = "0.20.4"
app = marimo.App(width="medium")
@shntnu
shntnu / sample_output.txt
Last active May 15, 2026 21:21
Simplest possible agent: LLM-in-a-loop with one bash tool, via Ollama. Run: uv run https://...
═══ TURN 1 ═══
→ sending 2 messages to qwen2.5:7b
[0] system 'You are an agent with a bash tool. Always use the bash tool to gather informatio'
[1] user 'How many files are in /tmp? Run a command to find out.'
← assistant wants to call 1 tool(s):
• bash({'cmd': 'ls -1 /tmp | wc -l'})
▶ running: ls -1 /tmp | wc -l
◀ stdout (3 bytes):
'60\n'
@shntnu
shntnu / 2026-05-06__embl__apprentices.md
Created May 6, 2026 14:02
Apprentices - EMBL talk (Huber group), 6 May 2026
marp true
theme default
paginate true

Apprentices

Shantanu Singh Sr. Group Leader, Broad Institute

@shntnu
shntnu / compoundvalet_identifier_gap.sql
Last active February 17, 2026 02:28
CompoundValet CSV identifier gap analysis — run in https://shell.duckdb.org/
-- CompoundValet CSV: no structural identifiers → can't join to other databases
-- Paste into https://shell.duckdb.org/
--
-- The Drug Repurposing Hub is a similar drug-target database but includes
-- InChIKey, SMILES, and PubChem CID — making it instantly joinable.
-- CompoundValet has only drug names.
-- Load CompoundValet
CREATE TABLE cv AS
SELECT * FROM read_csv_auto(
@shntnu
shntnu / compute_etag.sh
Created July 25, 2022 18:51 — forked from rajivnarayan/compute_etag.sh
Calculate checksum corresponding to the entity-tag hash (ETag) of Amazon S3 objects
#!/bin/bash
#
# Calculate checksum corresponding to the entity-tag hash (ETag) of Amazon S3 objects
#
# Usage: compute_etag.sh <filename> <part_size_mb>
#
# filename: file to process
# part_size_mb: chunk size in MiB used for multipart uploads.
# This is 8M by default for the AWS CLI See:
# https://docs.aws.amazon.com/cli/latest/topic/s3-config.html#multipart_chunksize