Skip to content

Instantly share code, notes, and snippets.

@etemiz
etemiz / nostr-app.html
Created June 21, 2026 20:10
Example html app that uses Nostr as backend and self upgrades
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>waifu-magnet</title>
<style>
:root {
--bg: #0a0a0b;
@etemiz
etemiz / url-to-torr-stream.py
Created June 17, 2026 21:21
Torrent generator from HF link
#!/usr/bin/env python3
"""url-to-torr-stream.py
=========================
Build a BitTorrent v1 `.torrent` (with webseeds) for files on HuggingFace,
without keeping a full local copy on disk.
Pull a whole repo, a subfolder, or just a handful of quant files — the
torrent's webseeds point back at HuggingFace's CDN so qBittorrent /
libtorrent / Transmission can download the content directly from HF
without any peer needing the original `.torrent`-downloaded bytes.
@etemiz
etemiz / read_strfry_db.py
Last active November 16, 2023 02:01
Read the strfry database using Python
import lmdb
lmdb_folder = '/path/to/strfry-db/'
lmdb_env = lmdb.open(lmdb_folder, max_dbs=10)
dbpl = lmdb_env.open_db(b'rasgueadb_defaultDb__EventPayload')
dbid = lmdb_env.open_db(b'rasgueadb_defaultDb__Event__id')
# read one event
with lmdb_env.begin(db=dbid) as txn:
with lmdb_env.begin(db=dbpl) as tpl: