Skip to content

Instantly share code, notes, and snippets.

View abersheeran's full-sized avatar
👋
玉楼金阙慵归去,且插梅花醉洛阳

Aber abersheeran

👋
玉楼金阙慵归去,且插梅花醉洛阳
View GitHub Profile
@abersheeran
abersheeran / currying.py
Created October 20, 2019 10:01
currying in Python
import typing
import inspect
import functools
def currying(func: typing.Callable) -> typing.Callable:
f = func
if inspect.ismethod(func):
partial = functools.partialmethod
@abersheeran
abersheeran / httpserver.py
Last active January 21, 2020 07:39
httpserver.py base on asyncio
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")
@abersheeran
abersheeran / parse_link.py
Created August 9, 2019 13:06
parse relative link to absolute url
@abersheeran
abersheeran / circle.js
Last active April 23, 2019 11:27
A change version from react-circle
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',
<!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>