Skip to content

Instantly share code, notes, and snippets.

View XCanG's full-sized avatar
💾
do impossible, beat unbeatable

XCanG XCanG

💾
do impossible, beat unbeatable
  • JumpJet
  • Baikonur
  • 11:56 (UTC +05:00)
View GitHub Profile
@XCanG
XCanG / jp_zip_extract.py
Created December 6, 2021 09:25
Extract ZIP archives what contain japanese file names, but have local encoding, therefore you get name like: В┴В┐В╚ВиР║ВЁПoВ╖Ч√ТВ╠ГЙГtГ@В┐ВсВёs1.png that you need convert. Have fallback to 7z (should be in PATH), but it will not fix names.
import sys
import os
import glob
import zipfile
import re
from colorama import init, Fore, Style
ext = re.compile(r"\.(zip|bz2|bzip2|xz|lzma|z)\Z", flags = re.I)
@XCanG
XCanG / Fix Fanbox external links.user.js
Last active July 22, 2023 00:07
Use browser addon like Tampermonkey https://www.tampermonkey.net/ to add custom JavaScript in your browser. To install click on Raw button.
@XCanG
XCanG / pixelate.py
Last active May 9, 2025 09:18
Pixelate image. Use `pixelate.py --help` to get help message. Install required libraries `pip install opencv-python numpy typer`. General usage with default params: `pixelate.py img.png`
from typing import Annotated
from pathlib import Path
import cv2
import numpy as np
import typer
app = typer.Typer(no_args_is_help=True)