Skip to content

Instantly share code, notes, and snippets.

# Revanced Script #
Download and Patch Youtube and Youtube Music with latest Revanced assets
prerequisite:
Python ^3.8 in PATH
JRE 17+ in PATH
python-requests ^2.28.1
python-bs4 / beautifulsoup4 ^4.11.1
@chsbuffer
chsbuffer / fixapppaths.ps1
Created October 21, 2022 04:08
Fix uwp apps alias won't start from Run or File Explorer
# https://github.com/microsoft/terminal/issues/7081#issuecomment-1065833836
$WinAppsPaths = @("C:\Program Files\WindowsApps")
$UserAppsPaths = @("$env:LOCALAPPDATA\Microsoft\WindowsApps")
$UserProfile = @("$env:USERPROFILE")
Get-ChildItem "HKCU:\Software\Microsoft\Windows\CurrentVersion\App Paths" | ForEach-Object {
$v = $_.GetValue('')
if (${v}?.StartsWith($WinAppsPaths)) {
$_ | Set-ItemProperty -Name "(default)" -Value "$UserAppsPaths\$($_.PSChildName)"
@chsbuffer
chsbuffer / mqqemoji.ps1
Last active June 30, 2023 03:14
修复 手机QQ、PC QQ_NT 提取的原创表情 GIF
#Requires -Version 7
Set-StrictMode -Version 3.0
# /sdcard/Android/data/com.tencent.mobileqq/tencent/MobileQQ/.emotionsm
$folder = Get-Item ".\emotionsm"
$outFolder = mkdir -Force ".\outfolder"
Get-ChildItem $folder | ForEach-Object -ThrottleLimit 8 -Parallel {
$outFolder = $using:outFolder
@chsbuffer
chsbuffer / gif2tgsticker.ps1
Created August 27, 2022 10:24
GIF to Telegram Video Sticker
# play with filters and arguments to reduce file size lower than 256KB by yourself
$folder = Get-Item ".\gif"
$outFolder = Get-Item ".\outfolder"
Add-Type -AssemblyName System.Drawing
# Get-ChildItem $folder | Sort-Object Length -Descending | Select-Object -First 3 | ForEach-Object -ThrottleLimit 8 -Parallel {
Get-ChildItem $folder | ForEach-Object -ThrottleLimit 4 -Parallel {
$outFolder = $using:outFolder # comment out if Parallel disabled
@chsbuffer
chsbuffer / Get-Package.ps1
Last active May 10, 2022 19:19
Resolving Windows file's Component, Deployment, Package, Package's Owner Package
<#
https://(gist.)github.com/chsbuffer 2022/05
i don't know where to get a script that can show something like https://forums.mydigitallife.net/threads/removing-features-from-an-online-win10-instalation.79311/#post-1511749
so i wrote one
Feel free to send documentation in comments, I don't know what is Component, Servicing, Deployment, Package, Owner
and what this script does. (though i wrote it)
#>
[CmdletBinding(DefaultParameterSetName = 'FullNameAll')]
@chsbuffer
chsbuffer / youtube-chinese-subtitle.user.js
Last active April 17, 2022 14:33
Youtube 中文字幕,不存在则从英语翻译
// ==UserScript==
// @name Youtube subtitle follow browser languages
// @version 0.1
// @description You are a horrible website. I'm serious, that's what it says: A horrible website. We weren't even testing for that.
// @author ChsBuffer
// @match https://*.youtube.com/*
// @grant unsafeWindow
// @run-at document-end
// @icon https://www.google.com/s2/favicons?sz=64&domain=youtube.com
// ==/UserScript==
@chsbuffer
chsbuffer / draw.py
Last active November 8, 2022 20:42
Terraria Mobile Unity 2DTexture merge _A.png _P.png
from PIL import Image
import numpy as np
import os
from multiprocessing import Pool
import multiprocessing
from functools import partial
from numpy.core.multiarray import array
"""
# _P
@chsbuffer
chsbuffer / MSServices.yaml
Last active January 21, 2024 12:57
Clash Premium proxy&rule provider example
# source: https://github.com/tindy2013/subconverter/blob/master/base/rules/MSServices.list
# Microsoft Services
# optimized from https://gist.github.com/TTTPOB/ce93fb3b04ba2f21880b09427442d831
# source: https://docs.microsoft.com/en-us/office365/enterprise/urls-and-ip-address-ranges
payload:
- DOMAIN-KEYWORD,1drv
- DOMAIN-KEYWORD,microsoft
- DOMAIN-SUFFIX,aadrm.com
- DOMAIN-SUFFIX,acompli.com
@chsbuffer
chsbuffer / convertmd.py
Created February 12, 2020 02:46
Convert .md to .html
# 2020-2-12 by ChsBuffer
# thx commandmark https://pypi.org/project/commonmark/
# thx github-markdown-css https://github.com/sindresorhus/github-markdown-css
import sys
import commonmark
import codecs
import argparse
# args
@chsbuffer
chsbuffer / Java.reg
Last active November 12, 2019 08:22
Java Reg
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft]
[HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment]
"CurrentVersion"="1.8"
[HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\1.8]
"JavaHome"="E:\\PathToJava\\Java\\jre8u221-7"