Skip to content

Instantly share code, notes, and snippets.

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
@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]) {
how many recursive CNAME records does your dns resolver resolve?
well there's an easy way and a hard way to figure out...
let's start with the hard way:
- search golang dns server
- end up with https://gist.github.com/walm/0d67b4fb2d5daf3edd4fad3e13b162cb and save main.go to a folder
- search how to build a golang project and download imports because you don't remember
- edit it to parse the deepest subdomain as an int and return a CNAME minus one of it
- and also return a real A record if the int is 0
- acquire a vps and scp your built binary to it
@rtldg
rtldg / purge.py
Last active January 13, 2025 23:19
purge old cloudflare pages deployments
# SPDX-License-Identifier: WTFPL
# /// script
# requires-python = ">=3.10"
# dependencies = [
# "cloudflare==2.19",
# ]
# ///
# Create token with Account -- Cloudflare Pages:Edit, Workers Scripts:Edit
import glob
import urllib.request
import os
plain = ""
for f in glob.glob("*.bsp"):
plain += str(os.path.getsize(f)) + " " + f + "\n"
req = urllib.request.Request("https://check.fastdl.me/nsplain", data=plain.encode(), headers={"User-Agent": "check.py"})
resp = urllib.request.urlopen(req)
print(resp.read().decode('utf-8'))