Skip to content

Instantly share code, notes, and snippets.

@VlatkoStojkoski
Created July 27, 2023 11:22
Show Gist options
  • Save VlatkoStojkoski/763a72a454b8aa776a58c45810486f73 to your computer and use it in GitHub Desktop.
Save VlatkoStojkoski/763a72a454b8aa776a58c45810486f73 to your computer and use it in GitHub Desktop.
echo -ne '\e]11;#000000\a'
HOST_NAME=$HOSTNAME
source ~/.nvm/nvm.sh
nvm use lts/*
shopt -s autocd
shopt -s histappend
export PATH=$PATH:$HOME/bin
export HISTSIZE=5000
export HISTFILESIZE=10000
bind '"\e[A": history-search-backward'
bind '"\e[B": history-search-forward'
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
txtred='\e[0;31m' # Red
txtgrn='\e[0;32m' # Green
bldgrn='\e[1;32m' # Bold Green
bldpur='\e[1;35m' # Bold Purple
txtrst='\e[0m' # Text Reset
emojis=("πŸ‘Ύ" "🌐" "🎲" "🌍" "πŸ‰" "🌡" "πŸ’Š" "🌿" "πŸ’‰")
EMOJI=${emojis[$RANDOM % ${#emojis[@]} ]}
print_before_the_prompt () {
dir=$PWD
home=$HOME
dir=${dir/"$HOME"/"~"}
printf "\n $txtred%s: $bldpur%s $txtgrn%s\n$txtrst" "$HOST_NAME" "$dir" "$(vcprompt)"
}
PROMPT_COMMAND=print_before_the_prompt
PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"
PS1="$EMOJI > "
if type shuf > /dev/null; then
cowfile="$(cowsay -l | sed "1 d" | tr ' ' '\n' | shuf -n 1)"
else
cowfiles=( $(cowsay -l | sed "1 d") );
cowfile=${cowfiles[$(($RANDOM % ${#cowfiles[*]}))]}
fi
fortune | cowsay -f "$cowfile" | lolcat
function mkcd()
{
mkdir $1 && cd $1
}
# -------
# Aliases
# -------
alias 🍺="git checkout -b drunk"
alias a='code .'
alias c='code .'
alias reveal-md="reveal-md --theme night --highlight-theme hybrid --port 1337"
alias ns='npm start'
alias start='npm start'
alias nr='npm run'
alias run='npm run'
alias nis='npm i -S'
alias pns='pnpm start'
alias pstart='pnpm start'
alias pnd='pnpm run dev'
alias pndev='pnpm run dev'
alias pnr='pnpm run'
alias prun='pnpm run'
alias pnis='pnpm i -S'
alias pnpx='pnpm dlx'
alias l="ls" # List files in current directory
alias ll="ls -al" # List all files in current directory in long list format
alias o="open ." # Open the current directory in Finder
# ----------------------
# Git Aliases
# ----------------------
alias ga='git add'
alias gaa='git add .'
alias gaaa='git add -A'
alias gc='git commit'
alias gcm='git commit -m'
alias gd='git diff'
alias gi='git init'
alias gl='git log'
alias gp='git pull'
alias gpsh='git push'
alias gss='git status -s'
alias gs='echo ""; echo "*********************************************"; echo -e " DO NOT FORGET TO PULL BEFORE COMMITTING"; echo "*********************************************"; echo ""; git status'
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
if type brew &>/dev/null
then
HOMEBREW_PREFIX="$(brew --prefix)"
if [[ -r "${HOMEBREW_PREFIX}/etc/profile.d/bash_completion.sh" ]]
then
source "${HOMEBREW_PREFIX}/etc/profile.d/bash_completion.sh"
else
for COMPLETION in "${HOMEBREW_PREFIX}/etc/bash_completion.d/"*
do
[[ -r "${COMPLETION}" ]] && source "${COMPLETION}"
done
fi
fi
LOCAL_IP=$(ip -4 addr show enp3s0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}')
alias hrs="browser-sync start -s -f . --no-notify --host $LOCAL_IP --port 9000"
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
. "$HOME/.cargo/env"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment