Skip to content

Instantly share code, notes, and snippets.

View Absolucy's full-sized avatar
👀
looking for a job

Lucy Absolucy

👀
looking for a job
View GitHub Profile
@Absolucy
Absolucy / regex.rs
Created January 30, 2025 03:00
i love regex
static THRESHOLD_SPLIT_REGEX: Lazy<Regex> = Lazy::new(|| {
Regex::new(r"(?im)(<br>|([^:]<b>))[^$]").expect("failed to setup THRESHOLD_SPLIT_REGEX")
});
static THRESHOLD_PARSE_REGEX: Lazy<Regex> = Lazy::new(|| {
Regex::new(r"(?im)(?:<b>)?(?P<name>[[[:alpha:]] ]+) ?(?P<level>[[:digit:]]{1,2})?[[:space:]]?(?:</b>[[:space:]]*|:</b>[[:space:]]*)(?P<desc>[^<>\n]+)").expect("failed to setup THRESHOLD_PARSE_REGEX")
});
static SEVERITYSET_PROC_PARSE_REGEX: Lazy<FancyRegex> = Lazy::new(|| {
FancyRegex::new(
r"(?mxi) # setup flags
(?P<severityset>
@Absolucy
Absolucy / rust_g.dm
Created January 4, 2025 20:10
pure DM rust-g stub
/*
* This is a stub for the rust-g DLL, implemented in pure DM.
* It implements whatever functions were somewhat trivial to implement.
* Everything else just returns null and logs "UNIMPLEMENTED STUB: rustg_func_name" to world.log.
*
* This has been tested and can initialize + run on /tg/station code as of 1/4/2025 (commit 2df30547c27)
* Don't use this in production. The only reason this exists is to help Lummox reproduce bugs in SS13 codebases easier.
*
* You may need to also comment out a url_encode/decode override define in some codebases, usually in rust_g_overrides.dm or something.
*/
@Absolucy
Absolucy / auxmemorystats.c
Last active December 7, 2024 06:10
doohickey to output memory stats at runtime
/********************************************************************************/
/* DON'T USE THIS, I REWROTE IT WITH BETTER CODE AND LINUX SUPPORT: */
/* https://github.com/Absolucy/byond-memorystats */
/********************************************************************************/
#ifndef __clang__
#error use clang to compile this graaaah
#endif
#include <stdio.h>
@Absolucy
Absolucy / tape.schema.json
Created May 13, 2024 08:36
monkestation cassette storage JSON schema
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "The title of the cassette tape."
},
"desc": {
"type": "string",
@Absolucy
Absolucy / cleanup.ps1
Created April 3, 2024 23:03
delete local git branches that were deleted remotely
function Remove-Unused-Branches {
$refsToDelete = git for-each-ref --format '%(refname:short) %(upstream:track)' |
ForEach-Object {
$ref, $upstream = $_ -split '\s+'
if ($upstream -eq '[gone]') {
Write-Output $ref
}
}
@Absolucy
Absolucy / mirrorify.sh
Last active December 1, 2023 20:19
Arch Linux rate-mirrors script (Arch + CachyOS + archzfs)
#!/bin/bash
set -e
TMP_SUFFIX=".rate-mirrors"
MIRROR_FOLDER="/etc/pacman.d/mirrors"
PROTOCOLS="https"
TIMEOUT_MS="5000"
[ -d "${MIRROR_FOLDER}" ] || sudo mkdir -p "${MIRROR_FOLDER}"
TMPDIR="$(mktemp --directory --suffix "${TMP_SUFFIX}")"
@Absolucy
Absolucy / clip out mentor stuff.py
Created June 4, 2023 21:46
beestation - clip out mentor chat
import cv2
import numpy as np
import subprocess
import sys
import os
# the pixels to check
pixel_positions = [(1615, 727), (1705, 728)] # example positions
# the minimum color value to check for (in BGR)
@Absolucy
Absolucy / ss13-obs-auto-recorder.py
Last active January 23, 2025 22:50
SS13 OBS automatic recorder
# pip install obs-websocket-py psutil colorlog pystray pillow
import json
import psutil
import os
import shutil
import threading
from colorlog import ColoredFormatter, StreamHandler
from logging import INFO, getLogger
from obswebsocket import obsws, requests as obsreq
from time import sleep, time
@Absolucy
Absolucy / ss13-obs-auto-record.py
Last active March 6, 2023 06:01
SS13 OBS automatic recorder
import socket
import struct
import json
import psutil
import os
import shutil
from colorlog import ColoredFormatter, StreamHandler
from logging import INFO, getLogger
from obswebsocket import obsws, requests as obsreq
from time import sleep, time
@Absolucy
Absolucy / keybase.md
Created June 21, 2021 13:37
Keybase Proof

Keybase proof

I hereby claim:

  • I am absolucy on github.
  • I am absolucy (https://keybase.io/absolucy) on keybase.
  • I have a public key ASBfb-sA4FyJi_9fyQ-gzZ3xvh-8mSLlksV4asTNBqyMOQo

To claim this, I am signing this object: