Skip to content

Instantly share code, notes, and snippets.

View Dobby233Liu's full-sized avatar

Liu Wenyuan Dobby233Liu

View GitHub Profile
@Dobby233Liu
Dobby233Liu / clean.py
Last active February 12, 2021 08:20
Tweet cleaner
# -*- coding: utf-8 -*-
import re
import demoji
if __name__ == "__main__" and demoji.last_downloaded_timestamp() == None:
demoji.download_codes()
URL_REGEX = re.compile("http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+", flags=re.I)
HASHTAG_REGEX = re.compile("((?:^|\uFE0E|\uFE0F|$|(?!(?:[A-Za-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0300-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u0483-\u052f\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u05d0-\u05ea\u05f0-\u05f2\u0610-\u061a\u0620-\u065f\u066e-\u06d3\u06d5-\u06dc\u06df-\u06e8\u06ea-\u06ef\u06fa-\u06fc\u06ff\u0710-\u074a\u074d-\u07b1\u07ca-\u07f5\u07fa\u0800-\u082d\u0840-\u085b\u08a0-\u08b2\u08e4-\u0963\u0971-\u0983\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bc-\u09c4\u09c7\u09c8\u09cb-\u09ce\u09d7\u09dc\u09dd\u09df-\u09e3\u09f0\u09f1\u0a01-\u0a03\u0a05-\u0a0a\u0
#include <stdlib.h>
#include <x86.h>
#define lastIntroNote 0+26*2
#define lastNote song_LEN // very last entry in song
unsigned int soundIndex = 0; // NTS: use song only for indexing. NOTE: may want to expand
unsigned short soundWait = 0;
// NOTE: this is supposed to run per tick
@Dobby233Liu
Dobby233Liu / thbgm_cmt.py
Created May 23, 2021 07:07
dirty py3 to parse musiccmt.txt
with open("musiccmt.txt","r",encoding="shift-jis") as c:
cmt = c.readlines()
writemode=None
linen=0
max=9
total=0
m3u8=open("musicroom.m3u8","w",encoding="utf-8")
m3u8.write("#EXTM3U\n")
str=""
for line in cmt:
import random
random.seed()
lettertable = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz "
def rand_word():
while True:
random.seed()
r = ""
len = random.randint(6, 12)
@Dobby233Liu
Dobby233Liu / gwcb2tna2ts.js
Last active February 2, 2022 09:19
GWCB2TNA2TS - silly JS code
// Get What Can Be Crafted By Thou Numbers And Also Their Sum (GWCB2TNA2TS)
// WTFPL
// but, opitmiz and credit suggested... can you opitmiz it better than my better anyway? (optmiz my better one, not others!) tell me by forking, coding and commenting!
// beautified using https://beautifier.io
function gwcb2tna2ts(im = 4, jm = 4, km = 4)
{ // https://blog.csdn.net/cherrydreamsover/article/details/79750556 port
im++;
jm++;
km++;
var i = 0; // 百位
@Dobby233Liu
Dobby233Liu / change_inst.py
Last active April 4, 2022 07:29
Change all instruments in a MIDI file.
# 2022 Dobby233Liu
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any purpose, commercial or non-commercial, and by any
# means.
#
# In jurisdictions that recognize copyright laws, the author or authors
import json
lang_en = {}
with open("lang_en.json", "r", encoding="utf-8") as l_en_file:
lang_en = json.load(l_en_file)
lang_ja = {}
with open("lang_ja.json", "r", encoding="utf-8") as l_ja_file:
lang_ja = json.load(l_ja_file)
items = {}
; ---------------------------------------------------------------------------
cpu 68000
include "sonic3k.macrosetup.asm" ; include a few basic macros
include "sonic3k.macros.asm" ; include some simplifying macros and functions
include "sonic3k.constants.asm" ; include some constants
org 0
; ---------------------------------------------------------------------------
strip_padding = 1
Size_of_Snd_driver_guess = $1200
@Dobby233Liu
Dobby233Liu / README.md
Last active May 29, 2022 05:13
Epico "a letter of challenge" (v1.03) by @npckc translation

Requirements

  1. Drop all rpy files to game/tl/zh
  2. Drop XiaolaiSC-Regular.ttf to game/tl/zh with filename sp-xiaolai-p.ttf
  3. Drop some lines under define lang_ lines in game/screens.rpy
# Dobby233Liu: xiaolai is literally seto, but the improved version
define lang_zh = "{font=tl/zh/sp-xiaolai-p.ttf}简体中文{/font}"
"""Tool that helps decompiling a Ren'Py game. Early prototype."""
import glob
import unrpyc
import unrpa
import os
import tarfile
import traceback
import shutil
import sys