Skip to content

Instantly share code, notes, and snippets.

View up1's full-sized avatar

Somkiat Puisungnoen up1

View GitHub Profile
@up1
up1 / 1.md
Created April 27, 2026 05:02
Demo with SOLID principle

Demo with SOLID principle

  • SRP(Single Responsibility Principle)
  • OCP(Open/Closed Principle)
  • DIP(Dependency Inversion Principle)

Step 1 :: Order Processing with SRP

// Logic for holding order data
public class Order {
    private String orderId;
@up1
up1 / 1.txt
Last active April 22, 2026 06:43
Testing with Bun
# Upgrade
$bun upgrade
$bun -version
1.3.13
# Create a new project
$bun init demo
✓ Select a project template: Blank
@up1
up1 / 1.txt
Last active April 20, 2026 15:04
// เรียกใช้งานผ่าน LiteLLM Proxy
$curl -X POST 'http://127.0.0.1:4000/chat/completions' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer dummy' \
-d '{
"model": "openthaigpt",
"messages": [
{"role": "user", "content": "สวัสดี"}
]
}'
@up1
up1 / 1.ts
Last active April 17, 2026 09:56
Self-healing in test auotmation
// Version 1 : role
await page.getByRole('button', { name: 'OK' }).click();
// Version 2 : role
await page.getByRole('button', { name: 'Submit' }).click();
// Version 3 : role
await page.getByRole('button', { name: 'Login' }).click();
@up1
up1 / 1.txt
Last active April 17, 2026 05:06
Hello MiniMax CLI
$npm install -g mmx-cli
$mmx
███╗ ███╗███╗ ███╗██╗ ██╗
████╗ ████║████╗ ████║╚██╗██╔╝
██╔████╔██║██╔████╔██║ ╚███╔╝
██║╚██╔╝██║██║╚██╔╝██║ ██╔██╗
██║ ╚═╝ ██║██║ ╚═╝ ██║██╔╝ ██╗
╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝
@up1
up1 / 1.txt
Last active April 15, 2026 16:04
Demo with LLM Wiki
# ติดตั้ง และ ทำการ setup ผ่าน wizard แบบ step-by-step
$pip install obsidian-llm-wiki
$olw setup
╭────────────────────────────────────────────────────╮
│ obsidian-llm-wiki v0.2.0 · first run setup │
╰────────────────────────────────────────────────────╯
Step 1/4 Ollama connection
Warning: Could not reach http://localhost:11434
@up1
up1 / llm-wiki.md
Created April 11, 2026 04:10 — forked from karpathy/llm-wiki.md
llm-wiki

LLM Wiki

A pattern for building personal knowledge bases using LLMs.

This is an idea file, it is designed to be copy pasted to your own LLM Agent (e.g. OpenAI Codex, Claude Code, OpenCode / Pi, or etc.). Its goal is to communicate the high level idea, but your agent will build out the specifics in collaboration with you.

The core idea

Most people's experience with LLMs and documents looks like RAG: you upload a collection of files, the LLM retrieves relevant chunks at query time, and generates an answer. This works, but the LLM is rediscovering knowledge from scratch on every question. There's no accumulation. Ask a subtle question that requires synthesizing five documents, and the LLM has to find and piece together the relevant fragments every time. Nothing is built up. NotebookLM, ChatGPT file uploads, and most RAG systems work this way.

@up1
up1 / 1.txt
Last active April 9, 2026 02:06
Gemma 4 in Ollaman
$ollama run gemma4:e2b
pulling manifest
Error: pull model manifest: 412:
The model you are attempting to pull requires a newer version of Ollama.
Please download the latest version at:
https://ollama.com/download
@up1
up1 / 1.ts
Last active April 3, 2026 06:16
Screencast API in Playwright 1.59
// playwright.config.ts
export default defineConfig({
use: {
video: {
mode: 'on',
show: {
actions: { position: 'top-left' },
test: { position: 'top-right' },
},
},
@up1
up1 / mcp.json
Created April 2, 2026 12:43
Draw.io MCP
{
"servers": {
"drawio": {
"command": "npx",
"args": ["@drawio/mcp"]
}
}
}