Skip to content

Instantly share code, notes, and snippets.

@imWildCat
Last active August 19, 2022 03:35
Show Gist options
  • Save imWildCat/aefb8a6d1b9cc7a4cb5498c8cab70737 to your computer and use it in GitHub Desktop.
Save imWildCat/aefb8a6d1b9cc7a4cb5498c8cab70737 to your computer and use it in GitHub Desktop.
rc file
source ~/.rc.private
# rbenv
rbenv-init() {
if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi
eval "$(rbenv init -)"
}
pyenv-init() {
eval "$(pyenv init --path)"
eval "$(pyenv virtualenv-init -)"
}
# init_pyenv
load_python_poetry() {
# Python Poetry
source ~/.poetry/env
}
alias vim=nvim
export EDITOR=nvim
export VISUAL="$EDITOR"
alias fastlane="bundle exec fastlane"
#alias pod="bundle exec pod"
function iterm2-shell-integration-help() {
echo 'The next time you log in, shell integration will be enabled.
You will also have these commands:
imgcat filename
Displays the image inline.
imgls
Shows a directory listing with image thumbnails
it2attention start|stop|fireworks
Gets your attention
it2check
Checks if the terminal is iTerm2
it2copy [filename]
Copies to the pasteboard
it2dl filename
Downloads the specified file, saving it in your Downloads folder.
it2setcolor ...
Changes individual color settings or loads a color preset
it2setkeylabel ...
Changes Touch Bar function key labels
it2ul
Uploads a file
it2universion
Sets the current unicode version'
}
# pkill
function pkill_2() {
local pid
pid=$(ps ax | grep $1 | grep -v grep | awk '{ print $1 }')
kill -9 $pid
echo -n "Killed $1 (process $pid)"
}
# flutter
function load_flutter() {
export PATH="$PATH":"$HOME/.pub-cache/bin"
export PATH="$HOME/Downloads/flutter/bin":$PATH
export PATH="$HOME/Downloads/flutter-other-channel/bin":$PATH
echo "Flutter has be loaded. Use 'flutter doctor' to see what will happen"
}
export ANDROID_SDK_ROOT="/Volumes/SharedVol/apps/android_support/sdk"
export ANDROID_HOME=$ANDROID_SDK_ROOT
export PATH=$PATH:$ANDROID_SDK_ROOT/platform-tools
export ANDROID_NDK_HOME="/Volumes/SharedVol/apps/android_support/sdk"
export NDK_HOME="$ANDROID_NDK_HOME"
alias rails-credits-edit="EDITOR='code --wait' bundle exec rails credentials:edit"
# Trash
alias rm="trash"
alias raw-rm=/bin/rm
# rust
export PATH=$PATH:$HOME/.cargo/bin
# database
export PATH=$PATH:/Applications/Postgres.app/Contents/Versions/latest/bin
cdt() {
BASE=$HOME
YY=`date '+%Y'`
MM=`date '+%m'`
if [ -d "$BASE/Downloads/$YY$MM/temp" ];
then
echo Changing to "~/Downloads/$YY$MM/temp"
cd "$BASE/Downloads/$YY$MM/temp"
else
echo Making "~/Downloads/$YY$MM/temp"
mkdir -p "$BASE/Downloads/$YY$MM/temp"
cd "$BASE/Downloads/$YY$MM/temp"
fi
}
allow_undefined_developer() {
sudo spctl --master-disable
}
# dotnet
export PATH="$PATH:$USER/.dotnet/tools"
convert_audio_wav() {
ffmpeg -i $1 -acodec pcm_s16le -ac 1 -ar 16000 $2
}
codesign_check() {
codesign -dv -r- $1
}
# direnv
eval "$(direnv hook zsh)"
# OpenSSL
export OPENSSL_INCLUDE_DIR=/usr/local/opt/openssl/include
# Block homebrew auto update
HOMEBREW_NO_AUTO_UPDATE=1
alias fix_mac_audio="sudo pkill -9 coreaudiod"
alias video_to_gif='function video_to_gif(){ ffmpeg -i $1 $2 && gifsicle -O3 $2 -o $2 && say "Video is ready!"};video_to_gif'
export PATH=$PATH:/Users/[username]/.intellij/bin
export PATH="/opt/homebrew/opt/node@16/bin:$PATH"
nvm_init() {
export NVM_DIR="$HOME/.nvm"
[ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && \. "/opt/homebrew/opt/nvm/nvm.sh" # This loads nvm
}
alias lvim=/Users/[username]/.local/bin/lvim
alias v=lvim
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment