Skip to content

Instantly share code, notes, and snippets.

View frostming's full-sized avatar

Frost Ming frostming

View GitHub Profile
@frostming
frostming / keybase.md
Created October 29, 2024 01:39
keybase.md

Keybase proof

I hereby claim:

  • I am frostming on github.
  • I am frostming (https://keybase.io/frostming) on keybase.
  • I have a public key whose fingerprint is 1A21 DF26 CF48 7A9B 9E9B C482 7B28 4C8F CC08 5EFF

To claim this, I am signing this object:

@frostming
frostming / json_parser.py
Last active December 13, 2024 09:32
Python JSON Parser
from __future__ import annotations
import re
from typing import Any, Never
class JSONParseError(Exception):
pass
@frostming
frostming / context.py
Last active May 30, 2025 07:28
Go context in Python
import asyncio
import time
from typing import Any, Awaitable, Callable, TypeVar
Callback = TypeVar("Callback", bound=Callable[[], Any])
class Context:
def _cancel(self, msg: str | None = None) -> None:
"""Cancel the current task."""