Skip to content

Instantly share code, notes, and snippets.

View vimutti77's full-sized avatar

Vantroy vimutti77

  • Sharpinit Co., Ltd.
  • Thailand, Bangkok
View GitHub Profile
@tpai
tpai / pitr.sh
Last active July 13, 2024 12:33 — forked from LS80/pitr.sh
Demo PostgreSQL 13 Point-in-time Recovery with Docker
#!/bin/bash
VERSION=13
function cleanup() {
docker rm -f master replica >&/dev/null
rm -Rf $(pwd)/data $(pwd)/wal_archive
}
function wait_until_ready() {
import { z, ZodTypeAny, ZodUnion } from 'zod'
/**
* Zod helper for parsing arrays and ignore items not specified in the schema
*
* @param zodUnion - union of known types
*
* @example
* const binaryArraySchema = arrayIgnoreUnknown(z.union([z.literal('0'), z.literal('1')]))
* type BinaryArray = z.TypeOf<typeof binaryArraySchema>