Skip to content

Instantly share code, notes, and snippets.

View Dobby233Liu's full-sized avatar

Liu Wenyuan Dobby233Liu

View GitHub Profile
@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
View LICENSE
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.
View Scripts.rvdata2-exporter.rb
#! /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
View lobotomy.py
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
View check_used_audio.py
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
View use_external_audio.py
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"
View winlog.cpp
// 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
View isex.user.js
// ==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
@Dobby233Liu
Dobby233Liu / parseml.py
Last active September 15, 2023 13:01 — forked from urschrei/parseml.py
(Attempt to) extract (everything) from EML files (specified in command args), and write them to (a well-named) output subdir
View parseml.py
#!/usr/bin/env python
"""
2020 update:
- More iterators, fewer lists
- Python 3 compatible
- Processes files in parallel
(one thread per CPU, but that's not really how it works)
hacked to dump everything
View dectool.py
import sys
import os
from lib import enc_key, map_out, decrypt
in_file = len(sys.argv) > 1 and sys.argv[1]
while not in_file or not os.path.exists(in_file):
in_file = input("in: ")
in_file = os.path.relpath(in_file)
out_file, des_magic = map_out(in_file)
@Dobby233Liu
Dobby233Liu / README.md
Last active August 23, 2023 10:20
Two CRT shaders hastily ported for love2d