使用 MitM 加代理工具实现 OpenAI API 请求全局重定向
- 在 Surge 中安装 CA 证书并使用
AIProxy.sgmodule模块。
| #!/usr/bin/env python | |
| import itertools | |
| import json | |
| import logging | |
| import os | |
| import re | |
| import shutil | |
| import sys | |
| import zlib |
| #!/usr/bin/env sh | |
| HOST="overleaf.cipsup.cn" | |
| PROJECT_ID="627220cc14ecd4008b9ae727" | |
| DIRECTORY="$HOME/Library/CloudStorage/OneDrive-Personal/Backups/Overleaf/$PROJECT_ID" | |
| OUTPUT="main_`date +"%Y-%m-%dT%H%M"`.zip" | |
| COOKIE="$OVERLEAF_COOKIE" | |
| curl "http://$HOST/project/$PROJECT_ID/download/zip" \ | |
| -H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Safari/605.1.15" \ |
| on open location address | |
| if {address starts with "org-protocol"} then | |
| do shell script "zsh -c 'ec \"" & address & "\"'" | |
| else | |
| do shell script "zsh -c 'ec --eval '\"'\"'(browse-url \"" & address & "\")'\"'\"''" | |
| end if | |
| end open location | |
| on open filenames | |
| set args to "" |
| settings.scrollStepSize = 100 | |
| settings.focusAfterClosed = "last" | |
| settings.hintAlign = "left" |
| // ==UserScript== | |
| // @name Arxiv titlatorizer | |
| // @namespace Titlatorizer | |
| // @version 0.1 | |
| // @description Set correct tab <title> on arXiv pages. | |
| // @author Tianshu Wang | |
| // @match https://arxiv.org/pdf/* | |
| // @grant GM_xmlhttpRequest | |
| // ==/UserScript== | |
| // |
| ;;; System interaction function | |
| (defun supress-frame-splitting (&rest r) | |
| (let ((frame-name (frame-parameter nil 'name))) | |
| (when (or (equal "capture" frame-name) | |
| (equal "agenda" frame-name)) | |
| (delete-other-windows)))) | |
| (defun org-capture-finalize@after (&rest r) | |
| (when (equal "l" (plist-get org-capture-plist :key)) | |
| (run-at-time 0 nil #'osx-switch-back-to-previous-application)) |
| // ==UserScript== | |
| // @name Redirect Huxiu Mobile Link | |
| // @namespace https://gist.github.com/TshuW/136f461b93dc258f6322b496fd656717 | |
| // @version 0.1 | |
| // @description Redirect m.huxiu.com to www.huxiu.com | |
| // @author Tshu Wang | |
| // @match m.huxiu.com/article/* | |
| // @grant none | |
| // ==/UserScript== |
| { | |
| "title": "SpaceFN", | |
| "rules": [ | |
| { | |
| "description": "SpaceFN: Space enables SpaceFN mode (see: https://geekhack.org/index.php?topic=51069.0 & https://spacelauncherapp.com)", | |
| "manipulators": [ | |
| { | |
| "type": "basic", | |
| "from": { | |
| "key_code": "spacebar" |
| // C++ includes used for precompiling -*- C++ -*- | |
| // Copyright (C) 2003-2013 Free Software Foundation, Inc. | |
| // | |
| // This file is part of the GNU ISO C++ Library. This library is free | |
| // software; you can redistribute it and/or modify it under the | |
| // terms of the GNU General Public License as published by the | |
| // Free Software Foundation; either version 3, or (at your option) | |
| // any later version. |