Skip to content

Instantly share code, notes, and snippets.

View daviddwlee84's full-sized avatar
💭
Just wanna be happier

David Lee daviddwlee84

💭
Just wanna be happier
View GitHub Profile
@daviddwlee84
daviddwlee84 / server.py
Last active April 10, 2025 06:39
A Python real-time dashboard with TradingView Lightweight Chart example (by vibe coding)
import asyncio
import random
import time
from contextlib import asynccontextmanager
from fastapi import FastAPI, WebSocket, WebSocketDisconnect
from fastapi.responses import HTMLResponse
# Store connected WebSocket clients globally
connected_clients = []
# Task references to properly manage background tasks
@daviddwlee84
daviddwlee84 / EastMoneyPicture.html
Last active April 11, 2025 03:14
Easily get A-Share symbol market data as image from Easy Money
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>EastMoney K-line Picture Viewer</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 2em;
}
@daviddwlee84
daviddwlee84 / Makefile
Created May 8, 2025 16:33
FastAPI with `pydantic.BaseModel`, `pydantic.dataclasses`, and `dataclasses.dataclass`
.PHONY: venv install run clean
# Create virtual environment
venv:
python3 -m venv .venv
# Install dependencies
install: venv
. .venv/bin/activate && pip install fastapi "uvicorn[standard]" pydantic