Skip to content

Instantly share code, notes, and snippets.

@rtldg
rtldg / check.ps1
Created January 6, 2026 14:38
PSD text spell-checker that kind of sucks and wasn't practical
function Encode-Url {
param([string]$url)
return [System.Net.WebUtility]::UrlEncode($url)
}
Push-Location -LiteralPath "$PSScriptRoot"
$psd = gc "*.psd" -Raw -Encoding UTF8;
$text_layers = (Select-String -Pattern '<photoshop:LayerText>(.*)</photoshop:LayerText>' -InputObject $psd -AllMatches |
Foreach {$_.matches} |
Foreach {$_.Groups[1].Value} |
@rtldg
rtldg / dleslinks.js
Created December 18, 2025 08:55
The Dles userscript to make things middle-click-able
From f3db078d94224f4bebd9c7a8615a277e55b92efe Mon Sep 17 00:00:00 2001
From: rtldg <rtldg@protonmail.com>
Date: Thu, 6 Mar 2025 08:14:39 +0000
Subject: [PATCH] Fix 'non-const reference cannot bind to bit-field' error with
newer clang versions
This specifically shows up when trying to use zig 0.14.0 (llvm 19.1.7) to cross-compile to Linux.
In file included from H:\code\srcwr\srcwrtimer/_external/alliedmodders/sourcemod/public/CDetour/detours.cpp:1:
In file included from H:\code\srcwr\srcwrtimer/_external/alliedmodders/sourcemod/public/CDetour/detours.h:36:
ALT+UP=target inner byobu
ALT+DOWN=target outer byobu
ALT+LEFT=go left one byobu "page" thing
ALT+RIGHT=go right one byobu "page" thing
F2=create new byobu page
SHIFT+F2=create horizontal split on current byobu panel
CTRL+F2=create vertical split on current byobu pane
SHIFT+UP=go up byobu panels
SHIFT+DOWN=go down byobu panels
SHIFT+LEFT=go left in byobu panels
["195.133.55.226", "193.58.120.155", "31.13.248.71", "91.132.134.76", "185.232.171.145", "193.233.171.250", "62.133.60.237", "194.58.45.90", "185.107.96.64", "212.23.211.49", "89.169.6.235", "45.159.181.106", "94.16.111.220", "217.196.104.248", "138.124.31.149", "88.151.192.110", "88.151.192.26", "91.238.105.35", "88.151.195.73", "185.172.129.124", "91.231.182.127", "91.199.45.85", "188.127.247.120", "89.169.10.43", "45.140.146.234", "45.89.63.246", "194.156.103.121", "85.238.112.45", "91.208.52.149", "89.169.8.123", "212.162.155.96", "91.149.221.82", "77.83.246.78", "51.68.143.140", "156.253.249.16", "31.130.138.94", "151.252.104.37", "146.185.198.11", "146.185.198.39", "31.130.138.49", "5.44.41.229", "91.244.174.235", "91.244.174.239", "81.16.141.93", "185.244.50.245", "195.238.126.252", "185.135.86.224", "146.185.196.52", "146.185.196.17", "185.248.100.98", "45.89.66.250", "185.221.162.95", "121.127.37.71", "193.19.119.167", "62.173.149.184", "195.133.52.30", "185.22.153.62", "91.219.149.14", "45.143.95.12
@rtldg
rtldg / packed_size_explorer.cpp
Last active March 4, 2025 13:27
using this in godbolt to check stuff for metamod:source
#include <stdio.h>
#ifdef _MSC_VER
#define PACKED
#pragma pack(push, 1)
#else
#define PACKED __attribute__((packed))
#endif
typedef struct PACKED thing {
thing() : a(10), b(15) { printf("hello %d %d\n", a, b); }
@rtldg
rtldg / Steam Datagram Relay slash Steam Networking FAQ.md
Last active December 2, 2025 18:34
Steam Datagram Relay / Steam Networking FAQ

What is Steam Datagram Relay / Steam Networking?

Resources:

Steam Networking is a bundle of APIs that do a lot of things and most notably support Steam Datagram Relay, which is provided by Valve to proxy connections to your server/SRCDS, to protect your server/SRCDS from DDOS, and provide P2P support.

Previously, if you could not port-forward your SRCDS server's ports, it would only work as a LAN server and other players wouldn't be able to join.

@rtldg
rtldg / better-mpv-screenshots.lua
Last active January 6, 2025 01:00
better screenshot filenames for mpv and also helps with long screenshot filenames
-- SPDX-License-Identifier: WTFPL
-- Copyright 2025 rtldg <rtldg@protonmail.com>
--[[
basically this:
screenshot-template="%F %P %n %{sub-text}"
Only includes sub-text in filename if the picture includes subs.
Things this basically does:
- Trim screenshot filenames to remove trailing '.', '_', and (c <= ' ').
@rtldg
rtldg / system v amd64 psabi notes.md
Last active December 2, 2025 19:22
Notes so I remember how calling conventions work
public void OnPluginStart()
{
char output[0xFFFF], data[0xFFFF];
int outputpos;
int pointer;
char code[] = "++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.";
for (int i; code[i]; i++) {
switch (code[i]) {