Skip to content

Instantly share code, notes, and snippets.

View hizkifw's full-sized avatar
🍝

Hizkia Felix hizkifw

🍝
View GitHub Profile
--- json.hpp 2023-01-09 15:13:04.871631532 +0800
+++ json2.hpp 2023-01-09 15:13:24.414084972 +0800
@@ -6054,7 +6054,7 @@
{
case value_t::array:
{
- return *lhs.m_value.array < *rhs.m_value.array;
+ return (*lhs.m_value.array) < (*rhs.m_value.array);
}
case value_t::object:
# Options to pass to earlyoom
# /etc/default/earlyoom
EARLYOOM_ARGS="-r 3600 -n --avoid '(^|/)(init|systemd|Xorg|sshd|pipewire(-pulse)?|dunst|nitrogen|polybar|NetworkManager|dbus-daemon|xss-lock|nm-applet)$' --prefer '(^|/)(Discord|thunderbird|rust-analyzer|lens|telegram-desktop|firefox|chromium)$'"
"""
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.