Skip to content

Instantly share code, notes, and snippets.

View hizkifw's full-sized avatar
🍝

Hizkia Felix hizkifw

🍝
View GitHub Profile
"""
clipbooru.py
Go through a list of (md5).(ext), downloads them from danbooru, and compute CLIP
embeddings. Images are downloaded in parallel while inference is being done, so
this should run as fast as your hardware/network can handle.
"""
# requirements.txt
"""
@hizkifw
hizkifw / Scrape-DanbooruJSON.ps1
Created November 1, 2022 00:50
Gets all pages of Danbooru's posts.json
<#
.SYNPOSIS
Download all danbooru pages
#>
Param(
[string]$DanbooruURL = "https://danbooru.donmai.us/"
)
$DanbooruURL = $DanbooruURL.TrimEnd("/")
"""
ultra jank discord bot for automatic1111's stable diffusion webui
uses the --api
"""
import re
import os
import io
import time
import json
import base64
@hizkifw
hizkifw / dreambot.py
Created August 31, 2022 13:11
Discord bot to generate images using Stable Diffusion
"""
discord.py==2.0.1
diffusers==0.2.4
transformers
scipy
ftfy
"""
import os
import time
@hizkifw
hizkifw / hlsdump.py
Last active June 12, 2022 10:20
Dump HLS live stream into stdout. Code taken from fc2-live-dl.
import argparse
import aiohttp
import asyncio
import time
import logging
import sys
import http
import urllib.parse
FROM continuumio/anaconda3:2021.11
# Fetch Java, Scala, and Spark
RUN set -ex; \
apt-get update; \
apt-get install -y default-jre default-jdk scala gnupg; \
wget -qO /tmp/spark.tgz https://dlcdn.apache.org/spark/spark-3.2.0/spark-3.2.0-bin-hadoop2.7.tgz; \
wget -qO /tmp/spark.tgz.asc https://downloads.apache.org/spark/spark-3.2.0/spark-3.2.0-bin-hadoop2.7.tgz.asc; \
wget -qO- https://downloads.apache.org/spark/KEYS | gpg --import -; \
gpg --verify /tmp/spark.tgz.asc /tmp/spark.tgz; \

useful snippets i use for my arch setup

fix monitor colors with xrandr

xrandr --output DP-1 --set "Broadcast RGB" "Full"

disable pointer acceleration using xorg.conf

/etc/X11/xorg.conf.d/50-disable-mouse-accel.conf

stuff that made me go what the fuck?

this is a non-exhaustive list, in no particular order, of stuff I found online that makes me consider throwing all electronics away and going to live in the mountains instead. loosely inspired by the cursed iceberg.

#!/usr/bin/env python3
"""
PianoTeqnician
Reroute MIDI events to two instances of Pianoteq to circumvent the free trial
limitation on certain keys. All enabled keys are routed to one normal instance
of Pianoteq, and the disabled ones are routed to another instance, but shifted
one semitone down. Then, on that other instance of Pianoteq, tune the piano to
466 Hz to restore the pitch of the shifted notes.
@hizkifw
hizkifw / nijisanji_all_channels.js
Last active May 20, 2021 10:30
List of all Nijisanji YouTube channels + tool to generate the list
[
// NIJISANJI EN
"UCIeSUTOTkF9Hs7q3SGcO-Ow", // Elira Pendora
"UCP4nMSTdwU1KqYWu3UH5DHQ", // Pomu Rainpuff
"UCu-J8uIXuLZh16gG-cT1naw", // Finana Ryugu
// NIJISANJI KR
"UClS6k3w1sPwlVFqK3-yID5A", // Ryu Hari
"UCCHH0nWYXFZmtDS_4tvMxHQ", // Yang Nari
"UCi6nV5Z2dzFuXBzLG3P9zqQ", // Shin Kiru
"UCnzZmBOSrQf2wDBbnsDajVw", // Oh Jiyu