利用 NGINX 的 Stream 模塊 sni_preread 功能,可以做到讓 Trojan 和其他網站在同一台機器上共享 443 端口。
This file contains hidden or 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
| {% macro render_pagination( | |
| pagination, | |
| endpoint=None, | |
| prev=('«')|safe, | |
| next=('»')|safe, | |
| size=None, | |
| ellipses='…', | |
| args={}, | |
| fragment='', | |
| align='' |
This file contains hidden or 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
| {% macro render_pagination(pagination, endpoint) %} | |
| <ul class="pagination"> | |
| {% if pagination.has_prev %} | |
| <li> | |
| <a href="{{ url_for(endpoint, page=pagination.prev_num) }}" aria-label="Previous"> | |
| <span aria-hidden="true">«</span> | |
| </a> | |
| </li> |
This file contains hidden or 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 os | |
| import boto3 | |
| from fnmatch import fnmatch | |
| from botocore.config import Config | |
| from traceback import format_exc | |
| from multiprocessing import Process, Queue, Pipe | |
| from concurrent.futures import ThreadPoolExecutor | |
| class DownloadException(Exception): |
This file contains hidden or 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
| try: | |
| from xml.etree.cElementTree import XML | |
| except ImportError: | |
| from xml.etree.ElementTree import XML | |
| import zipfile | |
| """ | |
| Module that extract text from MS XML Word document (.docx). | |
| (Inspired by python-docx <https://github.com/mikemaccana/python-docx>) |
This file contains hidden or 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
| """ | |
| draws many samples from a diffusion model by slerp'ing around | |
| the noise space, and dumps frames to a directory. You can then | |
| stitch up the frames with e.g.: | |
| $ ffmpeg -r 10 -f image2 -s 512x512 -i out/frame%04d.jpg -vcodec libx264 -crf 10 -pix_fmt yuv420p test.mp4 | |
| THIS FILE IS HACKY AND NOT CONFIGURABLE READ THE CODE, MAKE EDITS TO PATHS AND SETTINGS YOU LIKE | |
| THIS FILE IS HACKY AND NOT CONFIGURABLE READ THE CODE, MAKE EDITS TO PATHS AND SETTINGS YOU LIKE | |
| THIS FILE IS HACKY AND NOT CONFIGURABLE READ THE CODE, MAKE EDITS TO PATHS AND SETTINGS YOU LIKE |
This file contains hidden or 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
| # <type>: (If applied, this commit will...) <subject> (Max 50 char) | |
| # |<---- Using a Maximum Of 50 Characters ---->| | |
| # Explain why this change is being made | |
| # |<---- Try To Limit Each Line to a Maximum Of 72 Characters ---->| | |
| # Provide links or keys to any relevant tickets, articles or other resources | |
| # Example: Github issue #23 |
This file contains hidden or 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/env bash | |
| typeofvar () { | |
| local type_signature=$(declare -p "$1" 2>/dev/null) | |
| if [[ "$type_signature" =~ "declare --" ]]; then | |
| printf "string" | |
| elif [[ "$type_signature" =~ "declare -a" ]]; then | |
| printf "array" |
This file contains hidden or 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 starlette.applications import Starlette | |
| from starlette.responses import StreamingResponse | |
| from starlette.requests import Request | |
| from starlette.routing import Route | |
| from pathlib import Path | |
| from typing import IO, Generator | |
| """ | |
| Stream a file, in this case an mp4 video, supporting range-requests using starlette |
This file contains hidden or 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
| { | |
| "//field": "These 'double quote' 'double quote' are used as comments, because JSON doesnt' allow comment", | |
| "field": {}, | |
| "#another-field": "Another comment", | |
| "another-field": {}, | |
| "/*stuff": "Be careful to use them when you have full control of the content :)", | |
| "stuff": [], | |
| "bla": "bla" | |
| } |
NewerOlder