Skip to content

Instantly share code, notes, and snippets.

@nup002
nup002 / R&DLabGuide.md
Last active June 8, 2026 16:49
Setting Up a Physics and Electronics R&D Lab

Setting Up a Physics and Electronics R&D Lab

A practitioner's guide based on experience setting up and operating sensor development and characterisation labs at CERN, LBNL, DESY, and the University of Bergen.

Author: Magne Lauritzen

Contact: magne.lauritzen@summacogni.com

The majority of this guide applies to any lab doing experimental physics, electronics development, or instrumentation work. Sensor-specific sections are clearly marked.

@jph00
jph00 / solveit-ref.md
Last active July 5, 2026 11:58
Solveit reference

Solveit Reference

What is Solveit?

Solveit is a "Dialog Engineering" web application for interactive development. Unlike ChatGPT (pure chat) or Jupyter (pure code), Solveit combines three message types in one workspace: code execution, markdown notes, and AI prompts. Users build solutions incrementally, writing a few lines, understanding them, then continuing, rather than generating large code blocks.

The AI sees the full dialog context (code, outputs, notes, prompts) when responding, but only those ABOVE the current message. Users can edit any message at any time, including AI responses; the dialog is a living document, not an append-only log.

The dialog is a running ipykernel instance. A "dialog" is like a "Jupyter notebook", and uses a compatible ipynb file format, but provides a superset of functionality (in particular, "prompt messages"). A "message" is like a "Jupyter cell", with additional attributes stored as ipynb cell metadata. Most standard jupyter functionality is supported (including cel

@sergeyk
sergeyk / claude_code_prompts_and_tools.yaml
Last active June 11, 2026 06:16
Claude Code System Prompt and Tool Descriptions
model: claude-opus-4-20250514
messages:
- role: user
content:
- type: text
text: |
<system-reminder>
As you answer the user's questions, you can use the following context:
# important-instruction-reminders
Do what has been asked; nothing more, nothing less.
@dannguyen
dannguyen / README.openai-structured-output-demo.md
Last active February 25, 2026 11:22
A basic test of OpenAI's Structured Output feature against financial disclosure reports and a newspaper's police blotter. Code examples use the Python SDK and pydantic for the schema definition.

Extracting financial disclosure reports and police blotter narratives using OpenAI's Structured Output

tl;dr this demo shows how to call OpenAI's gpt-4o-mini model, provide it with URL of a screenshot of a document, and extract data that follows a schema you define. The results are pretty solid even with little effort in defining the data — and no effort doing data prep. OpenAI's API could be a cost-efficient tool for large scale data gathering projects involving public documents.

OpenAI announced Structured Outputs for its API, a feature that allows users to specify the fields and schema of extracted data, and guarantees that the JSON output will follow that specification.

For example, given a Congressional financial disclosure report, with assets defined in a table like this:

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@billwallis
billwallis / values-statement.sql
Created May 21, 2024 20:24
The SQL `VALUES` statement
/*
The SQL `VALUES` statement (in DuckDB)
DuckDB version: 0.10.2
Bill Wallis, 2024-05-21
*/
select version();
@RaczeQ
RaczeQ / pyarrow_multiprocessing_streaming.py
Last active May 19, 2024 19:41
Pyarrow Multiprocessing with streaming the result
import multiprocessing
from pathlib import Path
from queue import Queue
from time import sleep
from typing import Callable
import pyarrow as pa
import pyarrow.parquet as pq
from tqdm import tqdm
@marklit
marklit / places.sql
Last active May 19, 2024 22:43
Pull H3s for Overture's Places Dataset for May 2024
COPY (
WITH a AS (
SELECT h3_cell_to_parent(h3_string_to_h3(SUBSTR(id, 0, 17)), 2) h3_2,
COUNT(*) num_recs
FROM read_parquet('s3://overturemaps-us-west-2/release/2024-05-16-beta.0/theme=places/type=place/*.parquet',
filename=true,
hive_partitioning=1)
GROUP BY 1
)
SELECT h3_cell_to_boundary_wkt(h3_2),
@JesseCrocker
JesseCrocker / merge-pmtiles.py
Created March 29, 2024 13:19
Merge a directory of PMTiles files into a single file
#!/usr/bin/env python3
import argparse
import os
from pmtiles.reader import MmapSource, Reader, all_tiles
from pmtiles.writer import Writer
from pmtiles.tile import Compression
from pmtiles.tile import zxy_to_tileid
from tqdm import tqdm
def merge_pmtiles(input_dir: str, output_file: str) -> None:
@raydouglass
raydouglass / ffmpeg_nvidia.sh
Last active February 21, 2024 00:06
Compile ffmpeg 6.0 with NVIDIA hardware acceleration
#!/usr/bin/env bash
set -euxo pipefail
if [ "$EUID" -ne 0 ]; then
echo "Please run as root"
exit 1
fi
if ! command nvcc --version >/dev/null 2>&1; then