Skip to content

Instantly share code, notes, and snippets.

View Dobby233Liu's full-sized avatar

Liu Wenyuan Dobby233Liu

View GitHub Profile
meta:
id: gm_iff_audo
file-extension:
- win
- dat
imports:
- /media/wav
- /media/ogg
title: "GameMaker: Studio WAD (sound-related chunks only, bytecode 14+)"
license: CC0-1.0
sFontFn = "Fonts\方正像素.TTF"
Set objShell = CreateObject("Shell.Application")
Set objFs = CreateObject("Scripting.FileSystemObject")
Set objBaseDir = objShell.Namespace(objFs.GetParentFolderName(WScript.ScriptFullName))
nWinFontNsId = &H14&
objShell.Namespace(nWinFontNsId).CopyHere objBaseDir.ParseName(sFontFn)
@Dobby233Liu
Dobby233Liu / makeloop.py
Created March 1, 2024 15:02
SATS 2013 intro/loop matcher
from glob import iglob
from objprint import op
import os
import re
DEALL_REGEX = re.compile(r"(.*)(?:[iI]ntro|[lL]oop).*\.ogg$")
def neutralize_sep(i):
return i and i.replace(os.sep, "/") or i
@Dobby233Liu
Dobby233Liu / LICENSE
Last active February 18, 2024 23:30
This overcomplicated sine distortion shader for LÖVE contains everything I need and you possibly want
Copyright (c) 2024 Liu Wenyuan
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
@Dobby233Liu
Dobby233Liu / Scripts.rvdata2-exporter.rb
Last active February 16, 2024 13:52 — forked from FiXato/Scripts.rvdata2-exporter.rb
Script to export the scripts inside the Scripts.rxdata data file to Scripts as plain text Ruby files. Deals with the invalid characters that the edgy thing that's Undertale Zero Genocide inserts in its script names.
#! /usr/bin/env ruby
# encoding: utf-8
# Script to export the scripts inside the Scripts.rxdata data file to Scripts as plain text Ruby files.
# Based on FiXato/Scripts.rvdata2-exporter.rb https://gist.github.com/FiXato/5323361
require "fileutils"
require "zlib"
class Exporter
def self.export_scripts
def stereo_vol_zero_middle(panning):
assert panning >= -1 and panning <= 1
left, right = 1, 1
if panning < 0:
right = right - abs(panning)
elif panning > 0:
left = left - abs(panning)
return left, right
from lxml import etree
import glob
from pathlib import Path
SOUND_DIR = "sound/"
AUDIO_DIR = SOUND_DIR + "audio/"
unused_audio = list(map(lambda x: x.replace("/", "\\"), glob.iglob(f"{AUDIO_DIR}/*")))
for sound_info_file in Path(".").glob(f"{SOUND_DIR}*.sound.gmx"):
@Dobby233Liu
Dobby233Liu / use_external_audio.py
Created January 21, 2024 14:12
XPath is something
from lxml import etree
import glob
def externalize(sound_info_file, streamed=True, bitrate=96, stereo=True):
sound_info_file = sound_info_file + ".sound.gmx"
sound_info = etree.parse(sound_info_file)
sound_info.find("/compressed").text = "1"
sound_info.find("/streamed").text = streamed and "1" or "0"
sound_info.find("/bitRates/bitRate").text = str(bitrate)
sound_info.find("/types/type").text = stereo and "1" or "0"
// heavily modified version of https://copyprogramming.com/howto/using-mailslots#reading-from-a-mailslot
#include <iostream>
#include <Windows.h>
#define csMe "WinlogMonitor"
#define csMailslotName "WinLog"
int main()
{
@Dobby233Liu
Dobby233Liu / isex.user.js
Last active October 1, 2023 07:05
Discord CDN timebomb informer: Prints to the console about the issued/expires search parameters in Discord attachment URLs
// ==UserScript==
// @name Discord CDN timebomb informer
// @namespace https://dobby233liu.github.io
// @version 1.0.0c
// @description Prints to the console about the issued/expires search parameters in Discord attachment URLs
// @author Liu "Dobby233Liu" Wenyuan
// @match https://media.discordapp.net/attachments/*
// @match https://cdn.discordapp.com/attachments/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=discord.com
// @grant none