Skip to content

Instantly share code, notes, and snippets.

View sneakers-the-rat's full-sized avatar

Jonny Saunders sneakers-the-rat

View GitHub Profile
@sneakers-the-rat
sneakers-the-rat / clean_pdf.sh
Last active May 23, 2026 05:53
Strip PDF Metadata
# --------------------------------------------------------------------
# Recursively find pdfs from the directory given as the first argument,
# otherwise search the current directory.
# Use exiftool and qpdf (both must be installed and locatable on $PATH)
# to strip all top-level metadata from PDFs.
#
# Note - This only removes file-level metadata, not any metadata
# in embedded images, etc.
#
# Code is provided as-is, I take no responsibility for its use,
@sneakers-the-rat
sneakers-the-rat / wwe.txt
Last active May 8, 2026 00:29
wwe_corpus
Welcome to Wrestlemania!
Woodstock was to rock and roll, what WrestleMania is to wrestling.
Finally, your men, in a very controversial match...
What do you mean "controversial"? He pinned him right in the center of the ring, didn't he? Did he or did he not pin him for the count of three?
Where's that cane of yours?
What cane? I...didn't have no cane!
All right, we're just moments away from the big one. When I say big, the battle of the titans. Big John Studd, Bobby Heenan, come in. Andre the Giant putting his entire career on the line.
Oh man, this bag is heavy man! This is what it was all about. $15,000 that we used for bait. John Studd, the only giant of wrestling. 7 foot plus, nearly 400 pounds of solid muscle. And this is what we wanted to prove to the whole world that I am the giant in a few short moments, along with this $15,000. You're going to see me in the ring and you're going to see the last match of Andrea because he retires if he can't do it.
Bobby Heenan, I'm just counting the money here.
You kn
from pathlib import Path
import json
# change this to the actual directory of dlc_beaker_ver01
beaker_dir = Path("dlc_beaker_ver01")
sizes = {str(path.relative_to(beaker_dir)): path.stat().st_size for path in beaker_dir.rglob("*")}
with open('beaker_sizes.json', 'w') as f:
json.dump(sizes, f)
@sneakers-the-rat
sneakers-the-rat / remove_meta.sh
Last active July 16, 2024 10:34
remove pdf metadata
####
# 1) install exiftool and qpdf
# https://exiftool.org/
# http://qpdf.sourceforge.net/
# (can be installed with homebrew: brew install exiftool qpdf )
####
# 2) remove metadata - this step is reversible, so we will need to recreate the PDF afterwards
exiftool -all:all= /location/of/some/file.pdf
@sneakers-the-rat
sneakers-the-rat / snake.js
Last active June 27, 2024 07:55
Snake for onemillioncheckboxes.com
// Snake interface for onemillioncheckboxes.com
// with love from jonny
var direction;
var current_box;
var check_time = +new Date();
var scroll_debounce = false;
const SPACE_MULTIPLIER = 3;
const spacing = 35;
@sneakers-the-rat
sneakers-the-rat / e_hashs.json
Last active June 10, 2024 08:32
Elsevier PDF "hashes"
[
"FCi27mtaKod38ztmGndn-y8NNz.r.lt6SndqGztz_ztr-ngqQm9aMo9eOnMeJntuNntu",
"D2ei2mgqJz9b-m.mGmPqRyLNNnwmOlt7.ywiGmt-Kndr9otqRywv8o9ePmtiNmd2Sn92Tma",
"6U7vcmPuOn9uLnMaGyM7-nLNNntv9lt6RmtaGmweOyMmJnMmSmgmOo9eOnM6LnMaRmM-Tma",
"lXLf8owyQztiMzwqGnMz7zcNNotb7lwf.m9qGzt6Km.qMngqLndqLo9eOotaNm96Mmt6Tma",
"FCi27y9qOnd-Ny96GmPmOmcNNzwf-lwj-m9mGztz7ytaMnM78n9v-o9ePmM6Rm9-Qn9eTma",
"XlEDumMz7nM7-m9iGogmRmLNNyt_8lwiKz9eGm9-Pm.v7ztiLztz_o9eOnMeQnd-Sodm",
"lXLf8yt-JywmNmPeGm9n9n8NNzgn.lt_8zwqGogz7zgn7zt6SyPr-o9eOnM6Pot2Mn9qTma",
"FCi27zgf8mdqMmMeGnMmMy8NNz9eQlweNy.eGmMiMm96Qmgr9nMb-o9ePmtuRmt6JotmTma",
"FCi27nwmKnMeSodeGm.z.y8NNntz.lt-PywmGy9__ngqQmtiPmtb7o9ePmteJotyJoduTma",
@sneakers-the-rat
sneakers-the-rat / textual_dirchooser.py
Created March 29, 2024 22:12
Choose multiple directories with Textual
from pathlib import Path
from typing import Iterable, List
from textual.app import App, ComposeResult
from textual.widgets import DirectoryTree, Header
from textual import events
from rich.text import Text, TextType
from textual.containers import Container
class MultiSelectDirectoryTree(DirectoryTree):
@sneakers-the-rat
sneakers-the-rat / dirchooser.py
Created March 29, 2024 20:31
Select multiple directories with PySide6
from pathlib import Path
from typing import Optional, List
from PySide6.QtWidgets import (
QApplication,
QFileDialog,
QListView,
QAbstractItemView,
QTreeView,
QFileSystemModel
@sneakers-the-rat
sneakers-the-rat / linkml.html
Created March 9, 2024 06:58
LinkML Pydanticgen in the browser with Pyodide
<!doctype html>
<html>
<head>
<script src="https://cdn.jsdelivr.net/pyodide/v0.25.0/full/pyodide.js"></script>
<link rel="stylesheet" href="https://unpkg.com/@highlightjs/cdn-assets@11.9.0/styles/default.min.css">
<script src="https://unpkg.com/@highlightjs/cdn-assets@11.9.0/highlight.min.js"></script>
<!-- and it's easy to individually load additional languages -->
<script src="https://unpkg.com/@highlightjs/cdn-assets@11.9.0/languages/python.min.js"></script>
<script src="https://unpkg.com/@highlightjs/cdn-assets@11.9.0/languages/yaml.min.js"></script>
@sneakers-the-rat
sneakers-the-rat / fly.html
Created March 20, 2023 22:45
paper crane that doesn't let you close it
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>.</title>
</head>
<body bgcolor="ffffff">
<font size="1">
<pre> |b
This is fun... ||
||,