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 / 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 / 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>