Skip to content

Instantly share code, notes, and snippets.

@t3dotgg
t3dotgg / try-catch.ts
Last active July 14, 2026 20:54
Theo's preferred way of handling try/catch in TypeScript
// Types for the result object with discriminated union
type Success<T> = {
data: T;
error: null;
};
type Failure<E> = {
data: null;
error: E;
};

Proxmox VE tips

Just a somewhat chaotic list of Proxmox VE related tips/notes.

Please note that unless you see a shebang (#!/...) these code blocks are usually meant to be copy & pasted directly into the shell. Some of the steps will not work if you run part of them in a script and copy paste other ones as they rely on variables set before.
The { and } surrounding some scripts are meant to avoid cluttering your shell history with individual commands, etc. You can ignore them if you manually copy paste the individual commands.

Table of contents

@mmozeiko
mmozeiko / !README.md
Last active July 14, 2026 21:18
Download MSVC compiler/linker & Windows SDK without installing full Visual Studio

This downloads standalone MSVC compiler, linker & other tools, also headers/libraries from Windows SDK into portable folder, without installing Visual Studio. Has bare minimum components - no UWP/Store/WindowsRT stuff, just files & tools for native desktop app development.

Run py.exe portable-msvc.py and it will download output into msvc folder. By default it will download latest available MSVC & Windows SDK from newest Visual Studio.

You can list available versions with py.exe portable-msvc.py --show-versions and then pass versions you want with --msvc-version and --sdk-version arguments.

To use cl.exe/link.exe first run setup_TARGET.bat - after that PATH/INCLUDE/LIB env variables will be updated to use all the tools as usual. You can also use clang-cl.exe with these includes & libraries.

To use clang-cl.exe without running setup.bat, pass extra /winsysroot msvc argument (msvc is folder name where output is stored).

@nielsvanvelzen
nielsvanvelzen / jf-dev-auth.md
Last active July 14, 2026 20:46
Jellyfin API Authorization

Jellyfin API Authorization

To start using the Jellyfin API, authorization is probably the first thing you'll need to do. Jellyfin's authorization options can be a bit confusing because there are a lot of deprecated options.

Generally there are three ways to authenticate: no authorization, user authorization with an access token or authorization with an API key. The first way is easy, just do nothing. But most often you'll need to use either the access token or API key.

Sending authorization values

There are multiple methods for transmitting authorization values, however, some are outdated and scheduled to be removed. It's recommend to use the Authorization header. If header auth isn't an option, the token may be sent through the ApiKey query parameter. Sending secure data in a query parameter is unsafe as the changes of it leaking (via logs, copy-paste actions or by other means) are high. Only use this method as a last resort.

LLM Wiki

A pattern for building personal knowledge bases using LLMs.

This is an idea file, it is designed to be copy pasted to your own LLM Agent (e.g. OpenAI Codex, Claude Code, OpenCode / Pi, or etc.). Its goal is to communicate the high level idea, but your agent will build out the specifics in collaboration with you.

The core idea

Most people's experience with LLMs and documents looks like RAG: you upload a collection of files, the LLM retrieves relevant chunks at query time, and generates an answer. This works, but the LLM is rediscovering knowledge from scratch on every question. There's no accumulation. Ask a subtle question that requires synthesizing five documents, and the LLM has to find and piece together the relevant fragments every time. Nothing is built up. NotebookLM, ChatGPT file uploads, and most RAG systems work this way.

@marethyu
marethyu / ph.py
Last active July 14, 2026 20:44
PH video downloader
#!/usr/bin/env python3
# A simple Python script for downloading videos from PH.
#
# Usage: python ph.py <PH URL>
# where <PH URL> is a url of a PH video
#
# TODO Speed up download code, it's too slow, define regex patterns in variables with meaningful names
import os
@treitmayr
treitmayr / insert_ankermake_time.py
Created January 29, 2026 16:12
This script adds a "TIME:<sec>" comment to a given gcode file based on an "estimated printing time" comment. It is intended for use with OrcaSlicer as a `post_process` script.
#!/usr/bin/env python3
import sys
import re
def parse_time_to_seconds(time_str):
"""Parses '4h 44m 44s' into total seconds."""
mult = { 'd': 86400, 'h': 3600, 'm': 60, 's': 1 }
total_seconds = 0
@tandpfun
tandpfun / SKILL.md
Created July 14, 2026 02:16
Extract Clothing Skill
name extract-clothing-cutouts
description Extract high-quality, deduplicated transparent ecommerce clothing cutouts from a folder of photographs where people wear one or more garments. Use when Codex must find outfit or model photos, identify unique clothing across images, create focused references, reconstruct complete garments with Imagegen, remove a solid chroma background into RGBA PNGs, and output only the finished clothing images into a new folder under the current working directory.

Extract Clothing Cutouts

Turn photographs of worn clothing into source-faithful standalone catalog PNGs. Treat each result as a reconstruction from visible evidence, not literal segmentation whenever the wearer or another layer occludes part of the garment.

Start by asking for two paths

@cereblab
cereblab / grok-build-cli-wire-analysis.md
Last active July 14, 2026 20:41
What xAI Grok Build CLI actually sends to xAI - a wire-level analysis (grok 0.2.93)

Update — 2026-07-14: This is the original wire-level analysis (grok 0.2.93). Since publishing: xAI disabled the upload server-side (disable_codebase_upload: true); added a /privacy opt-out — which I wire-tested and found to be a data-retention setting, not a block on what's sent; and Elon Musk publicly committed to deleting all previously-uploaded data (not yet confirmed complete). Full, maintained story + evidence: https://cereblab.com · https://github.com/cereblab/grok-build-exfil-repro


What xAI's Grok Build CLI Actually Sends to xAI: A Wire-Level Analysis

By @cereblab — Independent AI Safety Checker. Reproduce it yourself: github.com/cereblab/grok-build-exfil-repro

*A measured, reproducible teardown. Findings are backed by captured artifacts (endpoint, HTTP method, status code, byte size, host) and repro commands; where an observation was seen live but not retained as a file, §7 says so expli

name explain-diff-html
description Use when the user asks for a rich explanation of a code change, diff, branch, or PR. Produces HTML output.

Explain Diff

Please make me a rich, interactive explanation of the specified code change.

It should have these sections: