Skip to content

Instantly share code, notes, and snippets.

pyinstaller --onefile filetranslate.py
git rebase -i --root
REM pick to edit :wq
git commit -S --amend --no-edit && git rebase --continue
REM git log --show-signature
@UserUnknownFactor
UserUnknownFactor / common_db.rb
Last active June 10, 2025 08:38
Unpacker/repacker for RPG Maker XP, VX [Ace] games
require 'zlib'
# Some data structures that are common to both VX and VX Ace.
class Rect
def initialize(x, y, width, height)
@x = x
@y = y
@width = width
@height = height
@UserUnknownFactor
UserUnknownFactor / dump_str.py
Last active May 16, 2025 09:12
Unpack/repack tools for RPG Maker VX Ace games (Python port) [Not working]
# coding: utf-8
# Alternative version that doesn't use serialization/deserialization libraries
# it modifies files directly instead.
import argparse, sys, os, glob, re, struct, csv, hashlib, math, zlib
from multiprocessing import Pool
DUMP_ALL_STRINGS = False
OUT_DIR = 'out'
@UserUnknownFactor
UserUnknownFactor / KaresekaHook.cpp
Last active September 9, 2020 15:32
KrkrExtract/KrkrzUniversalPatch fix
#include "KaresekaHook.h"
#include "MyHook.h"
#include "StreamHolderXP3.h"
#include "IStreamExXP3.h"
#include "tp_stub.h"
#include <string>
#include <vector>
using std::wstring;
#include <iostream>
import itertools
import sys
import struct
import zlib
from io import open, BytesIO, SEEK_CUR, SEEK_END # noqa
PY2 = sys.version_info[0] == 2
# Kaitai Struct runtime streaming API version, defined as per PEP-0396
# standard. Used for two purposes:
@UserUnknownFactor
UserUnknownFactor / tyranocut.cmd
Last active September 1, 2022 07:17
PowerShell and Python utility to cut data file out of combined TyranoBuilder executable
powershell -executionPolicy bypass -file "tyranocut.ps1" -Unpack -GameExeName %1
@UserUnknownFactor
UserUnknownFactor / unzip-enc.py
Last active September 30, 2021 07:39
Python utility to unpack zips with unusual file name encoding
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# unzip-enc.py
import os, sys, argparse, locale, zipfile, codecs
from charamel import Detector
def setup_console(sys_enc="utf-8"):
try:
if sys.version_info >= (3, 4):
@UserUnknownFactor
UserUnknownFactor / USBCharging.md
Last active September 2, 2020 08:05
USB Cable Resistance: Why your phone might be charging slow or not charging at all

USB Cable Resistance:
Why your phone/tablet might be charging slow

Tablets and smartphones are now ubiquitous, and almost universally, they rely on some form of USB connection to provide the power to charge the device. This is, in no doubt, because of a desire to reduce waste and meet EU regulations and has made it rather convenient for end users as cables and chargers are easy to find and are, to some degree, interchangeable. However, it does cause problems sometimes – namely slow or incomplete/inconsistent charging.

The Problem

When USB was conceived, the maximum current available was 500mA at 5V for a total of 2.5W. This is enough to power most smaller devices, but with smartphones and tablets, this is often only enough to power the device without any surplus left for charging.