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 September 28, 2026 16:28
Hello bugpatrol
# ทำการติดตั้ง Playwright และติดตั้ง browser ที่ตัว bugpatrol ต้องการ
$PLAYWRIGHT_SKIP_BROWSER_GC=1 npx -y playwright@1.48.2 install chromium
# Run โดยไม่ใช้งาน LLM
$npx bugpatrol run --no-models
@up1
up1 / 1.txt
Created September 28, 2026 09:23
SonarQube CLI
# ติดตั้งบน MacOS
$brew install sonarqube-cli
# ตรวจสอบ
$sonar -v
1.8.0
# ทำการ auth ไปยัง SonarQube server ได้ทั้ง on-cloud และ on-prem ที่ติดตั้งเอง
$sonar auth login
@up1
up1 / add_slip.html
Created September 24, 2026 05:34
Manage slip
<!DOCTYPE html><html lang="th" style=""><head><meta charset="utf-8"><meta content="width=device-width, initial-scale=1.0" name="viewport"><meta content="web_dashboard" name="shell-type"><style>@layer base{html,body{margin:0;padding:0;}body{overscroll-behavior:none;}main>:first-child{margin-top:0!important;}main>:last-child{margin-bottom:0!important;}}::-webkit-scrollbar{display:none;}</style><link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:wght,FILL@100..700,0..1&amp;display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@100..900&amp;family=Plus+Jakarta+Sans:wght@100..900&amp;display=swap" rel="stylesheet"><script src="https://cdn.tailwindcss.com"></script><script id="tailwind-config">tailwind.config = { darkMode: "class", theme: { extend: { "colors": { "on-surface": "#0b1c30", "surface-contain
@up1
up1 / 1.rs
Last active September 23, 2026 15:58
Rust :: vec vs box
use std::mem::size_of;
#[derive(Debug, Clone)]
pub struct NaiveRecord {
pub rtype: u16,
pub ttl: u32,
pub rdata: Vec<u8>, // Heap allocation per record + 24-byte Vec metadata (ptr, cap, len)
}
#[derive(Debug, Clone)]
@up1
up1 / 1.txt
Last active September 23, 2026 08:53
Hello laya-goish
# Request
curl http://localhost:8080/v1/decide \
-H 'Content-Type: application/json' \
-d '{
"model": "laya",
"state": "I was charged twice. Please refund the duplicate payment.",
"questions": {
"refund": {
"type": "noul",
"instructions": "Does the customer ask for money back?"
@up1
up1 / 1.txt
Last active September 20, 2026 16:35
Playwright MCP with Jev
// Input
1. Click americano and expresso
2. Check item in cart should = 2
3. Proceed to checkout with user=somkiat and email=somkiat@example.com
4. Check user=somkiat and email=somkiat@example.com in the checkout form
// Output
Extracted 8 task(s) from instruction: [
{ instruction: 'Click the americano item', fillValue: null },
{ instruction: 'Click the expresso item', fillValue: null },
@up1
up1 / 1.js
Last active September 18, 2026 07:19
Hello Jev
import { choice, TypeSafeClient } from "@typesafe-ai/sdk";
const client = new TypeSafeClient();
const response = await client.systemOne({
state: { document: "I was charged twice. Please fix this ASAP." },
questions: {
category: choice("What is this ticket about?", {
billing: null,
technical: null,
other: null,
@up1
up1 / 1.js
Last active September 16, 2026 16:32
Playwright 1.63
// Visual comparisons store the golden snapshot as lossless WebP.
await expect(page).toHaveScreenshot('homepage.webp');
// Standalone screenshots can trade quality for size with lossy WebP.
await page.screenshot({ path: 'homepage.webp', quality: 50 });
@up1
up1 / 1.txt
Created September 16, 2026 10:06
OWASP Skills
---
name: owasp-review
description: Describe what this skill does and when to use it. Include keywords that help agents identify relevant tasks.
---
---
applyTo: '**'
description: 'Comprehensive secure coding standards based on OWASP Top 10 2025, with 55+ anti-patterns, detection regex, framework-specific fixes for modern web and backend frameworks, and AI/LLM security guidance.'
---
# Security Standards
@up1
up1 / 1.txt
Created September 15, 2026 14:37
Playwright skill
---
name: playwright-ui-test
description: Browser automation testing skill using Playwright for UI testing
---
## Workflow of playwright-ui-test skills
1. Read requirements and identify the UI flows to be tested from <user requirement> and HTML file from user.
2. Generate test cases for each identified flow using the Playwright framework.
3. Run the generated test cases and validate the results
4. If the test cases fail, analyze the failure and fix the issues in the application or test cases and run until all test cases pass successfully.