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
# Forward http://127.0.0.1:8080 to example.com/ | |
# http://127.0.0.1:8081 to example.com/foo/ | |
server { | |
listen 80; | |
server_name example.com; | |
location / { | |
proxy_pass http://127.0.0.1:8080/; | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade $http_upgrade; |
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
STUDENT_ID = '' | |
PASSWORD = '' | |
NAME_CN = '' | |
NAME_EN = '' |
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 计蒜客助手 Jisuanke Helper | |
// @namespace http://tampermonkey.net/ | |
// @version 1.2.2 | |
// @description 1. 取消复制限制; 2. 选择题显示序号(一般情况最小的几个是答案); 3. 跳过强制等待; 4. 双击单行或块代码区域复制代码; 5. 跳过点击直接复制提示内容 | |
// @author yusanshi | |
// @source https://gist.github.com/yusanshi/981b5926851d4cde3d67536b279cbf34 | |
// @match http://www.jisuanke.com/course/* | |
// @match https://www.jisuanke.com/course/* | |
// @grant none |
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
// Create a monitored variable, do something when its value is being set or changed | |
// Licensed under MIT license. For a copy, see <https://opensource.org/licenses/MIT>. | |
// Copyright (c) 2021 yusanshi | |
// Define the class | |
// Since class declarations are not hoisted like function declarations, | |
// you first need to declare your class and then access it | |
class MonitoredVariable { |
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
/** | |
* A wrapper for fillText, with add additional options | |
* @param {string} text Text string to render into the context. | |
* @param {number} x The x-axis coordinate of the point at which to begin drawing, in pixels | |
* @param {number} y The y-axis coordinate of the point at which to begin drawing, in pixels | |
* @param {number} charSpace Proportion of canvas.width (%), can be negative or postive | |
* @param {number} _distortion Distortion factor. Not implemented yet | |
* @param {number} horizontalOffset Proportion of canvas.width (%) | |
* @param {number} verticalOffset Proportion of canvas.height (%) | |
*/ |
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
""" | |
Automatic migration of subscriptions to another | |
YouTube account with Python and Selenium. | |
1. Install selenium from pypi: | |
$ pip install selenium | |
2. Go to the down of page https://www.youtube.com/subscription_manager | |
and download your current subscriptions feed. | |
Save file as subscription_manager.xml. |
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
import face_recognition | |
import argparse | |
from PIL import Image, ImageDraw, ImageFont | |
parser = argparse.ArgumentParser() | |
parser.add_argument('--input_path', type=str, required=True) | |
parser.add_argument('--mosaic_path', type=str, required=True) | |
parser.add_argument('--output_path', type=str, default='./output.jpg') | |
parser.add_argument('--zoom_coefficient', type=float, default=2.0) | |
parser.add_argument('--font_size', type=int, default=120) |