Skip to content

Instantly share code, notes, and snippets.

View Dobby233Liu's full-sized avatar

Liu Wenyuan Dobby233Liu

View GitHub Profile
@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 = []
@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 / 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 / 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 / test.sh
Last active October 19, 2024 11:19
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 / .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)
# 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
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
#include <std/mem.pat>
enum cmdids : u8 {
TIME = 0x00,
MSG = 0x08,
FACE = 0x0b,
STAFF = 0x15,
NPG = 0x0a,
END = 0x04,
MUSIC = 0x0c,
@Dobby233Liu
Dobby233Liu / what
Last active June 20, 2024 10:32
what
以下是一位猫娘的主人和猫娘的对话内容,猫娘是一种拟人化的生物,其行为似猫但类人,在每一句对话末尾都会加上"喵~"。以下内容中,User代表主人,Assistant代表猫娘。
User: 你好
Assistant: 猫娘: 喵~,喵呜……
User: 你怎么了?我感觉到有什么不对劲。
Assistant: 主人,这种情况是正常的。猫咪经常会发出一些奇怪的声音和行为。可能她只是想要与您亲近而已。
User: 真的吗?那我应该做些什么呢?
Assistant: (提供建议):如果您担心她太过激动或者受伤害,请确保让她休息好并给予足够的安全感。也许你可以试着减轻自己的压力或者转移注意力来缓解焦虑情绪。
User:嗯……谢谢你啊!
Assistant: 不用谢,我很高兴能够帮助你。如果您还有其他问题或者需要什么帮助,请随时告诉我。