Selected work
Lavori selezionati
Projects
Progetti
Personal projects across developer tooling, key-value storage, emulation, geospatial models and API clients. Filter by technology.
Progetti personali tra tooling per sviluppatori, storage key-value, emulazione, modelli geospaziali e client API. Filtra per tecnologia.
MCP SERVER + DESKTOP APP
Baton · handoff-mcp
Lets a coding agent hand a manual step, such as creating an OAuth app, to the user. The MCP server (TypeScript) holds the tool call open and drives Baton (Rust, Tauri 2) via JSON-RPC over a local named pipe until the outcome returns.
Permette a un agente di coding di passare all'utente un passo manuale, come creare un'app OAuth. Il server MCP (TypeScript) tiene aperta la tool call e pilota Baton (Rust, Tauri 2) via JSON-RPC su named pipe locale finché non torna l'esito.
- Heartbeat ahead of each agent's tool timeout, resumable calls, state transitions persisted to SQLite
- Pipe restricted to the current user via DACL, per-install token compared in constant time
- Screenshots redacted by on-device OCR and shown in a mandatory preview before reaching the agent
- Zero outbound connections, enforced by clippy, cargo-deny and a restrictive CSP
- Heartbeat prima del timeout del tool di ogni agente, chiamate riprendibili, transizioni di stato persistite su SQLite
- Pipe accessibile solo all'utente corrente (DACL), token per installazione confrontato in tempo costante
- Screenshot oscurati con OCR locale e mostrati in un'anteprima obbligatoria prima di arrivare all'agente
- Zero connessioni in uscita, imposte da clippy, cargo-deny e una CSP restrittiva
DESKTOP APP · TYPESCRIPT
the-annotator
Offline Windows tool for YOLO object detection datasets, built with Electron, React and a Fabric.js canvas. It reads and writes the standard YOLO files (data.yaml, labels/*.txt) directly, with no import or export step.
Tool offline per Windows per dataset YOLO di object detection, in Electron, React e canvas Fabric.js. Legge e scrive direttamente i file YOLO standard (data.yaml, labels/*.txt), senza import o export.
- Class merge, remap, reorder and delete across the whole dataset, with backup and rollback on error or cancel
- Atomic writes (temp file, fsync, rename) with retries and a recovery copy
- data.yaml edited through the YAML AST, so unrelated keys and formatting survive
- Typed IPC behind contextBridge, virtualised image list, Vitest suites with injected write failures
- Merge, remap, riordino ed eliminazione delle classi su tutto il dataset, con backup e rollback su errore o annullamento
- Scritture atomiche (file temporaneo, fsync, rename) con retry e copia di recupero
- data.yaml modificato tramite l'AST YAML, così chiavi e formattazione non toccate restano intatte
- IPC tipizzato via contextBridge, lista immagini virtualizzata, test Vitest con errori di scrittura iniettati
WEB APP · GEOSPATIAL
Criminal Geoprofiler
Browser-only geographic profiling: estimates an offender's likely base from crime locations with four models (Rossmo CGT, Gaussian KDE, centre of gravity, journey-to-crime). Vanilla JavaScript, Leaflet only, no build step.
Geoprofilazione criminale tutta nel browser: stima la base probabile di un autore dai luoghi dei reati con quattro modelli (Rossmo CGT, KDE gaussiana, centro di gravità, journey-to-crime). JavaScript vanilla, solo Leaflet, nessuna build.
- Model outputs as log-likelihoods on a Web Mercator grid, normalised with log-sum-exp to avoid underflow
- Haversine distances, Silverman's rule for the KDE bandwidth, negative exponential decay for journey-to-crime
- Bilinear upsampling and marching-squares contours at fixed probability percentiles
- Hit score (share of the area searched before reaching a hypothesised anchor), Weiszfeld median, standard deviational ellipse
- Output dei modelli come log-verosimiglianze su griglia Web Mercator, normalizzate con log-sum-exp per evitare underflow
- Distanze haversine, regola di Silverman per la banda della KDE, decadimento esponenziale negativo per il journey-to-crime
- Upsampling bilineare e contorni marching squares a percentili di probabilità fissi
- Hit score (quota di area da esplorare prima di trovare un'ancora ipotizzata), mediana di Weiszfeld, ellisse di deviazione standard
FINTECH · API CLIENT · JAVA
Alpaca REST Client
Unofficial Java 21 client for Alpaca's Trading API v2, about 26 endpoints across orders, positions, watchlists and account. Built on java.net.http with sync and async calls and Jackson-mapped records.
Client Java 21 non ufficiale per la Trading API v2 di Alpaca, circa 26 endpoint tra ordini, posizioni, watchlist e account. Basato su java.net.http, con chiamate sincrone e asincrone e record mappati con Jackson.
- Retries with exponential backoff and jitter, honouring Retry-After, only on idempotent methods
- Order submission is never retried by the client, so a timeout cannot produce a duplicate order
- Per-account rate-limit tracker updated lock-free (CAS) from the X-RateLimit headers
- JSON codec with a lenient profile for the mixed timestamp formats (ISO 8601, epoch seconds or ms)
- Retry con backoff esponenziale e jitter, rispettando Retry-After, solo sui metodi idempotenti
- L'invio degli ordini non viene mai ritentato dal client, così un timeout non può generare un ordine doppio
- Tracker del rate limit per account, aggiornato lock-free (CAS) dagli header X-RateLimit
- Codec JSON con un profilo tollerante per i formati di timestamp misti (ISO 8601, epoch in secondi o ms)
KEY-VALUE STORE · GO
Redis Go Clone
In-memory key-value store over TCP in Go, standard library only. Line-based protocol (GET, SET with optional TTL, DEL, SETEXP, PING), one goroutine per connection, plus a CLI client.
Key-value store in memoria su TCP in Go, solo libreria standard. Protocollo a righe (GET, SET con TTL opzionale, DEL, SETEXP, PING), una goroutine per connessione e un client CLI.
- Expiry times in a min-heap indexed by key: O(1) peek at the next expiry, O(log n) fix on overwrite or delete
- Map and heap behind separate sync.RWMutex locks, so reads run concurrently
- Binary snapshot every 3 s (length-prefixed entries, int64 expiry), fsynced and replayed at startup
- Tokenizer that reads a quoted string or a nested JSON object or array as a single value
- Scadenze in un min-heap indicizzato per chiave: peek O(1) sulla prossima scadenza, fix O(log n) su sovrascrittura o cancellazione
- Map e heap protetti da sync.RWMutex separati, così le letture procedono in parallelo
- Snapshot binario ogni 3 s (voci length-prefixed, scadenza int64), con fsync, ricaricato all'avvio
- Tokenizer che legge come singolo valore una stringa tra virgolette o un oggetto o array JSON annidato
TELEGRAM BOT · PYTHON
One Piece Chapter OUT
Telegram bot that notifies subscribers when a new One Piece chapter is out. A headless Chromium (Playwright, stealth) waits out the Cloudflare challenge, screenshots the page, and Tesseract OCR reads the release banner.
Bot Telegram che avvisa gli iscritti quando esce un nuovo capitolo di One Piece. Un Chromium headless (Playwright, stealth) supera il controllo Cloudflare, cattura la pagina e Tesseract OCR legge il banner dell'uscita.
- Raw Bot API over HTTP, no library: long polling for commands in one thread, notifier in another
- Adaptive schedule: checks every 3 min in the usual release windows, every 30 min otherwise
- SQLite for subscribers and a weekly chapter cache, with in-place schema migrations
- Docker on a Raspberry Pi 4, deployed on every push by a self-hosted GitHub Actions runner
- Bot API chiamata via HTTP senza librerie: long polling dei comandi in un thread, notifier in un altro
- Frequenza adattiva: controllo ogni 3 min nelle finestre di uscita abituali, ogni 30 min altrimenti
- SQLite per iscritti e cache settimanale dei capitoli, con migrazioni di schema in place
- Docker su Raspberry Pi 4, deploy a ogni push tramite runner GitHub Actions self-hosted
EMULATOR · GO
CHIP-8 Emulator
CHIP-8 interpreter in Go, rendered with Ebiten: 4 KB memory, 16 registers, 16-level stack, delay and sound timers, 64×32 display. Runs the classic ROMs (Pong, Tetris, Space Invaders, Breakout).
Interprete CHIP-8 in Go, renderizzato con Ebiten: 4 KB di memoria, 16 registri, stack a 16 livelli, timer di delay e suono, display 64×32. Fa girare le ROM classiche (Pong, Tetris, Space Invaders, Breakout).
- All 34 opcodes decoded by nibble (X, Y, N, NN, NNN), one handler each
- About 600 Hz CPU (10 instructions per frame), wall-clock timers that catch up on missed ticks
- 1-bit framebuffer packed into bytes, XOR sprite blitting with wrap-around and VF collision flag
- Redraw only when the framebuffer changes; 26 ROMs bundled with a terminal picker
- Tutti i 34 opcode decodificati per nibble (X, Y, N, NN, NNN), un handler ciascuno
- CPU a circa 600 Hz (10 istruzioni per frame), timer sul wall clock che recuperano i tick persi
- Framebuffer a 1 bit impacchettato in byte, sprite in XOR con wrap-around e flag di collisione in VF
- Ridisegno solo quando il framebuffer cambia; 26 ROM incluse con selettore da terminale
C11 library of generic containers (linked list, hash map, binary search tree, matrix) over void* payloads, with string and hashing helpers. Each header documents who allocates and who frees.
Libreria C11 di container generici (lista concatenata, hash map, albero binario di ricerca, matrice) su payload void*, con helper per stringhe e hashing. Ogni header documenta chi alloca e chi libera.
- Hash map on MurmurHash3 x64 with separate chaining; keys deep-copied, values owned only if a free callback is given
- Cache-blocked matrix multiply (64×64 tiles, i-k-j inner loop), picked by size; allocation sizes checked for overflow
- BST with on-demand in-order rebalancing; deletion swaps payload pointers instead of copying data
- Tests assert exact free-callback counts, catching leaks and double releases
- Hash map su MurmurHash3 x64 con chaining; chiavi copiate in profondità, valori posseduti solo se si passa una callback di free
- Moltiplicazione di matrici cache-blocked (tile 64×64, loop interno i-k-j), scelta in base alla dimensione; controllo overflow sulle allocazioni
- BST con ribilanciamento in-order su richiesta; la cancellazione scambia i puntatori ai payload invece di copiare i dati
- I test verificano il numero esatto di chiamate alla callback di free, intercettando leak e doppi rilasci