Skip to content

Instantly share code, notes, and snippets.

@PatricNox
Last active October 17, 2023 07:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PatricNox/83f714e9d77fe7b5a996c76b81f6d6d6 to your computer and use it in GitHub Desktop.
Save PatricNox/83f714e9d77fe7b5a996c76b81f6d6d6 to your computer and use it in GitHub Desktop.
Update my dev config to the latest
## General shorthands.
alias update='source ~/.bashrc'
alias sshkey="cat ~/.ssh/id_rsa.pub | pbcopy"
alias httpdconf="code /usr/local/etc/httpd/httpd.conf"
alias ll='ls -la'
alias serve='yarn install && yarn serve'
alias eserve='yarn install && yarn electron:serve'
alias ylint='yarn lint --fix && yarn lint'
alias sshconfig="code ~/.ssh/config"
alias bashprofile="code ~/.bash_profile"
## Local.
alias startlocal="sudo apachectl start && brew services start mysql@5.7"
alias stoplocal="sudo apachectl stop ; brew services stop mysql@5.7"
alias restartlocal="stoplocal && startlocal"
alias mysql=/usr/local/bin/mysql
alias mysqladmin=/usr/local/bin/mysqladmin
## Git.
alias ghname="git config user.name patricnox && git config user.mail hello@patricnox.info"
alias devmerge="git switch dev && git pull && git switch - && git merge dev"
## Custom tools.
alias dbsearch="cd ~/playground/search && php -S localhost:1337 -t . ; cd -"
alias localtest="cd ~/playground/localtest && code . ; php -S localhost:9090 -t . ; cd -"
## Docker shorthands.
alias dc="docker-compose"
alias d="./dev.sh"
alias da="./dev.sh artisan"
alias dd="../dev.sh"
alias dda="../dev.sh artisan"
alias dsup="docker-compose up -d"
alias dsall='docker stop $(docker ps -aq) && docker rm $(docker ps -aq)'
alias dsr="dsall && dsup"
alias dsrbuild="dsall && docker-compose build && dsup"
alias dsrreset="docker volume rm $(docker volume ls -q) && dsup"
## Git shorthands.
alias gp="git pull"
alias gb="git branch"
alias wip="git log -1 && git reset --soft head~"
alias log1="git log -1"
alias log2="git log -2"
alias log3="git log -3"
## Vagrant.
alias vup="vagrant up && vagrant ssh"
## Composer Laravel - Cache clear and stuff
alias composercc="composer dump-autoload -o && dd artisan cache:clear && composer clear-cache && dsr"
## Shorthand for ./dev.sh drush for multi-docker
md() {
d drush $1 $2 $3 $4
}
# Add entry to hosts file, needed for Multidocker.
mdaddhost() {
sudo echo "127.0.0.1 $1.dev.local" | sudo tee -a /etc/hosts
}
# Drush in multi-docker
function mush() {
dir=${PWD##*/}
echo
echo '_____________'
echo 'Project:' ${dir}
echo '_____________'
echo
(cd ~/docks/multi-docker ; ./dev.sh drush ${dir} "$@")
}
# Wifi password
function wifi() {
dir=${PWD##*/}
echo
echo '_____________'
echo 'wifi password:' "$@"
echo '_____________'
echo
(security find-generic-password -ga "$@" | grep “password:”)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment