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 { test, expect } from "@playwright/test"; | |
import { writeFileSync } from "node:fs"; | |
import sharp from "sharp"; | |
test("take shots", async ({ page }) => { | |
await page.goto("https://playwright.dev/"); | |
const imageBuffer = await page.screenshot(); | |
const base = sharp(imageBuffer) | |
.extract({ |
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 type { ComponentOptionsMixin, DefineComponent, PropType } from "vue"; | |
import type { | |
Component, | |
ComponentAttributes, // Record<string, unknown> | |
ComponentEventMap // Record<string, CustomEvent> | |
} from "./component"; | |
type Attrs = { | |
[P in keyof ComponentAttributes]: { | |
type: PropType<NonNullable<ComponentAttributes[P]>>; |
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
open System.Text.Json | |
open MessagePack | |
open MessagePack.Resolvers | |
open MessagePack.Formatters | |
open MessagePack.FSharp | |
type JsonElementFormatter() as self = | |
let jsonElementFormatter = (self :> IMessagePackFormatter<JsonElement>) |
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
let continuationAction (t: Task<int>) = | |
if not t.IsFaulted then | |
logger.Info( | |
"succ {@fetched} {@remained}", | |
[| messages.Length :> obj; queue.Count |] | |
) | |
else | |
logger.Error( | |
"error {@error}", | |
[| t.Exception.InnerExceptions.Count :> obj |] |
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
plugins=( | |
git | |
dotnet | |
docker | |
docker-compose | |
z | |
zsh-autosuggestions | |
zsh-syntax-highlighting | |
) |
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
services: | |
kafka-node-1: | |
container_name: kafka-node-1 | |
image: confluentinc/cp-kafka:7.4.0 | |
environment: | |
CLUSTER_ID: 'MkU3OEVBNTcwNTJENDM2Qk' | |
KAFKA_NODE_ID: 1 | |
KAFKA_PROCESS_ROLES: 'broker,controller' | |
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 | |
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: 'CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT' |
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
// https://stackoverflow.com/questions/49579094/typescript-conditional-types-filter-out-readonly-properties-pick-only-requir | |
type IfEquals<X, Y, A = X, B = never> = (<T>() => T extends X ? 1 : 2) extends < | |
T | |
>() => T extends Y ? 1 : 2 | |
? A | |
: B; | |
type WritableKeys<T> = { | |
[P in keyof T]-?: IfEquals< |
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
docker run \ | |
--name mosquitto-container \ | |
--restart always \ | |
--detach \ | |
-p 9001:9001 \ | |
-p 1883:1883 \ | |
eclipse-mosquitto:1.6 |
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
# do before run.sh | |
docker volume create postgres-volume |
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
#if Windows | |
Console.WriteLine("Windows!"); | |
#elif Linux | |
Console.WriteLine("Linuxw!"); | |
#elif OSX | |
Console.WriteLine("osx!"); | |
#endif |
NewerOlder