Skip to content

Instantly share code, notes, and snippets.

View FoxeiZ's full-sized avatar
😭
Uoohhhh

Nguyen Ngoc Duy Bao FoxeiZ

😭
Uoohhhh
  • 04:43 (UTC +07:00)
View GitHub Profile
@FoxeiZ
FoxeiZ / parametric_eq_optimizer.py
Created February 16, 2025 11:14
optimize parametric eq
import numpy as np
import matplotlib.pyplot as plt
from scipy import signal
def create_filter_coeffs(filter_type, fc, gain_db, q, fs=48000):
w0 = 2 * np.pi * fc / fs
A = 10 ** (gain_db / 40)
alpha = np.sin(w0) / (2 * q)
@FoxeiZ
FoxeiZ / comic_parser.py
Created December 16, 2024 03:08
Parser for Tachiyomi -> Komga
import re
import sys
import zipfile
from pathlib import Path
from typing import Any, Union
import langcodes
import xmltodict
from threading import Lock
@FoxeiZ
FoxeiZ / .tempfile
Last active October 20, 2024 14:18
Start x11 in termux using termux-x11, with GPU acceleration.
x11-start-test --gpu --use-egl-surfaceless --gl scrcpy -b7M --no-audio -S --no-cleanup --video-codec h264 -m1000 --no-mouse-hover --max-fps 60 --fullscreen --lock-video-orientation
@FoxeiZ
FoxeiZ / termux-url-opener
Created October 15, 2024 09:45
termux-url-opener, with scripts like: open in mpv, open in mpv android (native client), and download from Yo*t*be
#!/data/data/com.termux/files/usr/bin/sh
stringContain() { [ -z "${2##*$1*}" ]; }
URL=$1
if stringContain '/c/' "$URL" || stringContain '/channel/' "$URL"; then URL="${URL}/videos"; fi
if stringContain "music.youtube.com" "$URL"; then ytMusic="true"; fi
noti() {
su -lp 2000 -c "cmd notification post -S bigtext --title '$1' lmao '$2'" > /dev/null 2>&1
@FoxeiZ
FoxeiZ / setter.sh
Created October 15, 2024 09:37
CPU Affinity Setter for Running Process
su -c 'AFF="1e"; PKG="com.YoStarEN.Arknights"; while :; do [ `pgrep -fx "$PKG"` ] && taskset -a -p "$AFF" `pgrep -fx "$PKG"`; [ $? -ne 0 ] && exit 0; sleep 5; done'
@FoxeiZ
FoxeiZ / server.py
Last active April 30, 2024 11:05
Simple http server python
from http.server import BaseHTTPRequestHandler, HTTPServer
from threading import Thread
from time import sleep
from typing import Callable
from urllib import parse
endpoints_mapping: dict[str, dict[str, Callable]] = {
"CONNECT": {},
"DELETE": {},
import json
import requests
from pprint import pprint
def base_request(
endpoint: str, request_id: str, id: str, extra: dict | None = None
) -> dict:
data = {
"context": {
@FoxeiZ
FoxeiZ / appendURL.lua
Created January 9, 2022 00:51
make it work on termux with termux-api
-- https://github.com/jonniek/mpv-scripts/blob/master/appendURL.lua
-- Author: donmaiq
-- Modifier: FoxeiZ
-- Appends url from clipboard to the playlist
-- Termux edition
local utils = require 'mp.utils'
local msg = require 'mp.msg'
--main function function append()
local clipboard = get_clipboard()
@FoxeiZ
FoxeiZ / mirror.js
Created December 3, 2021 01:26
osu beatmap mirror
// ==UserScript==
// @name beatmap mirror
// @namespace example.com
// @version 0.1
// @description read the name
// @author foxeiz
// @include /https?:\/\/osu.ppy.sh\/beatmapsets\/[0-9]
// @icon https://icons.duckduckgo.com/ip2/ppy.sh.ico
// @require https://gist.github.com/raw/2625891/waitForKeyElements.js
// ==/UserScript==