Skip to content

Instantly share code, notes, and snippets.

View nperez's full-sized avatar

nperez nperez

  • Amsterdam, The Netherlands
View GitHub Profile
@nperez
nperez / highlight.js
Created August 27, 2026 08:11
highlight.js
/* Semicolon Inspector — find the answer AND put a marker on the sheet.
Paste on the TITLE SCREEN, before clicking BEGIN INSPECTION. */
(() => {
const AF = Array.prototype.filter, AP = Array.prototype.push,
AM = Array.prototype.map, MF = Math.floor;
let win = null, sheets = null, R = null, cam = null, r = null, c = null, z = 0;
/* 1. renderer, via three's devtools hook (fires in the WebGLRenderer ctor) */
window.__THREE_DEVTOOLS__ = { dispatchEvent(e) {
const d = e && e.detail;
@nperez
nperez / docker-reconstruct.sh
Created March 4, 2026 08:10
Reconstruct a `docker run` command from a running container.
#!/usr/bin/env bash
#
# docker-reconstruct.sh — Reconstruct a `docker run` command from a running container.
# Usage: ./docker-reconstruct.sh <container_name_or_id>
#
set -euo pipefail
if [[ $# -lt 1 ]]; then
echo "Usage: $0 <container_name_or_id>"
@nperez
nperez / filter_torrents.py
Last active September 16, 2026 08:24
Magnetico Two-Stage Pornographic Torrent Filter
#!/usr/bin/env python3
"""
Magnetico Pornographic Torrent Filter — Embedding Edition
Replaces the slow per-title LLM classifier with semantic search:
1. embed — embed every torrent title with a local Qwen3-Embedding model
running directly in PyTorch (mean-pooled, fp16, GPU-batched),
cached to an on-disk memmap (resumable). Re-running on a COMPLETE
cache refreshes incrementally: it implicitly compacts out dead/
for(int x = 0; x < 3; x++) {
if(this.getElement(x, 0) == this.getElement(x, 1) && this.getElement(x, 0) == this.getElement(x, 2)) {
return true;
}
}
@nperez
nperez / gist:5939373
Created July 6, 2013 09:31
Want to make Chrome tunnel DNS via SOCKS5 proxies when you have FoxyProxy configured to use pre-defined patterns and priorities? Patch.
:!diff -u js/proxyManager.js js/proxyManager-mine.js
--- js/proxyManager.js 2013-07-06 11:27:25.000000000 +0200
+++ js/proxyManager-mine.js 2013-07-06 11:26:41.000000000 +0200
@@ -176,7 +176,7 @@
case "manual":
if (!proxy.data.pac || proxy.data.pac.length == 0) {
console.log("regular proxy manual used");
- proxyStr = '"' + (proxy.data.isSocks ? "SOCKS " : "PROXY ") + proxy.data.host + ":" + proxy.data.port + '"';
+ proxyStr = '"' + (proxy.data.isSocks ? (proxy.data.socks == 5 ? "SOCKS5 " : "SOCKS ") : "PROXY ") + proxy.data.host + ":" + proxy.data.port + '"';
} else {
nicholas@nicklaptop:~/code/metacpan_api_server$ dzil listdeps
!!! [CompileTests] is deprecated and may be removed in a future; replace it with [Test::Compile]
!!! [MinimumVersionTests] is deprecated and will be removed in a future release; replace it with [Test::MinimumVersion] at /home/nicholas/installed/perl5/perls/perl-5.14.2/lib/site_perl/5.14.2/Dist/Zilla/Plugin/MinimumVersionTests.pm line 13.
couldn't determine document name for bin/write_config_json at /home/nicholas/installed/perl5/perls/perl-5.14.2/lib/site_perl/5.14.2/Pod/Weaver.pm line 73
Installing Oracle 8.1.7 client libs to then build DBD::Oracle 1.14
A final, successful result flowed from the following environment:
Debian 3.0 (Woody) installed into a VM from isos.
VM environment provides ne2k-pci network card.
STEPS FROM THE HOST
So let's put some potential locations down for meet up with a few criteria:
1) Non-smoking.
2) Not too loud.
3) Somewhat affordable.
3) One or two locations per quadrant of the metroplex.
Potential locations for DFW.pm social meet up:
*
Mar 10, 2010 08:09:14 PST | Transaction ID: XXXXXXXX
Hello NICHOLAS R PEREZ,
You sent a payment of $9.95 USD to Rock Solid Games (support@rocksolidgames.com)
It may take a few moments for this transaction to appear in your account.
sudo plackup -p 80 hacks.psgi