Skip to content

Instantly share code, notes, and snippets.

View naramdash's full-sized avatar
🚲
Keep Studying & Working

김주호 naramdash

🚲
Keep Studying & Working
View GitHub Profile
@naramdash
naramdash / .zshrc
Created September 5, 2023 02:09
my essential oh-my-zsh config
plugins=(
git
dotnet
docker
docker-compose
z
zsh-autosuggestions
zsh-syntax-highlighting
)
@naramdash
naramdash / docker-compose.yml
Last active July 10, 2023 01:46
kafka kraft + docker compose minimum setting
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'
@naramdash
naramdash / hyper.ts
Created March 12, 2023 12:28
DOM creation
// 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<
@naramdash
naramdash / run.sh
Created June 21, 2022 07:18
run mosquitto with docker
docker run \
--name mosquitto-container \
--restart always \
--detach \
-p 9001:9001 \
-p 1883:1883 \
eclipse-mosquitto:1.6
@naramdash
naramdash / make_volume.sh
Last active June 21, 2022 06:34
run postgres with docker volume
# do before run.sh
docker volume create postgres-volume
@naramdash
naramdash / CallDifferenceByOS.cs
Last active April 25, 2022 10:15
C# Preprocessor with Operating System
#if Windows
Console.WriteLine("Windows!");
#elif Linux
Console.WriteLine("Linuxw!");
#elif OSX
Console.WriteLine("osx!");
#endif
@naramdash
naramdash / equal.ts
Last active April 19, 2022 05:29
array helper function
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" },
@naramdash
naramdash / .mytheme.omp.json
Created March 17, 2022 04:25
my oh-my-posh theme
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"blocks": [
{
"alignment": "right",
"segments": [
{
"foreground": "#007acc",
"properties": {
"template": "{{ .Name }}"
# 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 {
@naramdash
naramdash / makeObjectFunctionsProxy.ts
Last active July 13, 2022 06:32
Function proxies for Logging
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, '')