Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
Bundle the site-packages of the current python environment into a zip file
If you have any wheels at `$(pwd)/wheels`, those will be used instead of
of the locally installed packages. For instance, if my pwd looked like
|-- numpy-1.11.2-cp27-cp27mu-manylinux1_x86_64.whl
# this scripts installs necessary requirements and launches main program in
import subprocess
import os
import sys
import importlib.util
import shlex
import platform
import argparse
import json
import time
d8ahazard /
Created December 4, 2022 16:57
Home Assistant PyScript - ColorSwarm For ALl
A collection of lighting effects that runs asynchronously on Philips Hue rooms/groups.
Pyscript must be configured to expose the "hass" global variable and allow all imports
so that we can access the Hue bridge configs and entity registry.
import heapq
import logging
import random
import time
d8ahazard /
Last active October 24, 2022 07:49
Setup WSL For Dreambooth Stable Diffusion (Ubuntu)
sudo apt-get update
sudo apt-get -y upgrade
# Get git
sudo apt-get -y install git
# install conda (if not already done)
if [ ! -f "./" ]; then
d8ahazard /
Last active June 22, 2023 17:49
A utility for cleaning Plex collections and identifying orphaned media.
import os
import pathlib
import sqlite3
target_path = ""
movie_list = []
tv_list = []
collection_list = []
d8ahazard / SectorCreator.cs
Created August 27, 2019 12:32
A quickie script to take all items in a SECTR terrain chunk and add them as children of that chunk.
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
using UnityEngine.SceneManagement;
public class SectorCreator : MonoBehaviour
d8ahazard / index.php
Last active December 26, 2018 02:52
$files = glob("./profiles/*.xml");
$profiles = [];
$types = [];
$names = [];
foreach($files as $file) {
$data = new SimpleXMLElement(file_get_contents($file));
$flat = json_decode(json_encode($data), true);
$name = $flat['@attributes']['name'];
$dpTypes = [];
d8ahazard / swagger2Php.php
Last active February 29, 2024 07:18
Auto-generate PHP class from swagger documentation...
// You need to have guzzleHttp installed, and require the vendor path here...
$url = $_GET['url'];
$swaggerApi = json_decode(file_get_contents("$url"), true);
$outFile = pathinfo($url)['filename'] . ".php";
$paths = $swaggerApi['paths'];
$defs = $swaggerApi['definitions'];