Skip to content

Instantly share code, notes, and snippets.

View yihong0618's full-sized avatar
🏃‍♂️
Running

yihong yihong0618

🏃‍♂️
Running
View GitHub Profile
@grantslatton
grantslatton / gpt4chess.py
Created September 6, 2023 09:00
GPT4 Chess
import chess
import chess.engine
from collections import defaultdict
from marvin import ai_fn, ai_model
from pydantic import BaseModel, Field
def describe_board(board, illegal_moves):
result = ""
me = board.turn
@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
local obj = {}
obj.__index = obj
-- Metadata
obj.name = "HammerspoonSwitchIME"
obj.version = "0.1"
obj.author = "Qiangning Hong"
obj.license = "MIT"
local ENGLISH_ID = "com.apple.keylayout.US"
@PsiACE
PsiACE / Friendly-Python.md
Created January 8, 2026 18:53
Friendly Python notes

Friendly Python

本文基于 Frost Ming “friendly python” 标签下的文章,整理出偏向工程实践的开发范式、规范与典型好/坏代码范式示例。重点是“对使用者友好 + 对维护者友好”,并强调在 Python 中利用语言特性与生态扩展点进行合理抽象。

资料来源