Skip to content

Instantly share code, notes, and snippets.

Avatar

Julian Uy uyjulian

View GitHub Profile
View fix_rpm_signature.py
# References:
# https://github.com/ashang/unar/blob/473488cc612c3f47e1c76f9baf92d268db259dc1/XADMaster/XADRPMParser.m
# https://refspecs.linuxbase.org/LSB_3.1.1/LSB-Core-generic/LSB-Core-generic/pkgformat.html
import os
import sys
import hashlib
with open(sys.argv[1], "r+b") as f:
View split_rpm.py
# References:
# https://github.com/ashang/unar/blob/473488cc612c3f47e1c76f9baf92d268db259dc1/XADMaster/XADRPMParser.m
# https://refspecs.linuxbase.org/LSB_3.1.1/LSB-Core-generic/LSB-Core-generic/pkgformat.html
import os
import sys
import shutil
with open(sys.argv[1], "rb") as f:
View select_macros.pcre
_bittestandset\(\(signed __int32 \*\)&(.*?)\.fds_bits\[(.*?) >> 5\], (.*?) & 0x1F\); -> FD_SET($3, $1)
_bittest\(\(const signed __int32 \*\)(.*?)\.fds_bits\[(.*?) >> 5\], (.*?) & 0x1F\) -> FD_ISSET($3, $1)
View old_ctype_b_glibc_refactors.txt
_ctype_b\[(.*?)\] & 0x1000 -> isxdigit($1)
_ctype_b\[(.*?)\] & 0x2000 -> isspace($1)
_ctype_b\[(.*?)\] & 0x4000 -> isprint($1)
_ctype_b\[(.*?)\] & 0x8000 -> isgraph($1)
_ctype_b\[(.*?)\] & 0x100 -> isupper($1)
_ctype_b\[(.*?)\] & 0x200 -> islower($1)
_ctype_b\[(.*?)\] & 0x400 -> isalpha($1)
_ctype_b\[(.*?)\] & 0x800 -> isdigit($1)
_ctype_b\[(.*?)\] & 0x1 -> isblank($1)
_ctype_b\[(.*?)\] & 0x2 -> iscntrl($1)
View fx_shaderkeywords_collect.py
if True:
import pathlib
import sys
import json
project_path = pathlib.Path(sys.argv[1])
items = {}
for file in sorted(project_path.glob('**/*')):
if str(file).endswith(".shaderkeywords.txt"):
View sen4_voice_tbl_decode.py
# Sen4 voice table decode
import struct
import functools
import itertools
import sys
import os
import io
View tjs_splittest.tjs
Debug.message(("").split(/\[r\]|\n/)[0]);
View audio_timing_test.tjs
@if(0)
System.setArgument("-deffont", Font.addFont("font.otf")[0]);
@endif
// stretchCopy 等のテスト
Layer.affineBlend = function(src, sleft, stop, swidth, sheight, affine, A, B, C, D, E, F, opa=255, type=stNearest) {
this.operateAffine(src, sleft, stop, swidth, sheight, affine, A, B, C, D, E, F, omOpaque, opa, type);
};
Layer.affinePile = function(src, sleft, stop, swidth, sheight, affine, A, B, C, D, E, F, opa=255, type=stNearest) {
View timer_test.tjs
{
global.System.exitOnNoWindowStartup = false;
global.timer = new Timer(function() { Debug.message("xex"); }, '');
global.timer.interval = 50;
global.timer.enabled = true;
}
View tjs_funcs_optimize_test.tjs
function parseKeyFrame_old(keyframe)
{
if(keyframe[0] != "(")
throw new Exception("キーフレームが解析できません。: "+keyframe);
keyframe = keyframe.substr(1);
var keys = [];
var pos = keyframe.indexOf(")(");
while(pos >= 0)
{
keys.add(keyframe.substr(0, pos));