Last active
February 21, 2020 10:21
-
-
Save maldechavda/14bc32784ecc0e4f9bcba20bd2d20e1e to your computer and use it in GitHub Desktop.
Macbook bash_profile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export PATH="$PATH:$HOME/.composer/vendor/bin" | |
| export PATH="$HOME/.npm-packages/bin:$PATH" | |
| export PATH=/Users/Shared/DBngin/mysql/5.7.23/bin:$PATH | |
| function pushme { | |
| br=`git branch | grep "*"` | |
| git add --all | |
| if (($# > 1)); then | |
| params='' | |
| for i in $*; | |
| do | |
| params=" $params $i" | |
| done | |
| git commit -m "$params" | |
| else | |
| git commit -m "$1" | |
| fi | |
| git push origin ${br/* /} | |
| } | |
| function pull { | |
| br=`git branch | grep "*"` | |
| git pull origin ${br/* /} | |
| } | |
| function push { | |
| br=`git branch | grep "*"` | |
| git push origin ${br/* /} | |
| } | |
| function routes() { | |
| if [ $# -eq 0 ]; then | |
| php artisan route:list | |
| else | |
| php artisan route:list | grep ${1} | |
| fi | |
| } | |
| function mvp { | |
| cd ~/Sites/"$@" | |
| } | |
| function art { | |
| if [ $# -eq 0 ]; then | |
| php artisan | |
| else | |
| php artisan "$@" | |
| fi | |
| } | |
| t() { | |
| if [ -f vendor/bin/phpunit ]; then | |
| vendor/bin/phpunit "$@" | |
| else | |
| phpunit "$@" | |
| fi | |
| } | |
| alias migrate="php artisan migrate" | |
| alias fresh="php artisan migrate:fresh --seed" | |
| alias tinker="php artisan tinker" | |
| alias horizon="php artisan horizon" | |
| alias weather='curl -s wttr.in/Rajkot | sed -n "1,7p"' | |
| alias gl="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit" | |
| alias over="exit;exit;" | |
| alias c="clear && printf '\e[3J'" | |
| alias ..="cd .." | |
| alias ...="cd ../.." | |
| alias nah="git reset --hard;git clean -df" | |
| alias copyssh="pbcopy < ~/.ssh/id_rsa.pub" | |
| alias copypath="pwd | pbcopy" | |
| alias ci="composer install" | |
| alias cu="composer update" | |
| alias l='ls -lah' | |
| alias ll="ls -laF" | |
| alias rqc="redis-cli FLUSHALL" | |
| function wip() | |
| { | |
| git add --all | |
| git commit -m "wip" | |
| } | |
| function wipp() | |
| { | |
| pushme wip | |
| } | |
| # IP addresses | |
| alias ip="dig +short myip.opendns.com @resolver1.opendns.com" | |
| alias localip="ifconfig -a | grep -o 'inet6\? \(addr:\)\?\s\?\(\(\([0-9]\+\.\)\{3\}[0-9]\+\)\|[a-fA-F0-9:]\+\)' | awk '{ sub(/inet6? (addr:)? ?/, \"\"); print }'" | |
| # Empty the Trash on all mounted volumes and the main HDD | |
| # Also, clear Apple’s System Logs to improve shell startup speed | |
| alias emptytrash="sudo rm -rfv /Volumes/*/.Trashes; sudo rm -rfv ~/.Trash; sudo rm -rfv /private/var/log/asl/*.asl" | |
| function db { | |
| if [ "$1" = "refresh" ]; then | |
| mysql -uroot -proot -e "drop database $2; create database $2" | |
| elif [ "$1" = "create" ]; then | |
| mysql -uroot -proot -e "create database $2" | |
| elif [ "$1" = "drop" ]; then | |
| mysql -uroot -proot -e "drop database $2" | |
| fi | |
| } | |
| function sshHostRemove { | |
| ssh-keygen -R "$@" | |
| } | |
| phpv() { | |
| valet stop | |
| brew unlink [email protected] [email protected] [email protected] [email protected] | |
| brew link --force --overwrite $1 | |
| brew services restart $1 | |
| composer global update | |
| rm -f ~/.config/valet/valet.sock | |
| valet install | |
| } | |
| alias php71="phpv [email protected]" | |
| alias php72="phpv [email protected]" | |
| alias php73="phpv [email protected]" | |
| alias php74="phpv [email protected]" | |
| export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home | |
| export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home | |
| export PATH="/usr/local/opt/[email protected]/bin:$PATH" | |
| alias pg_start="launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist" | |
| alias pg_stop="launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist" | |
| alias adonis="/usr/local/Cellar/node/12.10.0/bin/adonis $@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment