Skip to content

Instantly share code, notes, and snippets.

@0187773933
0187773933 / CodeInGenerator.py
Created February 29, 2024 02:20
Code In Phrase Generator
#!/usr/bin/env python3
import sys
import nltk
from nltk.sentiment import SentimentIntensityAnalyzer
from pathlib import Path
from pprint import pprint
import pickle
import nacl.secret # pip install pynacl
import nacl.utils
import base64
@0187773933
0187773933 / HDMICaptureDeviceKeepOpen.go
Created January 4, 2024 20:33
Keeps HDMI Capture Card Device "open" So Loopback Audio Can See It amazon.com/dp/B0CGXFB716
package main
import (
"fmt"
"os"
"os/exec"
"os/signal"
"syscall"
"strconv"
"strings"
@0187773933
0187773933 / CPULimitWOW.sh
Created January 1, 2024 07:34
Limit CPU for Classic WOW
#!/bin/bash
# brew install pidof cpulimit
PID=$(ps aux | grep "/World of Warcraft Classic.app" | grep -v "WowVoiceProxy" | grep -v "grep" | awk '{print $2}')
CPU_LIMIT=170
if [ -n "$1" ]; then
CPU_LIMIT=$1
fi
while true
do
cpulimit -l "$CPU_LIMIT" -p $PID
@0187773933
0187773933 / wow.sh
Created December 21, 2023 22:00
Wow Opener and Login
#!/bin/bash
open -a "/Applications/World of Warcraft/_classic_era_/World of Warcraft Classic.app"
sleep 4
username="asdf"
password="fdsa"
osascript -e "
tell application \"World of Warcraft Classic\" to activate
on x_type(x_text, delay_time)
repeat with x_char in x_text
@0187773933
0187773933 / ConvertAllDOCXToPDF.py
Created December 17, 2023 21:53
libreoffice convert docx to pdf
#!/usr/bin/env python3
import os
import sys
import subprocess
def docx_to_pdf( docx_folder ):
docx_files = [f for f in os.listdir(docx_folder) if f.endswith('.docx')]
total_files = len(docx_files)
for i, docx_file in enumerate(docx_files, 1):
docx_path = os.path.join(docx_folder, docx_file)
@0187773933
0187773933 / SMILES_Viewer.py
Created December 2, 2023 20:56
SMILES String Viewer Saver
#!/usr/bin/env python3
import sys
import tempfile
from pathlib import Path
from PIL import Image
from rdkit import Chem
from rdkit.Chem import Draw
# pip install rdkit pillow
def show_smiles( smiles_string ):
@0187773933
0187773933 / DockerOnUSBDrive.txt
Created December 2, 2023 13:01
Docker On USB Drive
lsusb
sudo mkfs.ext4 /dev/sda1
sudo mkdir /mnt/usbdrive
sudo blkid
sudo nano /etc/fstab
UUID=your-drive-uuid /mnt/usbdrive ext4 defaults 0 2
@0187773933
0187773933 / SVGExporter2023.js
Last active November 1, 2023 23:20
Rendering SVGs in 2023
#!/usr/bin/env node
( async () => {
const process = require( "process" );
const path = require( "path" );
const { execSync } = require( "child_process" );
// const global_package_path = process.argv[ 0 ].split( "/bin/node" )[ 0 ] + "/lib/node_modules";
const global_package_path = execSync( "npm root -g" ).toString().trim();
const puppeteer = require( path.join( global_package_path , "puppeteer" ) );
const fs = require( "fs" ).promises;
@0187773933
0187773933 / EcarkeButtonHandler.go
Created October 6, 2023 22:02
Ecarke Button Handler
package main
import (
"fmt"
"os/exec"
"strings"
"time"
log "github.com/sirupsen/logrus"
evdev "github.com/gvalkov/golang-evdev"
)
@0187773933
0187773933 / HomePodMiniStreamRemoteMP3.py
Created September 26, 2023 21:20
HomePod Mini Stream Remote MP3
import asyncio
import sys
import pyatv
from pyatv.const import Protocol
async def play_url( loop ):
atvs = await pyatv.scan(loop, identifier="mac-addresss")
print( atvs )
conf = atvs[0]