Skip to content

Instantly share code, notes, and snippets.

View up1's full-sized avatar

Somkiat Puisungnoen up1

View GitHub Profile
@up1
up1 / 1.java
Last active August 18, 2025 15:15
Spring framework 7 and Spring Boot 4
@EnableResilientMethods
class Demo {
// 5 retry attempts and an exponential back-off strategy with a bit of jitter
@Retryable(maxAttempts = 5, delay = 100, jitter = 10, multiplier = 2, maxDelay = 1000)
public void sendNotification() {
this.jmsClient.destination("notifications").send(...);
}
//
@up1
up1 / 1.txt
Created August 15, 2025 02:34
Gemma 3 270M in Ollama
$ollama run gemma3:270m
pulling manifest
pulling 29005e200100: 22% ▕███████████ ▏ 52 MB/241 MB 6.1 MB/s 30s
@up1
up1 / 1.txt
Last active August 14, 2025 16:36
Java 25
# ทำการติดตั้งและ config Java 25 :: https://jdk.java.net/25/
$javac -version
javac 25
$java -version
openjdk version "25" 2025-09-16
OpenJDK Runtime Environment (build 25+35-3488)
OpenJDK 64-Bit Server VM (build 25+35-3488, mixed mode, sharing)
@up1
up1 / 1.txt
Last active August 14, 2025 04:55
Go 1.25.0
# Update go 1.25
$go env -w GOTOOLCHAIN=go1.25.0
$go version
go version go1.25.0 darwin/arm64
# เปิด Go doc
$go doc -http
doc: Documentation server listening on addr http://localhost:61699
@up1
up1 / 1.txt
Last active July 20, 2025 14:31
Shared memory with Cipher
// Install
$npm install -g @byterover/cipher
// Verify
$cipher --version
0.1.1
// Config API Key for OpenAI in file .env
OPENAI_API_KEY=your_openai_api_key
ANTHROPIC_API_KEY=your_anthropic_api_key
@up1
up1 / 1.txt
Last active July 7, 2025 06:10
Demo :: Task master
You are an expert at creating Product Requirements Document(PRD) based on the content provided in [Requirements] section.
List of topics in PRD
1. XXX
2. XXX
3. XXX
1. XXX
[Requirements]
@up1
up1 / 1.js
Created June 30, 2025 14:42
Workshop K6
import http from "k6/http";
import { check } from "k6";
export const options = {
stages: [
{ duration: "30s", target: 10 },
{ duration: "3m", target: 10 },
{ duration: "30s", target: 0 },
],
tags: {
@up1
up1 / 1.txt
Last active June 25, 2025 17:02
Gemini-cli
Now that all the files are created, I will run the tests to verify the implementation.
╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ ⊷ Shell npx jest (Run tests with jest.) │
│ │
│ ... first 5 lines hidden ... │
│ PASS routes/userRoutes.test.js │
│ GET /users/:id │
│ ✓ should return user details for a valid ID (19 ms) │
│ ✓ should return 404 for a non-existent user ID (4 ms) │
│ ✓ shoul
@up1
up1 / 1.py
Last active June 17, 2025 14:47
PDF with docling
from docling.document_converter import DocumentConverter
source = "./page_1.pdf"
converter = DocumentConverter()
doc = converter.convert(source).document
print(doc.export_to_markdown())
@up1
up1 / 1.txt
Last active June 15, 2025 16:16
PGLite + FastAPI
# ติดตั้ง
$pip install fastapi
$pip install py-pglite
$pip install sqlmodel
$pip install pytest
$pip install coverage
# Run test and coverage