Skip to content

Instantly share code, notes, and snippets.

Avatar
🤪
Struggling in a magic amount of school and open source work

Allan Chain AllanChain

🤪
Struggling in a magic amount of school and open source work
View GitHub Profile
@AllanChain
AllanChain / remove_parentheses.pyw
Created Sep 27, 2020
Removes parentheses in filename. Very useful for files downloaded from course.pku.edu.cn
View remove_parentheses.pyw
from sys import argv
import os
import re
pattern = re.compile(r'^(.*?)(\(\d+\))+\.(.*?)$')
if __name__ == "__main__":
for file_to_rename in argv[1:]:
if os.path.isfile(file_to_rename):
match_result = re.match(pattern, file_to_rename)
@AllanChain
AllanChain / profiles.json
Last active Apr 24, 2020
Windows Terminal Configuration
View profiles.json
// This file was initially generated by Windows Terminal 0.11.1121.0
// It should still be usable in newer versions, but newer versions might have additional
// settings, help text, or changes that you will not see unless you clear this file
// and let us generate a new one for you.
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
@AllanChain
AllanChain / hole.py
Last active Jun 21, 2020
网页版树洞渐变色
View hole.py
'''
网页版树洞从 Alice 到 Zombie Zach 的颜色渐变
https://pkuhelper.pku.edu.cn/hole/##1264962
参考了网页版树洞的颜色生成机制,值越接近则颜色越接近。
可以通过更改 i 的值(0 到 1)来改变从谁开始
'''
NAMES = [
'Alice',
@AllanChain
AllanChain / wtContextMenu.reg
Last active Apr 25, 2020
Add "open wt" and "wt with profile" to context menu
View wtContextMenu.reg
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\ContextMenus\wtMore]
[HKEY_CLASSES_ROOT\Directory\ContextMenus\wtMore\shell]
[HKEY_CLASSES_ROOT\Directory\ContextMenus\wtMore\shell\cmd]
"Icon"="C:\\Windows\\SysWOW64\\cmd.exe"
"MUIVerb"="cmd"
@AllanChain
AllanChain / dockertags
Last active Feb 29, 2020
List docker image tags with 163 mirror
View dockertags
#!/bin/bash
# From https://stackoverflow.com/a/39454426/8810271
if [ $# -lt 1 ]
then
cat << HELP
dockertags -- list all tags for a Docker image on a remote registry.
EXAMPLE:
View PKUAutoClick.user.js
// ==UserScript==
// @name PKU Auto Click
// @namespace https://gist.github.com/AllanChain/c0782061f9e9836e2807a81acfe3b254
// @version 2.2
// @description 自动点击 PKU IAAA,教学网和邮箱的登录键,首次使用需手动点击一次以使插件记录密码。
// @icon https://www.pku.edu.cn/favicon.ico
// @author Allan Chain
// @copyright 2020, Allan Chain
// @homepageURL https://gist.github.com/AllanChain/c0782061f9e9836e2807a81acfe3b254
// @supportURL https://gist.github.com/AllanChain/c0782061f9e9836e2807a81acfe3b254
You can’t perform that action at this time.