Skip to content

Instantly share code, notes, and snippets.

@PMExtra
PMExtra / MacKeyboard.ahk
Last active June 16, 2022 11:39
[MacKeyboard] AutoHotkey
SendMode Input
ConfirmToSignOut() {
MsgBox 0x40034, Confirm, Are you sure you want to quit all applications and log out now?`n`nIf you do nothing`, you will be logged out automatically in 60 seconds., 60
IfMsgBox Yes
DllCall("ExitWindowsEx")
IfMsgBox Timeout
DllCall("ExitWindowsEx")
}
def solution(s):
if not s: return 0
result = 1
min_divisor = 2
while True:
length = len(s)
factor = 1
# loop in a preprocessed prime number list can improve performance
for n in range(min_divisor, length + 1):
@PMExtra
PMExtra / English.reg
Created December 8, 2021 10:14
[Visual Studio Explorer Integration Language Register]
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\background\shell\AnyCode]
@="@C:\\Program Files (x86)\\Common Files\\Microsoft Shared\\MSEnv\\1033\\VSLauncherUI.dll,-1002"
"Icon"="C:\\Program Files (x86)\\Common Files\\Microsoft Shared\\MSEnv\\VSLauncher.exe,-105"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\background\shell\AnyCode\command]
@="\"C:\\Program Files (x86)\\Common Files\\Microsoft Shared\\MSEnv\\VSLauncher.exe\" \"%V\" source:ExplorerBackground"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\AnyCode]
@PMExtra
PMExtra / MacKeyboard.ahk
Last active June 18, 2021 07:47
[Mac Keyboard] AutoHotKey script to use macOS keyboard shortcuts in Windows.
SendMode Input
ConfirmToSignOut() {
MsgBox 0x40034, Confirm, Are you sure you want to quit all applications and log out now?`n`nIf you do nothing`, you will be logged out automatically in 60 seconds., 60
IfMsgBox Yes
DllCall("ExitWindowsEx")
IfMsgBox Timeout
DllCall("ExitWindowsEx")
}
@PMExtra
PMExtra / config.schema.json
Last active June 18, 2021 07:45
[Xray configuration schema] Work in progress. Updated at 2021-04-29 for Xray-core v1.4.2, also compatiable with v2ray.
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$ref": "#/definitions/ConfigObject",
"$comment": "Work in progress, Updated at 2021-04-29 for Xray-core v1.4.2",
"definitions": {
"ConfigObject": {
"title": "Xray 配置",
"type": "object",
"additionalProperties": false,
"properties": {