This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$npx node-nightly --experimental-sqlite demo-sqlite.js | |
Downloading the nightly version, hang on... | |
node-nightly is available on CLI! | |
[ { key: 1, value: 'hello' }, { key: 2, value: 'world' } ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$go run demo-error.go | |
Wrapping Step1Error | |
Wrapping Step2Error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$curl --location --globoff 'http://localhost:3000/trpc/greeting?input={%22name%22%3A%22somkiat%22}' \ | |
--header 'Cookie: Cookie_1=value' | jq | |
{ | |
"result": { | |
"data": "Hello somkiat" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Testing | |
struct DemoTest { | |
@Test("Human readable", | |
.tags(.group01)) | |
func advances_by_months() { | |
#expect(2023.dec.advanced(by: 1) == 2024.jan) | |
#expect(2023.jan.advanced(by: -1) == 2022.dec) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM golang:1.22.4-alpine3.19 as builder | |
WORKDIR /app | |
COPY go.mod go.sum ./ | |
RUN go mod download | |
COPY . . | |
RUN CGO_ENABLED=0 GOOS=linux go build -v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Initialize clock and let the page load naturally. | |
await page.clock.install({ time: new Date('2024-02-02T08:00:00') }); | |
await page.goto('http://localhost:3333'); | |
// Pretend that the user closed the laptop lid and opened it again at 10am, | |
// Pause the time once reached that point. | |
await page.clock.pauseAt(new Date('2024-02-02T10:00:00')); | |
// Assert the page state. | |
await expect(page.getByTestId('current-time')).toHaveText('2/2/2024, 10:00:00 AM'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ติดตั้ง library | |
$npm install -g @typespec/compiler | |
// สร้าง project | |
$tsp init | |
TypeSpec compiler v0.57.0 | |
? Please select a template › - Use arrow-keys. Return to submit. | |
❯ Empty project min compiler ver: 0.57.0 - Create an empty project. | |
Generic REST API min compiler ver: 0.57.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$dotnet --list-sdks | |
6.0.406 [/usr/local/share/dotnet/sdk] | |
6.0.410 [/usr/local/share/dotnet/sdk] | |
6.0.412 [/usr/local/share/dotnet/sdk] | |
7.0.200 [/usr/local/share/dotnet/sdk] | |
7.0.201 [/usr/local/share/dotnet/sdk] | |
7.0.304 [/usr/local/share/dotnet/sdk] | |
7.0.306 [/usr/local/share/dotnet/sdk] | |
8.0.100-preview.3.23178.7 [/usr/local/share/dotnet/sdk] | |
8.0.100-preview.5.23303.2 [/usr/local/share/dotnet/sdk] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// HTML | |
<div class="demo"> | |
<a href="/windows/new" ,="" target="_blank">Click Here</a> | |
</div> | |
// Test with cypress | |
describe("Demo spec", () => { | |
it("check data after click link", () => { | |
// Arrange | |
cy.visit("your target"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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 |