Skip to content

Instantly share code, notes, and snippets.

Avatar
🤣
why there is no bug in known universe

kid1412621

🤣
why there is no bug in known universe
View GitHub Profile
@kid1412621
kid1412621 / .vimrc
Created November 10, 2022 07:56
vimrc
View .vimrc
syntax on
View calculate_avg_min_max_percentile.sh
#!/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
View settings.json
{
"$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 11, 2022 05:02
custom theme of oh-my-posh based on star theme
View posh-theme.omp.json
{
"$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</> ",
View scoop alias
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 *'
View Microsoft.PowerShell_profile.ps1
$OutputEncoding = [console]::InputEncoding = [console]::OutputEncoding = New-Object System.Text.UTF8Encoding
# posh-git (`Install-Module Posh-Git -Scope CurrentUser`)
Import-Module Posh-Git
# 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