Skip to content

Instantly share code, notes, and snippets.

View neepoo's full-sized avatar
🎯
Focusing

neepoo neepoo

🎯
Focusing
  • chengdu
  • 23:34 (UTC +08:00)
View GitHub Profile
@neepoo
neepoo / aio.py
Created April 9, 2025 16:17
sqla_async
import asyncio
from sqlalchemy.ext.asyncio import create_async_engine, AsyncSession
from sqlalchemy.orm import declarative_base, relationship, sessionmaker
from sqlalchemy import Column, Integer, String, ForeignKey, select
from sqlalchemy.orm import selectinload, joinedload
# 创建基类
Base = declarative_base()
@neepoo
neepoo / main.py
Created April 9, 2025 16:17
sqla_basic
import datetime
from sqlalchemy import Column, Integer, String, Float, ForeignKey, create_engine, select, func, Table
from sqlalchemy.orm import declarative_base, Mapped, relationship, sessionmaker
Base = declarative_base()
# 关联表
user_favorites = Table('user_favorites', Base.metadata,
Column('user_id', Integer, ForeignKey('users.id'), primary_key=True),
Column('product_id', Integer, ForeignKey('products.id'), primary_key=True)
@neepoo
neepoo / main.go
Created August 15, 2023 05:35
Calculate the size of the specified file type in the directory
package main
import (
"fmt"
"os"
"path/filepath"
"strings"
)
func main() {
@neepoo
neepoo / radix_test.go
Created May 6, 2023 05:59
10进制转换成x(2-36)进制,created by jb
package radix
import (
"strconv"
"testing"
)
func radix(x, base int) string {
var s string
if x == 0 {