Skip to content

Instantly share code, notes, and snippets.

View CodeZombie's full-sized avatar
🌵

Jeremy Clark CodeZombie

🌵
View GitHub Profile
@CodeZombie
CodeZombie / comfy_prompt_extractor.py
Created April 18, 2025 22:07
ComfyUI Image prompt extractor
import sys
import json
from PIL import Image
# qt
from PyQt5.QtWidgets import QApplication, QMessageBox, QWidget, QTextEdit, QVBoxLayout, QLabel
from PyQt5.QtGui import QIcon, QFont
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QSizePolicy
@CodeZombie
CodeZombie / main.gd
Created February 24, 2025 05:54
Self deleting lambda signals in Godot
extends Node
signal sig
class SigTest:
var x: int = 0
func on_signal(sig: Signal, callable: Callable):
var this_object_weakref: WeakRef = weakref(self)
var wrapped_callable: Callable = func(f: Callable):
if this_object_weakref.get_ref() == null:
@CodeZombie
CodeZombie / profit_calc.py
Last active October 14, 2024 15:29
runescape ge profit calculator
import math
from collections import namedtuple
ProductVolPrice = namedtuple("ProductVolPrice", "volume price")
### INPUTS ZONE #################
materials = {
"Loop Half": {
"contribution_rate": 0.5,
@CodeZombie
CodeZombie / mipmap_based_blur.gdshader
Created June 19, 2024 04:52
mipmap-based blurry shadow for godot 4 canvas items
// The canvas item applied to this has two requirements before this will work:
// 1. The texture must have mipmaps generated at Import
// 2. The CanvasItem this shader is applied to must have Texture Filtering set to something with "mipmap" in the name.
shader_type canvas_item;
uniform float lod: hint_range(0.0, 8.0) = 0.0;
uniform float intensity : hint_range(0.0, 4.0) = 1.0;
uniform vec4 blur_color : source_color = vec4(1.0,1.0,1.0,1.0);
@CodeZombie
CodeZombie / blurry_drop_shadow.gdshader
Created June 19, 2024 03:55
Blurry drop shadow, godot canvas shader
shader_type canvas_item;
uniform float blur_radius : hint_range(0.0, 1.0) = 0.25;
uniform vec4 shadow_color : source_color = vec4(0.0, 0.0, 0.0, 1.0);
void fragment() {
vec4 original_texture_color = texture(TEXTURE, UV);
float shadow_alpha = 0.0;
if (original_texture_color.a < 1.0) {
@CodeZombie
CodeZombie / instructions.md
Last active February 6, 2024 20:15
CozyLife Smart Bulb with Home Assistant

How To: Set Up your Stupid Fucking 4 Dollar "Cozy-Life" Wi-Fi Smart Bulb with Home Assistant with Minimal Hair-Pulling

Installing Home Assistant with Docker Compose

This parts simple enough, but requires some adjusting of the official instructions to get working. Most instructions online tell you that your docker-compose.yml file needs to have a network_mode: host in there. I dunno about that! Works fine for me without that, so we're going to not.

version: '3'
services:
 homeassistant:
@CodeZombie
CodeZombie / m8_headless_gpio_audio_out
Created December 12, 2023 05:02
M8 headless GPIO Audio Out
The M8 Headless is so cool!
Except that it wants to send audio over USB! That shit sucks! Especially on android where it doesn't work at all!
Solution: Hook a PCM5102 up to the Teensy 4.1 running m8 headless! It actually works!
Pins:
PCM5012 -> TEENSY
SCK -> 23
BCK -> 21
DIN -> 7
@CodeZombie
CodeZombie / supersearch.py
Created December 1, 2023 18:00
Given a huge directory a files, this script will search the content of each file, and copy it to a new directory if it contains a substring. Threaded.
import os
import threading
import shutil
from collections import namedtuple
ThreadWithData = namedtuple('thread', 'thread, filecount')
# Constants
MAX_THREADS = 12
FILES_PER_THREAD = 500
@CodeZombie
CodeZombie / fastboot_instructions.txt
Created September 3, 2023 20:13
How to fastboot into the fucking redmi note 7
I don't think anyone, at any point, actually wrote this shit down, so here I am, doing God's work:
1. Download `http://bigota.d.miui.com/tools/xiaomi_usb_driver.rar`
2. Extract.
3. Connect your phone to the pc, boot into fastboot mode.
4. In Device Manager, select the device, select `update driver`
5. Choose `browse my computer for drivers` and select the xiaomi usb driver folder.
6. It will install something, but it'll be the wrong one.
7. Select Update Driver again, choose `browse my computer for drivers`, but this time click `let me pick from a list of available drivers`
8. Select the `bootloader` option.
@CodeZombie
CodeZombie / plexpowerd.rb
Created April 22, 2023 19:08
plexpowerd.rb
#Plexhometheater closes itself after 30 minutes of inactivty
#This script checks to see if plexhometheater is off, and if it is,
#checks for any major network traffic (to indicate movie stream, or file xfer)
#if no network activity is detected, the computer shuts down.
#if network activity IS detected, plexhometheater is started again
def plexIsRunning()
command = `ps -ef|grep -v grep|grep /opt/plexhometheater/bin/plexhometheater`
if command == "" then
return false
end