Skip to content

Instantly share code, notes, and snippets.

@gesslar
gesslar / updatelocalrepos.ps1
Last active July 14, 2024 04:17
updates all local repos - useful after doing things directly online or dependencies got updated
# Define the array of directories
$repos = @(
"mud.gesslar.dev",
"mupdate",
"ThreshBeep",
"ThreshBuff",
"ThreshChat",
"ThreshColorPercent",
"ThreshCommandRepeater",
"ThreshCopy",
@gesslar
gesslar / 1_websocket_echo.c
Created July 1, 2024 00:12
Basic example of using websocket to connect to echo.websocket.org (https://echo.websocket.org/)
// /adm/daemons/websocket_echo.c
// Test websocket with echo.websocket.org
//
// Created: 2024/06/30: Gesslar
// Last Change: 2024/06/30: Gesslar
//
// 2024/06/30: Gesslar - Created
#include <daemons.h>
#include <websocket.h>
@gesslar
gesslar / MuddleHelper.lua
Last active June 21, 2024 03:23
Script for managing Muddler automatic uninstall/re-install
-- After making changes to the items table, you will need to run: lua resetProfile()
-- So that it will reload.
MuddleHelper = MuddleHelper or {
items = {
{ name = "ThreshBuff", path = "D:/git/threshbuff", active = true, helper = nil },
{ name = "ThreshKeepalive", path = "D:/git/ThreshKeepalive", active = true, helper = nil },
{ name = "ThreshColorPercent", path = "D:/git/ThreshColorPercent", active = true, helper = nil },
}
}
@gesslar
gesslar / release.yml
Created June 20, 2024 21:50
GitHub workflow for automatically compiling and creating a release whenever you push to GitHub, except from PRs
name: Build project using muddler and upload artifact
on:
push:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
permissions:
@gesslar
gesslar / sid.js
Created May 2, 2024 19:19 — forked from Krizzzn/sid.js
Convert binary buffer object SID to string
/*
# Convert binary encoded object SID to a string
# (eg. S-1-5-21-1004336348-1177238915-682003330-512)
#
# SID format: https://technet.microsoft.com/en-us/library/cc962011.aspx
#
# ldapjs `searchEntry` has attribute `raw` that holds the raw
# values, including the `objectSid` buffer when one exists. Pass that
# buffer to get the string representation that can then be easily
# used in LDAP search filters, for example.
@gesslar
gesslar / sid.js
Created May 2, 2024 19:19 — forked from Krizzzn/sid.js
Convert binary buffer object SID to string
/*
# Convert binary encoded object SID to a string
# (eg. S-1-5-21-1004336348-1177238915-682003330-512)
#
# SID format: https://technet.microsoft.com/en-us/library/cc962011.aspx
#
# ldapjs `searchEntry` has attribute `raw` that holds the raw
# values, including the `objectSid` buffer when one exists. Pass that
# buffer to get the string representation that can then be easily
# used in LDAP search filters, for example.
@gesslar
gesslar / parse_response_intro.c
Last active December 24, 2023 21:13
takes the response from a remote server and parses it into a mapping
/*
Takes:
HTTP/1.1 400 Bad Request
Server: cloudflare
Date: Sun, 24 Dec 2023 20:51:56 GMT
Content-Type: text/html
Content-Length: 155
Connection: close
CF-RAY: -
@gesslar
gesslar / palindrome.js
Last active July 27, 2023 06:05
Detects palindromes!
// Skippable characters are spaces and punctuation and symbols
const skippable = char => char.match(/[\s\p{P}\p{S}]/u)
// Tests for numeric characters
const numeric = char => char.match(/\d/u)
// The whole meaty sandwich
const is_palindrome = word => {
// Grab the length of the word(s)
const len = word.length
// /cmds/race/_units.c
// Short description of this file and its purpose.
//
// Created: 2013/08/31: Gesslar
// Last Change: 2013/08/31: Gesslar
//
// 2013/08/31: Gesslar - Created
inherit STD_CMD ;
@gesslar
gesslar / admium_chest.c
Last active January 12, 2023 00:34
Sample menu-chest using loot table from Calinvar
// /d/thrace/mforest/sanguine/obj/chest.c
// Treasure chest for Wrathful Beast
//
// Created: 2023/01/11: Gesslar
// Last Change: 2023/01/11: Gesslar
//
// 2023/01/11: Gesslar - Created
#include <colors.h>