Skip to content

Instantly share code, notes, and snippets.

@zvodd
zvodd / togglechrome.js
Created May 30, 2025 13:40
userscript youtube.com toggle controller/chrome/overlay
let revoke = (
function() {
let display_on = false;
const selectors = `
.ytp-chrome-top
.ytp-chrome-bottom
.ytp-gradient-top
.ytp-gradient-bottom`.split('\n').map(s => s.trim()).filter(s => s);
function toggleYouTubeControls() {
@zvodd
zvodd / tagger_ui_addon.py
Last active May 20, 2025 13:30
blender tagging addon WIP
bl_info = {
"name": "Object Tagger",
"author": "zvodd",
"version": (1, 1, 4),
"blender": (4, 2, 0),
"location": "3D View > Sidebar (N Panel) > Tagger Tab | V for Pie Menu",
"description": "Adds, removes, and manages tags on objects using custom properties. Includes a customizable Pie Menu.",
"warning": "",
"doc_url": "",
"category": "Object",
@zvodd
zvodd / svg_transform_resize_folder.py
Created January 22, 2025 21:04
Resize SVG folder in/out; via viewbox and corresponding transform element wrap
import xml.etree.ElementTree as ET
import argparse
import sys
import os
from pathlib import Path
def resize_svg(input_file, width=None, height=None):
"""
Resize an SVG by wrapping its contents in a transform that scales to new dimensions
while preserving aspect ratio.
@zvodd
zvodd / svg_transform_resizer.py
Created January 22, 2025 20:50
Resize SVG; via viewbox and corresponding transform element wrap
import xml.etree.ElementTree as ET
import argparse
import sys
def resize_svg(input_file, width=None, height=None):
"""
Resize an SVG by wrapping its contents in a transform that scales to new dimensions
while preserving aspect ratio.
Args:
@zvodd
zvodd / fontforge_export_glyphs_as_svgs
Created January 15, 2025 13:23
Export a selection of glyphs as SVG using FontForge
##
## In FontForge( https://fontforge.org ) with font of choice open press Ctrl + . to open the script dialog, paste and run.
## You will be asked to save a file. Font will be put in the selected folder with the prefix of the name entered.
#
## Recommend: Symbols NerdFont at https://www.nerdfonts.com/font-downloads
##
import os
import pprint
@zvodd
zvodd / day4.py
Created December 12, 2024 18:06
AoC_2024 day4 python - I think I missed a trick with part 1?
def parse(lines):
width = len(lines[0])
height = len(lines)
for ypos, line in enumerate(lines):
for xpos, c in enumerate(line):
if c != "X":
continue
@zvodd
zvodd / dns_checker.py
Created December 3, 2024 22:07
Check a list of domains from a text file. To see if they resolve.
from collections import OrderedDict
import socket
import sys
import re
def extract_first_hostname(text):
"""
Extract the first hostname from a given string.
Args:
@zvodd
zvodd / havok_wasm_physics_sim.ts
Last active November 3, 2024 04:25
Do physics sim asynchronously / not locked to renderer. Absolutely borked way to use havok_wasm.
import HavokPhysics, {
HavokPhysicsWithBindings,
Result, HP_ShapeId
} from "@babylonjs/havok";
// Global variable to store the initialized Havok physics engine
globalThis['HK'] = (await HavokPhysics()) as HavokPhysicsWithBindings;
const HK : HavokPhysicsWithBindings = globalThis.HK;
// Define helper functions for common physics types (Vector3, Quaternion, etc.)
@zvodd
zvodd / GridVertexSnap.py
Created October 12, 2024 03:39
Blender Operator + Panel: Snaps selected vertices to virtual 3d grid.
import bpy
import bmesh
from mathutils import Vector
from bpy.props import BoolProperty, FloatVectorProperty
from bpy.types import Operator, Panel, PropertyGroup
#######################
# Props
#######################
@zvodd
zvodd / loadenv.bat
Last active October 3, 2024 15:23
load a dotenv file in windows cmd line - doesn't support values containing `=`
@echo off
if "%~1"=="" (
set "ENV_FILE=%CD%\.env"
) else (
set "ENV_FILE=%~1"
)
if not exist "%ENV_FILE%" (
echo Error: %ENV_FILE% file not found
exit /b 1