Skip to content

Instantly share code, notes, and snippets.

@nubskr
nubskr / web_crawler_gist.zig
Created June 25, 2026 10:06
Code reference to web crawler video
const std = @import("std");
const Io = std.Io;
const stats_path = "crawl.stats";
const Job = struct { url: []const u8, depth: usize };
const State = struct {
io: Io,
gpa: std.mem.Allocator,

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.

@timvieira
timvieira / simple-backprop.py
Last active June 28, 2026 22:12
Simple example of manually performing "automatic" differentiation.
"""
Simple example of manually performing "automatic" differentiation
"""
import numpy as np
from numpy import exp, sin, cos
def f(x, with_grad=False):
# Need to cache intermediates from forward pass (might not use all of them).
a = exp(x)
@atoponce
atoponce / peres.js
Created July 31, 2025 17:16
Peres randomness extractor
/**
* Peres extractor as described in http://dx.doi.org/10.1214/aos/1176348543
* @param {Array} bits - an array of biased bits to debias
* @param {Array} extracted - an array of extracted, unbiased bits
* @returns {Array} - an array of exatracted, unbiased bits
*/
function peres(bits, extracted) {
const u = []; // discarded bits Psi(u1, u2, u3, ...)
const v = []; // discarded bits Psi(v1, v2, v3, ...)
const l = bits.length - (bits.length & 1); // ensure an even length, dropping the last bit if odd
@EdenQwQ
EdenQwQ / smart-tile.py
Last active June 28, 2026 22:06
Mosaic tiling for hyprland. Tile floating windows in an intelligent manner
import subprocess
import os
import operator
import argparse
from json import loads
class Position:
def __init__(self, x, y):
self.x = x
self.y = y
@GregTonoski
GregTonoski / Bitcoin_WIF_into_hex.bash
Last active June 28, 2026 22:05
Convert from Bitcoin Wallet Import Format (WIF) to hexadicimal number (HEX)
#!/bin/bash
# Bitcoin_WIF_into_hex.bash: convert from Bitcoin Wallet Import Format (WIF) to hexadicimal number (HEX)
# Examples:
# $ bash Bitcoin_WIF_into_hex.bash "L3wB8ytuxNS3SPX2CJnHqK48Zzqj1AnayDTrJomvNPDxuKvHyvpT" > private_key_bitcoin.hex
# $ bash Bitcoin_WIF_into_hex.bash "xprv9s21ZrQH143K31xYSDQpPDxsXRTUcvj2iNHm5NUtrGiGG5e2DtALGdso3pGz6ssrdK4PFmM8NSpSBHNqPqm55Qn3LqFtT2emdEXVYsCzC2U"
# $ zsh Bitcoin_WIF_into_hex.bash $(< private_key_bitcoin.wif )
declare INPUT_STRING_WIF="$1"
declare -i -r FROM_BASE=58
@GregTonoski
GregTonoski / private_key_into_bitcoin_wif.sh
Last active June 28, 2026 22:05
Convert secp256k1 private key in hexadicimal number (HEX) to Bitcoin Wallet Import Format (WIF)
#!/bin/bash
# private_key_into_bitcoin_wif.sh: convert secp256k1 private key in hexadicimal number (HEX) to Bitcoin Wallet Import Format (WIF)
# Examples:
# $ bash private_key_into_bitcoin_wif.sh "000ffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364139" > private_key_bitcoin.wif
# $ bash private_key_into_bitcoin_wif.sh $(< input_file.txt) > private_key_bitcoin.wif
# $ cat priv_key.txt | xargs bash private_key_into_bitcoin_wif.sh > private_key_bitcoin.wif
# $ bash private_key_into_bitcoin_wif.sh fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364139 | echo "$(cat) importedkeylabel false" | xargs bitcoin-cli importprivkey && bitcoin-cli getaddressesbylabel importedkeylabel
# $ openssl rand -hex 32 | xargs bash private_key_into_bitcoin_wif.sh
# $ xxd -l 32 -p -c 32 /dev/random | xargs bash private_key_into_bitcoin_wif.sh
@dianariyanto
dianariyanto / debloat_oppo_a3s.log
Last active June 28, 2026 22:02
Debloat OPPO A3S - Hapus Aplikasi Sampah Di HP OPPO A3S
╭─aryan@lenovo ~
╰─$ adb devices
List of devices attached
9267ed9b device
╭─aryan@lenovo ~
╰─$ adb shell
CPH1803:/ $ pm list packages
package:com.coloros.backuprestore
package:com.android.cts.priv.ctsshim
@fofr
fofr / SKILL.md
Last active June 28, 2026 22:00
An agent skill for writing in the GOV.UK style
name govuk-style
description Write and edit in GOV.UK / GDS house style — plain English, active voice, front-loaded content, sentence case, and no bold or italics for emphasis. Use when writing or editing reports, research write-ups, guidance, documentation, summaries, or any prose where clarity and accessibility matter.
user-invokable true
args
name description required
target
The document or text to write or rewrite in GOV.UK style (optional)
false