Skip to content

Instantly share code, notes, and snippets.

View colinvh's full-sized avatar

Colin von Heuring colinvh

View GitHub Profile
@colinvh
colinvh / README.md
Last active November 3, 2026 05:53
Copy certain completed torrents from qBittorrent-nox in Docker (Compose)

Completed torrent replicator

This is a mostly generalized process for copying some of the completed torrents downloaded with qbittorrent-nox running with Docker Compose to another directory. The idea is that you can keep seeding the completed torrents while moving copies of their contents as you see fit. I called the type of torrents you want to do this to "your certain torrents" so that's what that means here.

In these files, $DOCKER_QBTN should be replaced with the path to your qbittorrent-nox container.

Create files

@colinvh
colinvh / ahyoheek-spock-lizard.md
Last active June 24, 2025 15:49
Ahyoheek-Spock-Lizard

Ahyoheek-Spock-Lizard

Introduction

For some reason, the two nerdiest variants of Rock Paper Scissors/Rochambeau (henceforth “RPS”), namely Ahyoheek and Rock Paper Scissors Spock Lizard, have never been combined, or at least such efforts have not been documented on Al Gore’s internet. Today, we fix that problem.

Concept

Pineapple Apple Pen, but for Ahyoheek and Rock Paper Scissors Spock Lizard.

Problems

  • How many points should be required for victory?
  • How should players keep track of how many victory points everyone has received?
@colinvh
colinvh / mysqli-delete-multiple.php
Created March 28, 2019 17:28
Delete multiple rows by ID with one statement (mysqli)
$ids = [1, 2, 3];
$qqq = join(', ', array_fill(0, sizeof($ids), '?'));
$iii = str_repeat('i', sizeof($ids));
$stmt = $conn->prepare("DELETE FROM table WHERE id IN ($qqq)");
$args = $ids;
array_unshift($args, $iii);
call_user_func_array([$stmt, 'bind_param'], $args);
$stmt->execute();
#!/usr/bin/env python
import random
def descriptor(described):
d = random.choice(DESCRIPTORS)
if d[-1] == '-':
if lower(described[0]) in 'aeiou':
return d[:-2] + described
else:
@colinvh
colinvh / randsym.py
Last active May 1, 2018 17:29
Random symbolic identifiers
# -*- coding: utf-8 -*-
import codecs
from collections import Counter
import random
import sys
sys.stdout = codecs.getwriter('utf8')(sys.stdout)
DIACRITICS = [
@colinvh
colinvh / INDEX.md
Created April 13, 2018 21:09
The Motorcyclist's Creed

The Motorcyclist's Creed

With apologies to Steven King and Roland Deschain.

I do not accelerate with my hand; He who accelerates with his hand has forgotten the displacement of his motor.

I accelerate with my wrist.

I do not steer with my arms; He who steers with his arms has forgotten the displacement of his motor.

#!/usr/bin/env perl
# PRAGMA
use warnings;
use strict;
# DECLARE
sub kaprekar_distance(_);
sub fmt(_);
code ltr pro num punc eur notes
. E
- T
.. I
.- A
-. N
... S
-- M
..- U
.-. R
@colinvh
colinvh / surface-gravity.odt
Last active December 19, 2015 22:21
Surface Gravity of Terrestrial Bodies in the Solar System