Skip to content

Instantly share code, notes, and snippets.

View xxxzc's full-sized avatar
🤔

zicong xie xxxzc

🤔
View GitHub Profile
@xxxzc
xxxzc / sanic_reverse_proxy.py
Last active February 15, 2023 10:11
Simple sanic reverse proxy using aiohttp
# Inspired by https://gist.github.com/ashleysommer/477d2ee24f0421e56986a6f758397dcb
# Used in https://github.com/xxxzc/asar/blob/c92c646fae3c4b67fa4f81cee034b390961cb8b6/app.py#L22
# Created by xxxzc
from sanic import Request, HTTPResponse
from aiohttp import ClientSession, ClientResponse
async def reverse_proxy(r: Request, base: str, path: str) -> HTTPResponse:
"""Reverse proxy for base+path"""
async with ClientSession() as session:
@xxxzc
xxxzc / setup.md
Created November 15, 2021 03:56
在 WSL2 Arch 上安装 GNOME Shell
@xxxzc
xxxzc / modifyedid.py
Last active January 24, 2021 15:09
Modify laptop 4k display EDID for Big Sur (run at 48Hz)
# Modify laptop 4k panel edid for big sur
# This will make panel running at 48Hz
# Created by xxxzc
# Reference: http://bbs.pcbeta.com/forum.php?mod=viewthread&tid=1866466&highlight=edid
from subprocess import check_output
from base64 import b64encode
from textwrap import wrap
edid = ''
try: