Skip to content

Instantly share code, notes, and snippets.

View hui-shao's full-sized avatar

Hui-Shao hui-shao

View GitHub Profile
// ==UserScript==
// @name Xingtan Download Edited Torrents
// @namespace https://github.com/hui-shao
// @homepage https://greasyfork.org/zh-CN/scripts/484514
// @version 0.1
// @description 个人中心获取已编辑的种子的下载链接
// @license GPLv3
// @author hui-shao
// @match https://xingtan.one/userdetails.php?*
// @icon https://xingtan.one/favicon.ico
@hui-shao
hui-shao / img_color_inv.py
Created September 17, 2023 12:44
图像反色。拖放触发。
from PIL import Image, ImageChops
import sys
def invert_color(fname):
im = Image.open(fname)
im_inverted = ImageChops.invert(im)
im_inverted.save(fname.replace('.', '_inverted.'))
return im_inverted
@hui-shao
hui-shao / img_format_conv_multi.py
Created September 17, 2023 12:44
图像格式转换,批量版,自动处理序号。
from PIL import Image
import sys
import os
photo_input_path = r'.'
photo_save_path = r'./new'
photo_list = os.listdir(photo_input_path)
photo_list = [os.path.join(photo_input_path,i) for i in photo_list]
photo_num=len(photo_list)
zfill_n=len(str(photo_num)) + 1
@hui-shao
hui-shao / img_format_conv_single.py
Created September 17, 2023 12:43
基于 PIL 的图像格式转换器,单图像版,根据后缀自动调整格式。
from PIL import Image
import sys
with Image.open(sys.argv[1]) as im:
im.save(input("目标文件名(含后缀): "))
@hui-shao
hui-shao / CompactVHD.bat
Created May 20, 2023 04:04
A script helps to compact vhd/vhdx.
@echo off
if [%1]==[] (
echo ========= 使用说明=========
echo 请将文件拖放到该批处理上。
echo 按任意键退出...
pause>nul
exit /B 1
) else (
del /q DiskPart_compact_temp >nul 2>nul
@hui-shao
hui-shao / TimeSync.bat
Created April 8, 2023 07:58
Windows Time Sync
@echo off
%1 mshta vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c %~s0 ::","","runas",1)(window.close)&&exit
net start w32time
w32tm /config /manualpeerlist:"ntp.ntsc.ac.cn,0x1 cn.ntp.org.cn,0x2 time.pool.aliyun.com,0x3 cn.pool.ntp.org,0x4 time.windows.com,0x5" /syncfromflags:manual /update
w32tm /resync /rediscover
net stop w32time
pause
@hui-shao
hui-shao / bilibili_column_img_urls.js
Last active March 25, 2023 15:33
Bilibili专栏原图链接提取
// ==UserScript==
// @name Bilibili专栏原图链接提取
// @namespace https://github.com/hui-shao
// @version 0.2
// @description PC端B站专栏图片默认是经压缩过的webp。点击悬浮按钮,即可获取哔哩哔哩专栏中所有原图的直链,然后你可以使用其它工具批量下载原图。
// @author Hui-Shao
// @license GPLv3
// @match https://www.bilibili.com/read/cv*
// @icon https://www.google.com/s2/favicons?sz=64&domain=bilibili.com
// @grant none
@hui-shao
hui-shao / mooc_review_helper.js
Last active December 28, 2022 13:49
MOOC互评辅助,解放双手
// ==UserScript==
// @name MOOC互评辅助
// @namespace https://github.com/hui-shao
// @version 0.2
// @description 一键填充了属于是!
// @author Hui-Shao
// @license GPLv3
// @match *://www.icourse163.org/spoc/learn/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=icourse163.org
// @grant none
@hui-shao
hui-shao / yuketang-ppt-remove.js
Last active December 12, 2022 09:35
雨课堂显示PPT-去掉"当前页面有动画"提示
// ==UserScript==
// @name 雨课堂显示PPT-去掉"当前页面有动画"提示
// @namespace https://github.com/hui-shao
// @homepage https://greasyfork.org/zh-CN/scripts/447478
// @homepageURL https://greasyfork.org/zh-CN/scripts/447478
// @license GPLv3
// @version 0.3
// @description 自动移除"当前页面有动画,请听老师讲解"的遮罩(在雨课堂上课界面右上角也添加了按钮,也可手动点击)
// @author hui-shao
// @match https://*.yuketang.cn/lesson/fullscreen/v*
@hui-shao
hui-shao / ipv6or4_priority.bat
Created June 3, 2022 08:11
IPv6 / IPv4 优先级选择
@echo off
title IPv4 / IPv6 优先级选择工具
mode con lines=12 cols=48
color 8f
REM ________________________________________________________________
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
if '%errorlevel%' NEQ '0' (