Skip to content

Instantly share code, notes, and snippets.

View renmu123's full-sized avatar

renmu123

View GitHub Profile
@renmu123
renmu123 / validator.ts
Created November 18, 2024 02:05
koa validator
import originValidators from "validator";
import { Context, Next } from "koa";
type ValidatorFunction = (value: any, args?: any) => boolean;
interface CustomValidators {
[key: string]: ValidatorFunction;
}
const customValidators: CustomValidators = {
[Script Info]
; Script generated by Aegisub 3.2.2
; http://www.aegisub.org/
Title: 诸神字幕
Original Script: 诸神字幕组
Synch Point: 0
ScriptType: v4.00+
PlayResX: 1920
PlayResY: 1080
Timer: 100.0000
@renmu123
renmu123 / javdb-zh.yml
Created January 11, 2024 12:58
javdb-zh.yml
name: JavDB-zh
sceneByFragment:
action: scrapeXPath
queryURL: https://javdb.com/search?q={filename}&f=all
queryURLReplace:
filename:
- regex: \..+$
with: ""
scraper: sceneQueryScraper
sceneByURL:
@renmu123
renmu123 / .prettierrc.json
Last active September 26, 2022 10:38
vscode 配置
{
"trailingComma": "es5",
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": false,
"arrowParens": "always"
}
from flask import Flask
from flask_restful import Resource, Api, reqparse
import werkzeug, os
app = Flask(__name__)
api = Api(app)
UPLOAD_FOLDER = 'static/img'
parser = reqparse.RequestParser()
parser.add_argument('file',type=werkzeug.datastructures.FileStorage, location='files')