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 June 9, 2024 05:10
MSTest 3.4 + Playwright
$dotnet --version
9.0.100-preview.4.24267.66
$dotnet new list
These templates matched your input:
Template Name Short Name Language Tags
-------------------------------------------- -------------------------- ---------- --------------------------------
API Controller apicontroller [C#] Web/ASP.NET
ASP.NET Core Web API (native AOT) webapiaot [C#] Web/Web API/API/Service
@up1
up1 / docker-compose.yml
Created June 8, 2024 16:01
Grafana Alloy
services:
alloy:
image: grafana/alloy:latest
command: run --server.http.listen-addr=0.0.0.0:12345 --storage.path=/var/lib/alloy/data /etc/alloy/config.alloy
ports:
- 12345:12345
volumes:
- ./config.alloy:/etc/alloy/config.alloy
@up1
up1 / 1.txt
Last active June 8, 2024 05:07
Java23 :: Markdown Comment
$java -version
openjdk version "23-ea" 2024-09-17
OpenJDK Runtime Environment (build 23-ea+25-2094)
OpenJDK 64-Bit Server VM (build 23-ea+25-2094, mixed mode, sharing)
$javadoc -d doc Demo.java
Loading source file Demo.java...
Constructing Javadoc information...
Building index for all the packages and classes...
Standard Doclet version 23-ea+25-2094
@up1
up1 / 1.txt
Last active June 3, 2024 07:39
CDS :: Spring Boot 3.3.0
$./mvnw clean package
$java -jar target demo.jar
Started Demo33Application in 1.49 seconds (process running for 2.434)
Memory footprint at startup: 40-70 MB
@up1
up1 / 1.txt
Last active May 27, 2024 15:50
Docker image digest
$docker image ls --digests
REPOSITORY TAG DIGEST IMAGE ID CREATED SIZE
nginx 1.25.5 sha256:a484819eb60211f5299034ac80f6a681b06f89e65866ce91f356ed7c72af059c 8dd77ef2d82e 3 weeks ago 193MB
nginx latest sha256:a484819eb60211f5299034ac80f6a681b06f89e65866ce91f356ed7c72af059c 8dd77ef2d82e 3 weeks ago 193MB
$docker image inspect nginx:1.25.5 --format '{{.RepoDigests}}'
[nginx@sha256:a484819eb60211f5299034ac80f6a681b06f89e65866ce91f356ed7c72af059c]
@up1
up1 / 1.txt
Last active May 24, 2024 09:19
Hello Hurl
$hurl --test hello.hurl
hello.hurl: Running [1/1]
hello.hurl: Success (1 request(s) in 219 ms)
--------------------------------------------------------------------------------
Executed files: 1
Succeeded files: 1 (100.0%)
Failed files: 0 (0.0%)
Duration: 221 ms
@up1
up1 / 1.txt
Last active May 21, 2024 09:44
12-factors app with go
$go mod init demo
$go mod tidy
go: finding module for package github.com/gin-gonic/gin
go: downloading github.com/gin-gonic/gin v1.10.0
go: found github.com/gin-gonic/gin in github.com/gin-gonic/gin v1.10.0
go: downloading golang.org/x/net v0.25.0
go: downloading github.com/pelletier/go-toml/v2 v2.2.2
go: downloading github.com/go-playground/validator/v10 v10.20.0
go: downloading github.com/ugorji/go/codec v1.2.12
go: downloading google.golang.org/protobuf v1.34.1
@up1
up1 / docker-compose.yml
Created May 20, 2024 14:51
Docker compose :: Profile
services:
frontend:
image: frontend
profiles: [frontend]
phpmyadmin:
image: phpmyadmin
depends_on: [db]
profiles: [debug]
@up1
up1 / vercel.json
Created May 20, 2024 05:08
Vercel + Python
{
"rewrites": [
{ "source": "/(.*)", "destination": "/api/index" }
]
}
@up1
up1 / hello.js
Last active May 18, 2024 02:17
Hello JSDoc
// Description: This file is used to fetch data from an API.
/**
* This function is used to fetch data from an API.
* @param number id todo's id
* @returns {{id: number, name: string, age: number}} data
*
* @example
* ```js
* hello.findSomeData(1).then((data) => {