Skip to content

Instantly share code, notes, and snippets.

View up1's full-sized avatar

Somkiat Puisungnoen up1

View GitHub Profile
@up1
up1 / 1.txt
Last active November 4, 2026 07:13
Demo with Reylo
Set up Reylo in this project. Reylo lets TypeScript import .sql files, with types inferred from the live database. Its docs are https://reylo.dev, with a reference page for each database (https://reylo.dev/postgres, https://reylo.dev/mysql, https://reylo.dev/sqlite, https://reylo.dev/duckdb), all served as Markdown at https://reylo.dev/llms.txt. Each step below links its section.
Each setup has a complete, working example project to copy, whose README's "How Reylo is wired in" lists every line Reylo needs. Install from npm, since the examples link local builds: https://github.com/colinhacks/reylo/tree/main/examples
1. Check the requirements and install Reylo, which brings its engine for the machine, and TypeScript 7.1 (currently in beta): https://reylo.dev/#setup
2. Add Reylo to tsconfig.json as a content mapper for the extensions .sql, .reylo.yaml and .reylo.yml, and add a typecheck script that runs tsc --noEmit --runExternalCode (after next typegen on Next.js): https://reylo.dev/#typescript
3. Make .sql i
@up1
up1 / 1.txt
Created October 31, 2026 04:39
Playwright 1.64.1 + firefox + MacOS 27
$npx playwright --version
Version 1.64.1
$npx playwright open --browser=firefox https://example.com
Error: command.parse: Failed to launch the browser process.
Browser logs:
<launching> ~/Library/Caches/ms-playwright/firefox-1555/firefox/Nightly.app/Contents/MacOS/firefox -no-remote -wait-for-browser -foreground -profile /var/folders/gg/9n8xpj3x1nxg4l657x5b8lgh0000gn/T/playwright_firefoxdev_profile-4IJULd -juggler-pipe -silent
<launched> pid=7365
@up1
up1 / 1.txt
Last active October 30, 2026 14:16
pgx :: postgres for AI Agent
$curl -fsSL https://pgx.dev/install | sh
pgx installer: downloading pgx-0.1.2-darwin-arm64 ...
pgx installer: verifying checksum ...
pgx installer: extracting ...
pgx installer: installed pgx 0.1.2 (engine b04e5045c2, PostgreSQL 18.6 compatible, darwin/arm64, built 2026-10-27T00:32:44Z)
pgx installer: next: pgx run
@up1
up1 / 1.txt
Last active October 27, 2026 07:20
Apple's Foundation Models on Mac)S 27
$sudo fm license
$fm
Foundation Models CLI
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⠞⠛⠳⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⣿⡀⠀⢀⣽⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣤⠴⠚⠋⢁⡼⠛⠛⠛⢧⡈⠙⠓⠦⣤⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⢠⡶⠒⠲⣦⣠⡴⠞⠋⠉⠀⠀⠀⣴⠟⠀⠀⠀⠀⠀⠹⣆⠀⠀⠀⠈⠙⠲⠦⣄⣠⠖⠒⢦⡀
⢿⡀⠀⠀⣸⣇⠀⠀⠀⠀⠀⣠⡾⠁⠀⠀⠀⠀⠀⠀⠀⠈⢳⡄⠀⠀⠀⠀⠀⣨⣇⠀⠀⢀⡿
@up1
up1 / 1.txt
Last active October 25, 2026 16:39
AI Agent for coding :: Claude
# Feature/Task Specification: [Name]
## Goal
*Describe the high-level purpose of this change and the problem it solves.*
## Scope
### Input
- [ ] Task A
- [ ] Task B
@up1
up1 / 1.txt
Last active October 14, 2026 08:00
Hello Excalidraw CLI
# ติดตั้ง
$npm install -g @excalidraw/cli
$excalidraw --version
0.2.0
# ทำการ render diagram จากไฟล์ *.excalidraw บนเครื่องโดยไม่ต้อง login ได้เลย
# ทำงานผ่าน google chrome/edge
# เพิ่ม parameter พวก padding, transparent ได้เลย
$excalidraw render demo01.excalidraw --out v1.png
@up1
up1 / 1.txt
Last active October 8, 2026 05:11
Microsoft PostgreSQL MCP
# ติดตั้ง
$npm install --global @microsoft/postgres-mcp
# ทำการ config ใน MCP ของ AI Agent
{ "mcpServers": { "postgres": { "command": "npx", "args": ["-y", "@microsoft/postgres-mcp", "run"] } } }
@up1
up1 / 1.txt
Last active October 3, 2026 16:12
Try Stitch CLI
# ติดตั้ง
$npm install -g @google/stitch
# ตรวจสอบ version
$stitch --version
0.11.0
# ทำการ login หรือ กำหนด environment variable `STITCH_API_KEY` เพื่อเข้าใช้งาน
$stitch login
@up1
up1 / 1.txt
Created October 2, 2026 06:53
WSL containers
# Manage image
$wslc image ls
$wslc image list
$wslc image prune
$wslc build // ใช้ร่วมกับ Dockerfile
# Manage container
$wslc container run
$wslc container restart
$wslc container inspect
@up1
up1 / 1.txt
Created September 30, 2026 14:12
Mermaid with Use case diagram
usecase-beta
direction LR
actor Customer
actor Support
systemBoundary Storefront
Browse("Browse catalogue")
Checkout("Checkout")
end
systemBoundary Fulfilment
Track("Track delivery")