Skip to content

Instantly share code, notes, and snippets.

View alertedsnake's full-sized avatar

alertedsnake

  • 05:49 (UTC -04:00)
View GitHub Profile
@alertedsnake
alertedsnake / dumpyaml.py
Last active May 30, 2025 04:22
How to handle multi-line blocks nicely in yaml
from ruamel.yaml import YAML
def str_representer(dumper, data):
if len(data.splitlines()) > 1: # check for multiline string
return dumper.represent_scalar('tag:yaml.org,2002:str', data, style='|')
return dumper.represent_scalar('tag:yaml.org,2002:str', data)
@alertedsnake
alertedsnake / gist:5d3c7c85da75ce5dee9536027c34e034
Created February 27, 2020 15:31
Bash function to do AWS 2-factor auth
#
# Bash function to peform AWS 2-factor auth.
#
# This assumes you have $AWS_CREDENTIAL_FILE set to an actual credentials file, and
# AWS_PROFILE set to the appropriate profile in said file.
#
awsmfa() {
unset AWS_ACCESS_KEY_ID
unset AWS_AWS_SECRET_ACCESS_KEY
@alertedsnake
alertedsnake / test.py
Last active March 9, 2020 19:46
sentry exception tests
import sentry_sdk
import MySQLdb
import logging
import os
from sentry_sdk.integrations.logging import LoggingIntegration
DB_HOST = 'bogus.example.com'
DB_USER = 'monkey'
DB_PASS = 'you know what this is'
DB_DB = 'database'
@alertedsnake
alertedsnake / uwsgi.ini
Last active May 26, 2020 18:58
Uwsgi logs in JSON format
# add 'logfile' to the plugin list
plugins = python3,logfile
# match logs already in json format
logger = applogger stdio
log-route = applogger ^{
log-encoder = format:applogger ${msg}
log-encoder = nl:applogger
# all other logs, we jsonify
--- Packages.orig/com.vrchat.base/Editor/VRCSDK/Dependencies/VRChat/API/VRCTools.cs 2023-12-15 17:36:51.390368366 -0500
+++ Packages/com.vrchat.base/Editor/VRCSDK/Dependencies/VRChat/API/VRCTools.cs 2023-12-15 17:37:10.234606341 -0500
@@ -108,7 +108,12 @@
{
continue;
}
- var groups = (IEnumerable)groupsList?.GetValue(servicePointGroups.GetValue(scheduler));
+ var servicePointGroup = servicePointGroups?.GetValue(scheduler);
+ if (servicePointGroup == null)
+ {