Skip to content

Instantly share code, notes, and snippets.

View kid1412621's full-sized avatar
🤣
why there is no bug in known universe

kid1412621

🤣
why there is no bug in known universe
View GitHub Profile
@kid1412621
kid1412621 / kafka cluster
Last active February 27, 2024 07:20
docker compose yaml
# without zookeeper
version: "3"
volumes:
broker0:
broker1:
broker2:
services:
broker0:
image: 'bitnami/kafka:latest'
container_name: broker0
@kid1412621
kid1412621 / .vimrc
Created November 10, 2022 07:56
vimrc
syntax on
#!/bin/bash
percentile=90
input="put your line based number file"
tmp="tmpfile"
total=$(cat "$input" | sort -n | tee "$tmp" | wc -l)
echo "min: $(head -n 1 "$tmp" | tail -n 1)"
echo "max: $(tail -n 1 "$tmp" | tail -n 1)"
# (n + 99) / 100 with integers is effectively ceil(n/100) with floats
percentile_rank=$(((total * percentile + 99) / 100))
@kid1412621
kid1412621 / settings.json
Last active August 11, 2022 06:58
terminal settings
{
"$help": "https://aka.ms/terminal-documentation",
"$schema": "https://aka.ms/terminal-profiles-schema",
"actions":
[
{
"command": "unbound",
"keys": "ctrl+v"
},
{
@kid1412621
kid1412621 / posh-theme.omp.json
Last active May 19, 2023 08:01
custom theme of oh-my-posh based on star theme
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"blocks": [
{
"alignment": "left",
"segments": [
{
"foreground": "#E06C75",
"style": "plain",
"template": "root <#ffffff>in</> ",
scoop alias add ls 'scoop list'
scoop alias add cc 'scoop cache rm *'
scoop alias add rm 'scoop uninstall $args[0]'
scoop alias add c 'scoop cleanup $args[0]'
scoop alias add s 'scoop s'
scoop alias add i 'scoop install $args[0]'
scoop alias add ri 'scoop rm $args[0] && scoop cache rm $args[0] && scoop install $args[0]'
scoop alias add u 'scoop update $args[0]'
scoop alias add ru 'scoop cache rm $args[0] && scoop update $args[0]'
scoop alias add up 'scoop update * && scoop cleanup *'
$OutputEncoding = [console]::InputEncoding = [console]::OutputEncoding = New-Object System.Text.UTF8Encoding
# Oh-My-Posh (`winget install oh-my-posh`)
$env:POSH_GIT_ENABLED = $true
oh-my-posh init pwsh --config $env:POSH_THEMES_PATH/star.omp.json | Invoke-Expression
Enable-PoshTooltips
# Alias
Set-Alias -N l -V Get-ChildItem
Set-Alias -N ll -V Get-ChildItemWithHidden