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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>404</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link rel="stylesheet" href="https://cdn.bootcss.com/normalize/8.0.1/normalize.min.css"> | |
</head> | |
<style> |
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
class Circle extends Component { | |
static defaultProps = { | |
number: 0, | |
max_number: 255, | |
animate: true, | |
animationDuration: '1s', | |
showPercentage: true, | |
showPercentageSymbol: true, | |
progressColor: 'rgb(76, 154, 255)', | |
bgColor: '#ecedf0', |
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
def parse_link(current_url: str, link: str) -> str: | |
""" parse relative url to absolute url """ | |
# http(s)://example.com/example | |
if link.startswith("http"): | |
return link | |
# //example.com/example | |
if link.startswith("//"): | |
return current_url.split("//")[0] + link | |
# /example | |
if link.startswith("/"): |
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 sys | |
import socket | |
import asyncio | |
import typing | |
import signal | |
import logging | |
import logging.config | |
from http import HTTPStatus | |
logger: logging.Logger = logging.getLogger("httpserver") |
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 typing | |
import inspect | |
import functools | |
def currying(func: typing.Callable) -> typing.Callable: | |
f = func | |
if inspect.ismethod(func): | |
partial = functools.partialmethod |
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
{ | |
"$schema": "https://aka.ms/terminal-profiles-schema", | |
// Add custom actions and keybindings to this array. | |
// To unbind a key combination from your defaults.json, set the command to "unbound". | |
// To learn more about actions and keybindings, visit https://aka.ms/terminal-keybindings | |
"actions": | |
[ | |
// Copy and paste are bound to Ctrl+Shift+C and Ctrl+Shift+V in your defaults.json. | |
// These two lines additionally bind them to Ctrl+C and Ctrl+V. | |
// To learn more about selection, visit https://aka.ms/terminal-selection |
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
server { | |
listen 443 ssl; | |
server_name websocks; | |
root html; | |
ssl_certificate /path/to/websocks.pem; | |
ssl_certificate_key /path/to/websocks.key; | |
ssl_session_timeout 5m; | |
location / { |
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 asyncio | |
from asyncio import AbstractEventLoop, Task, Future | |
from typing import Set, Optional, Coroutine | |
def onlyfirst(*coros: Coroutine, loop: Optional[AbstractEventLoop] = None) -> Future: | |
""" | |
Execute multiple coroutines concurrently, returning only the results of the first execution. | |
When one is completed, the execution of other coroutines will be canceled. | |
""" |
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
curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun |
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 sys | |
import asyncio | |
import typing | |
import logging | |
import signal | |
from socket import AF_INET, AF_INET6, inet_pton | |
try: | |
import uvloop |
OlderNewer