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 |
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
function equal<Type, Key extends keyof Type>(propertyName: Key, value: Type[Key]) { | |
return (item: Type) => item[propertyName] === value; | |
} | |
const arr = [ | |
{ id: 1, name: "juho" }, | |
{ id: 2, name: "kim" }, | |
{ id: 3, name: "holy" }, | |
{ id: 4, name: "jesus" }, | |
{ id: 5, name: "fire" }, |
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
{ | |
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json", | |
"blocks": [ | |
{ | |
"alignment": "right", | |
"segments": [ | |
{ | |
"foreground": "#007acc", | |
"properties": { | |
"template": "{{ .Name }}" |
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
# Boot oh-my-posh | |
# must install oh-my-posh | |
# https://ohmyposh.dev/docs/windows | |
# oh-my-posh prompt init pwsh --config https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/v$(oh-my-posh --version)/themes/jandedobbeleer.omp.json | Invoke-Expression | |
oh-my-posh prompt init pwsh --config "~/Documents/PowerShell/.mytheme.omp.json" | Invoke-Expression | |
# PowerShell parameter completion shim for the dotnet CLI | |
Register-ArgumentCompleter -Native -CommandName dotnet -ScriptBlock { | |
param($commandName, $wordToComplete, $cursorPosition) | |
dotnet complete --position $cursorPosition "$wordToComplete" | ForEach-Object { |
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
function getParams(func: Function) { | |
// String representaation of the function code | |
const funcS = func.toString() | |
// Remove comments of the form /* ... */ | |
// Removing comments of the form // | |
// Remove body of the function { ... } | |
// removing '=>' if func is arrow function | |
const str = funcS | |
.replace(/\/\*[\s\S]*?\*\//g, '') |
NewerOlder