Skip to content

Instantly share code, notes, and snippets.

View up1's full-sized avatar

Somkiat Puisungnoen up1

View GitHub Profile
@up1
up1 / DemoGatewayTest.java
Created March 30, 2025 14:32
Spring Boot testing with WireMock
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.web.client.TestRestTemplate;
import org.springframework.http.ResponseEntity;
import org.wiremock.spring.EnableWireMock;
@up1
up1 / 1.txt
Last active March 30, 2025 11:23
Dagger LLM
// ขั้นตอนที่ 1
$export ANTHROPIC_API_KEY=<your key>
$dagger
─ ←↑↓→ move · home first · end last · +/- verbosity=1 · q quit ─────────────────────────────● connect 0.1s
● connect 0.2s
│ ● connecting to engine 0.0s │✔ connect 0.3s ✔ connect 0.3s
Dagger interactive shell. Type ".help" for more information. Press Ctrl+D to exit.\n
✔ connect 0.3s ⋈
─ esc nav mode · > run prompt ──────────────────────────────────────────────────────────────
@up1
up1 / 1.json
Last active March 29, 2025 09:25
MCP with Playwright
// with Head or UI mode
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": [
"@playwright/mcp@latest"
]
}
@up1
up1 / 1.txt
Created March 21, 2025 16:28
MokAPI
$npm install -g go-mokapi
// HTTP server จากไฟล์ Swagger/OpenAPI
$mokapi --providers-http-url https://petstore3.swagger.io/api/v3/openapi.json
// Apache Kafka จากไฟล์ AsyncAPI
$mokapi --providers-file-filename asyncapi.yaml
@up1
up1 / 1.java
Last active March 21, 2025 14:04
Demo code of Java 24
import static java.lang.System.out;
public class Main {
void main() {
var main = new Main();
var grade = main.calculateGrade(50);
out.println(grade);
}
public String calculateGrade(int score) {
@up1
up1 / 1.txt
Last active March 14, 2025 06:15
Redis :: Data structure
// เพิ่มข้อมูล
$LPUSH datas tx1
$LPUSH datas tx2
$LPUSH datas tx3
$LPUSH datas tx4
$LPUSH datas tx5
// ดึงข้อมูล
$LRANGE datas 0 -1
@up1
up1 / 1.txt
Last active March 11, 2025 15:15
Hello Lynxjs
$npm create rspeedy@latest
Need to install the following packages:
[email protected]
Ok to proceed? (y)
> npx
> create-rspeedy
@up1
up1 / main.dart
Created March 6, 2025 04:59
Generated code from pixels2flutter.dev
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
@up1
up1 / main.dart
Created March 5, 2025 18:09
Generated code from pixels2flutter.dev
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
@up1
up1 / main.dart
Created March 5, 2025 17:46
Generated code from pixels2flutter.dev
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(