Skip to content

Instantly share code, notes, and snippets.

View Dobby233Liu's full-sized avatar

Liu Wenyuan Dobby233Liu

View GitHub Profile
Dim Wsh, Fs, WMIServ
Set Wsh = CreateObject("WScript.Shell")
Set Fs = CreateObject("Scripting.FileSystemObject")
Set WMIServ = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
MainDir = Fs.GetFile(WScript.ScriptFullName).ParentFolder.Path
Function HasArg(TargetArg)
HasArg = False
For Each Arg in WScript.Arguments
# Team Shanghai Alice "thbgm"/"ZWAV" music data
# Header is stored in thXX(tr).dat/thbgm(_tr).fmt
# See: https://github.com/thpatch/thtypes/blob/master/bgm_types.h#L38
header_file = *.fmt
subsong_spacing = (0x20 + 0x10) + (0x02 + 0x02)
name_offset = 0x00
name_size = 0x10
@Dobby233Liu
Dobby233Liu / .bash_history.sh
Last active March 18, 2023 17:30
stuff ive done to fix my "awesome random music" bookmark folder
# Prerequisite
pip install git+https://github.com/FlyingWolFox/Netscape-Bookmarks-File-Parser.git
python # Snippet 1
cd ~/storage/downloads
mkdir tmp/th && cd tmp/th
# Download descs
yt-dlp --skip-download --write-description --no-mtime $(cat ../../bookmarks_pure.txt)
@Dobby233Liu
Dobby233Liu / test.sh
Last active January 1, 2023 10:18
A way to make a video from a frame of another video and audio extracted from a song
# Download and trim audio
# yt-dlp does not work for some reason
you-get "https://music.163.com/#/song?id=1433075058"
mv "0. 惊涛落日(Official Vers.).mp3" jtlr.mp3
sox jtlr.mp3 jtlr_trim.wav trim 101.25 33
# Download video and extract a frame
# as a .png file to avoid messing with compression
yt-dlp "https://m.youtube.com/watch?v=PJuIWf-sEyA" --sub-langs en --embed-subs -f bestvideo
mv "강아지가 엉덩이를 들이미는 이유 6가지 [PJuIWf-sEyA].webm" src.webm
ffmpeg -i src.webm -vf subtitles=src.webm -ss 00:00:54 -frames:v 1 frame.png
@Dobby233Liu
Dobby233Liu / get_mods.py
Last active December 30, 2022 13:59
I hate the live_chat data format
import json
import sys
def cmd_maybe(cmd, type):
return type in cmd
def cmd_as(cmd, type):
return cmd[type]
def cmds_iter(real_iter, type):
@Dobby233Liu
Dobby233Liu / recipe.jsonc
Last active December 26, 2022 22:08
Concept for a recipe file for a kinda customizable Undertale mod patcher
{
// Behaviour of the auto-patcher is defined here
// EVERYTHING HERE is subject to change
// Always 1
"APILevel": 1,
"FriendlyName": "My Crappy Mod 2000"
"BasedOn": {
// 1 - Undertale, 2 - Deltarune SURVEY_PROGRAM (unsupported), 3 - Deltarune CH1&2
// always 1 ATM
"Game": 1,
@Dobby233Liu
Dobby233Liu / objmgr.c
Last active December 24, 2022 06:13
Attempt to write a object manager in C
#include <stdlib.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <assert.h>
#include <string.h>
/* definitions */
/* types & globals */
@Dobby233Liu
Dobby233Liu / lerp.py
Created September 10, 2022 06:27
huh
import math
osr = 2
isr = 10
smps = [0, 1]
def lerp(a, b, m):
return a + m * (b-a)
smpin = []
from io import StringIO
import struct
FILE = "D:\development\sonic-cd-disassembly\Sound Drivers\SMPS-PCM\Music\Palmtree Panic Past.bin"
PROJ = "PPZPast"
NOTES = {
0x80: "nRst",
0x81: "nC0", 0x82: "nCs0", 0x83: "nD0", 0x84: "nEb0",
0x85: "nE0", 0x86: "nF0", 0x87: "nFs0", 0x88: "nG0",
@Dobby233Liu
Dobby233Liu / ads_textdump_zh.json
Last active September 10, 2022 06:44
adifferentsnowgrave zh translation
{
"Text": [
"治愈队友",
"饶恕疲倦的敌人",
"冻结敌人",
"冰魔法伤害",
"恢复团队160HP",
"恢复120HP",
"恢复100HP",
"恢复80HP",