This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
网页版树洞从 Alice 到 Zombie Zach 的颜色渐变 | |
https://pkuhelper.pku.edu.cn/hole/##1264962 | |
参考了网页版树洞的颜色生成机制,值越接近则颜色越接近。 | |
可以通过更改 i 的值(0 到 1)来改变从谁开始 | |
''' | |
NAMES = [ | |
'Alice', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*----------------------------------------------------------------------------- | |
| Copyright (c) Jupyter Development Team. | |
| Distributed under the terms of the Modified BSD License. | |
|----------------------------------------------------------------------------*/ | |
/* | |
The following CSS variables define the main, public API for styling JupyterLab. | |
These variables should be used by all plugins wherever possible. In other | |
words, plugins should not define custom colors, sizes, etc unless absolutely | |
necessary. This enables users to change the visual theme of JupyterLab |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; This is part of my AutoHotKey [1] script. When you are in Windows Explorer it | |
; allows you to press Alt+N and type a filename, and that file is created | |
; in the current directory and opened in the appropriate editor (usually | |
; [gVim](http://www.vim.org/) in my case, but it will use whatever program is | |
; associated with the file in Windows Explorer). | |
; This is much easier than the alternative that I have been using until now: | |
; Right click > New > Text file, delete default filename and extension (which | |
; isn't highlighted in Windows 7), type the filename, press enter twice. | |
; (Particularly for creating dot files like ".htaccess".) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Adamopt | |
# This is a module implementing vanilla Adam (https://arxiv.org/abs/1412.6980). | |
export Adam, step! | |
# Struct containing all necessary info | |
mutable struct Adam | |
theta::AbstractArray{Float64} # Parameter array | |
loss::Function # Loss function | |
grad::Function # Gradient function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Windows Registry Editor Version 5.00 | |
[HKEY_CLASSES_ROOT\.md] | |
@="markdown" | |
[HKEY_CLASSES_ROOT\.md\ShellNew] | |
"NullFile"="" | |
[HKEY_CLASSES_ROOT\markdown] | |
@="Blank Markdown file" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Execute with "bun run index.ts > tailwind.gpl" | |
// | |
import colors from 'tailwindcss/colors' | |
type RGB = {r: number, g: number, b: number}; | |
function isObj(data: any): data is object { | |
return data !== null && typeof data === 'object' && !Array.isArray(data) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* mkdir ~/.goldendict/styles/arc-dark/ | |
then put this stylesheet there */ | |
body { | |
margin-top: 1px; | |
margin-right: 3px; | |
margin-left: 2px; | |
margin-bottom: 3px; | |
background: #4b5162; | |
color: white; | |
font-family: Noto Serif CJK SC, Noto Serif, Bookerly, Segoe UI, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name PKU Auto Click | |
// @namespace https://gist.github.com/AllanChain/c0782061f9e9836e2807a81acfe3b254 | |
// @version 3.5 | |
// @description 自动点击 PKU IAAA,教学网和邮箱的登录键,首次使用需手动点击一次以使插件记录密码。 | |
// @icon https://www.pku.edu.cn/favicon.ico | |
// @author Allan Chain | |
// @copyright 2020 - 2024, Allan Chain | |
// @homepageURL https://gist.github.com/AllanChain/c0782061f9e9836e2807a81acfe3b254 | |
// @supportURL https://gist.github.com/AllanChain/c0782061f9e9836e2807a81acfe3b254 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import asyncio | |
import time | |
import socket | |
import argparse | |
import aiohttp | |
class MyConnector(aiohttp.TCPConnector): |
OlderNewer