Skip to content

Instantly share code, notes, and snippets.

View gearonix's full-sized avatar

Uzhanin Egor gearonix

View GitHub Profile
type UnionToIntersection<U> =
(U extends U ? (arg: U) => unknown : never) extends
((arg: infer I) => unknown) ? I : never
type LastOfUnion<U> =
UnionToIntersection<
(U extends unknown ? (arg: U) => unknown : never)
> extends (arg: infer I) => unknown ? I : never
type IsAny<T> = [T] extends [never] ?
@gearonix
gearonix / .gitconfig
Last active November 3, 2023 15:44
custom .gitconfig aliases
[alias]
ln = "!f() { git clone $1; }; f"
c = "!f() { category=\"$1\"; commit_message=\"$2\"; git add . && git commit -m -n \"$category: $commit_message\"; }; f"
cd = "!f() { git add . && git commit -m -n \"$1\"; }; f"
pu = "!f() { branch=\"$(git symbolic-ref --short HEAD)\"; git push origin $branch; }; f"
a = add
p = "!f() { category=\"$1\"; commit_message=\"$2\"; branch=\"$(git symbolic-ref --short HEAD)\"; git add . && git commit -m \"$category: $commit_message\" && git push origin $branch; }; f"
pd = "!f() { branch=\"$(git symbolic-ref --short HEAD)\"; git add . && git commit -m -n \"$1\" && git push origin $branch; }; f"
di = diff
@gearonix
gearonix / .zshrc
Last active January 20, 2024 17:59
dotfiles
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
export ZSH=$HOME/.oh-my-zsh
ZSH_THEME=gozilla
plugins=(
@gearonix
gearonix / clean-nodes.sh
Created September 27, 2023 07:52
Something like npkill, will delete all unnecessary files from your nodejs projects
#!/bin/bash
# will delete all unnecessary files
# from your nodejs projects
EXECUTE_DIR=$1
PURPLE='\033[1;36m'
NC='\033[0m'