Skip to content

Instantly share code, notes, and snippets.

View AndriiTsok's full-sized avatar
💡
Creating

Andrii Tsok AndriiTsok

💡
Creating
View GitHub Profile
@AndriiTsok
AndriiTsok / maintenance-page.yaml
Created July 10, 2024 18:29 — forked from sidpalas/maintenance-page.yaml
Kubernetes temporary maintenance page
apiVersion: v1
kind: ConfigMap
metadata:
name: maintenance-page
data:
maintenance.html: |-
<!--HTML GOES HERE-->
<!doctype html>
<title>Site Maintenance</title>
<link rel="stylesheet" href="maintenance.css">
@AndriiTsok
AndriiTsok / ksqldb-tutorial.md
Created March 31, 2024 03:11 — forked from DennisFederico/ksqldb-tutorial.md
KSQLDB Simple Tutorial with Confluent Cloud
tags: #ksqldb/tutorial

Provisioning ksqlDB Cluster

Cluster Data

environment=env-0x3135
@AndriiTsok
AndriiTsok / kafka-ui.yaml
Created March 29, 2024 16:39 — forked from ashishmaurya/kafka-ui.yaml
Installing Kafka UI on local k8s cluster
apiVersion: apps/v1
kind: Deployment
metadata:
name: kafka-ui-deployment
labels:
app: kafka-ui
# namespace: mstore
spec:
replicas: 1
selector:
[root@kafka-a-01 /]# /opt/kafka_current/bin/kafka-console-consumer.sh
The console consumer is a tool that reads data from Kafka and outputs it to standard output.
Option Description
------ -----------
--blacklist <blacklist> Blacklist of topics to exclude from
consumption.
--bootstrap-server <server to connect REQUIRED (unless old consumer is
to> used): The server to connect to.
--consumer-property <consumer_prop> A mechanism to pass user-defined
properties in the form key=value to
@AndriiTsok
AndriiTsok / README.md
Created February 16, 2024 18:59 — forked from nrdobie/README.md
Use CUID2 with Prisma

This will automatically use CUID2 for all id fields when creating elements in Prisma.

You'll need to add the following libraries to make this work

npm install --save @paralleldrive/cuid2 immer
yarn add @paralleldrive/cuid2 immer
pnpm add @paralleldrive/cuid2 immer
@AndriiTsok
AndriiTsok / useMeasure.ts
Created January 28, 2024 00:18 — forked from KristofferEriksson/useMeasure.ts
A generic React TypeScript hook for measuring element dimensions in real-time
import { useEffect, useRef, useState } from "react";
interface MeasureResult<T extends Element> {
ref: React.RefObject<T>;
bounds: DOMRectReadOnly;
}
const useMeasure = <T extends Element = Element>(): MeasureResult<T> => {
const ref = useRef<T>(null);
const [bounds, setBounds] = useState<DOMRectReadOnly>(new DOMRectReadOnly());
@AndriiTsok
AndriiTsok / A_UUID_v7_for_Postgres.sql
Created November 16, 2023 18:25 — forked from kjmph/A_UUID_v7_for_Postgres.sql
Postgres PL/pgSQL function for UUID v7 and a bonus custom UUID v8 to support microsecond precision as well. Read more here: https://datatracker.ietf.org/doc/draft-peabody-dispatch-new-uuid-format/
-- Based off IETF draft, https://datatracker.ietf.org/doc/draft-peabody-dispatch-new-uuid-format/
create or replace function uuid_generate_v7()
returns uuid
as $$
begin
-- use random v4 uuid as starting point (which has the same variant we need)
-- then overlay timestamp
-- then set version 7 by flipping the 2 and 1 bit in the version 4 string
return encode(
@AndriiTsok
AndriiTsok / Set Plist Bundle to Git Count.md
Created January 8, 2023 06:11 — forked from JoeMatt/Set Plist Bundle to Git Count.md
Xcode 10 set Info.plist build version

Create Info.plist

About

This script will update Info.plist of a target in XCode with the following

  1. CFBundleVersion to the git commit count
  2. GitDate to the date of the last commit
  3. GitBranch to the current branch name
  4. GitTag to the latest tag on current branch

Creates a .version file to track last update and appease XCode needing a non-mutable output path.

@AndriiTsok
AndriiTsok / xcode-build-version-number.sh
Created January 8, 2023 05:34 — forked from idevsoftware/xcode-build-version-number.sh
Run Script Build Phase for Xcode to automatically increase CFBundleVersion
#!/bin/bash
# Run Script Build Phase for Xcode to automatically increase the CFBundleVersion value
# on your target's Info.plist using a 'yymmddHHMMSS' style timestamp.
# Also, sets a custom key with the current git commit hash (GIT_COMMIT_HASH)
#
# This script works by modifying the target copy of your Info.plist file, so that it won't
# change your original Info.plist which is under version control. It does, however, use
# the original file to read the initial CFBundleVersion value to which the timestamp
# for the current date/time is appended.