Skip to content

Instantly share code, notes, and snippets.

@phil616
phil616 / uv_local_install.ps1
Created April 20, 2026 07:01
make sure current dir has uv.exe file
# uv local install script
# Offline install for local uv.exe / uvx.exe / uvw.exe
# Compatible with older Windows PowerShell
$ErrorActionPreference = 'Stop'
function Write-Info($msg) {
Write-Host "[INFO] $msg" -ForegroundColor Cyan
}
@phil616
phil616 / gitea_sdk.py
Created March 8, 2025 07:19
Gitea simple sdk api
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Gitea SDK - 用于操作Gitea仓库Issue的Python工具包
这个工具包提供了一个简单的接口来操作Gitea仓库中的Issue,
包括创建、获取、更新和删除Issue等功能。
"""
@phil616
phil616 / caldav_sdk.py
Created March 8, 2025 07:06
用于处理日程的简单sdk
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import caldav
import pytz
from datetime import datetime, timedelta
from dotenv import load_dotenv
from icalendar import Calendar, Event, vText, vCalAddress
import uuid
@phil616
phil616 / email_template.html
Created September 19, 2024 13:13
a email template from pleuston press, rendering email by their template
<!DOCTYPE html>
<html>
<head>
<title>Email Service</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
margin: 10px;
@phil616
phil616 / aio_send_email.py
Created September 19, 2024 13:10
aio send email
# it provide a send email in a async way and using pydantic to verify data
from pydantic import BaseModel,Field
from typing import List,Literal,Optional
from email.mime.base import MIMEBase
import aiosmtplib
from email import encoders
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.header import Header