Skip to content

Instantly share code, notes, and snippets.

@alejandroacho
Last active July 26, 2022 08:18
Show Gist options
  • Select an option

  • Save alejandroacho/958915c99b2a5445e62cb7a2554d0c30 to your computer and use it in GitHub Desktop.

Select an option

Save alejandroacho/958915c99b2a5445e62cb7a2554d0c30 to your computer and use it in GitHub Desktop.

Revisions

  1. alejandroacho revised this gist Jul 26, 2022. 1 changed file with 14 additions and 2 deletions.
    16 changes: 14 additions & 2 deletions .zshrc
    Original file line number Diff line number Diff line change
    @@ -49,7 +49,13 @@ alias staged='git restore --staged'
    alias restore='git restore'
    alias stashc='git stash clear'
    alias stashl='git stash list'
    stashp() {git stash pop stash@{"$@"}}
    stashp() {
    if [ ! -z "$@" ]; then
    git stash pop stash@{"$@"}
    else
    git stash pop
    fi
    }
    stash() {
    if [ ! -z "$@" ]; then
    git stash save "$@"
    @@ -64,7 +70,13 @@ stasha() {
    git stash apply
    fi
    }
    undo() { git reset --soft HEAD~"$@" }
    undo() {
    if [ ! -z "$@" ]; then
    git reset --soft HEAD~"1"
    else
    git reset --soft HEAD~"$@"
    fi
    }

    # Docker
    alias d='docker'
  2. alejandroacho revised this gist Jul 19, 2022. 1 changed file with 58 additions and 24 deletions.
    82 changes: 58 additions & 24 deletions .zshrc
    Original file line number Diff line number Diff line change
    @@ -1,40 +1,74 @@

    # System
    alias c="clear"
    alias ll="ls -a"
    alias m="make"
    # Bash
    alias ll='ls -a'
    alias c='clear'
    alias rcache="find . | grep -E '(__pycache__|\.pyc|\.pyo$)' | xargs rm -rf && find . | grep -E '(.pytest_cache|\.pyc|\.pyo$)' | xargs rm -rf "

    # Docker
    alias up="make up"
    alias upd="make upd"
    alias dps="make ps"
    alias down="make down"
    alias exec="make exec"
    alias shell="make shell"
    alias bash="make bash"
    alias db="USER=user PASSWORD=password make database"
    alias down='make stop'
    alias prune='docker system prune -a --volumes'
    test() { APP=$@ make test }
    # Projects
    alias up='make local'
    alias run='npm run local'
    alias rund='npm run dev'
    alias down='make local-stop'
    alias m='make'
    alias reconstruct-dev="cd /Users/alejandro/Desktop/Repos/core-backend && SETTINGS='--settings=settings.settings.dev' m db-recreate"
    alias tflush='make test-db-flush'
    alias cypress='npm run cypress:open'
    test() {APP="$@" make test-all}
    ftest() {make test-db-flush && APP="$@" make test-all}
    rtest() {make test-db-recreate && APP="$@" make test-all}
    shell() {
    if [ ! -z "$@" ]; then
    echo "************************************************"
    echo "* !! WARNING; RUNING ON $@ ENVIRONMENT !! *"
    echo "************************************************"
    docker exec -it core_backend bash -c "python manage.py shell_plus --settings=settings.settings.$@"
    else
    echo "RUNNING IN DEV ENVIRONMENT"
    make shell
    fi
    }
    urls() {
    if [ ! -z "$@" ]; then
    GREP="$@" make show_urls
    else
    make show_urls
    fi
    }

    # Git
    alias g='git'
    alias ga='git add'
    alias gs='git status'
    alias gd='git diff'
    alias gc='git commit -m'
    alias gb='git branch'
    alias gout='git checkout'
    alias goutb='git checkout -b'
    alias master='git checkout master'
    alias stage='git checkout stage'
    alias dev='git checkout dev'
    alias push='git push origin'
    alias pull='git pull origin'
    alias stash='git stash'
    alias stasha='git stash apply'
    alias stashc='git stash clear'
    alias staged='git restore --staged'
    alias restore='git restore'
    undo() { git reset --soft HEAD~"$@" }
    alias stashc='git stash clear'
    alias stashl='git stash list'
    stashp() {git stash pop stash@{"$@"}}
    stash() {
    if [ ! -z "$@" ]; then
    git stash save "$@"
    else
    git stash
    fi
    }
    stasha() {
    if [ ! -z "$@" ]; then
    git stash apply stash@{"$@"}
    else
    git stash apply
    fi
    }
    undo() { git reset --soft HEAD~"$@" }

    # Docker
    alias d='docker'
    alias dps='docker ps'
    alias dcps='docker-compose -f docker-compose.local.yml ps'
    alias bash='make bash'
    alias prune='docker system prune -a --volumes'
  3. alejandroacho created this gist Jun 25, 2022.
    40 changes: 40 additions & 0 deletions .zshrc
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,40 @@

    # System
    alias c="clear"
    alias ll="ls -a"
    alias m="make"
    alias rcache="find . | grep -E '(__pycache__|\.pyc|\.pyo$)' | xargs rm -rf && find . | grep -E '(.pytest_cache|\.pyc|\.pyo$)' | xargs rm -rf "

    # Docker
    alias up="make up"
    alias upd="make upd"
    alias dps="make ps"
    alias down="make down"
    alias exec="make exec"
    alias shell="make shell"
    alias bash="make bash"
    alias db="USER=user PASSWORD=password make database"
    alias down='make stop'
    alias prune='docker system prune -a --volumes'
    test() { APP=$@ make test }

    # Git
    alias g='git'
    alias ga='git add'
    alias gs='git status'
    alias gd='git diff'
    alias gc='git commit -m'
    alias gb='git branch'
    alias gout='git checkout'
    alias goutb='git checkout -b'
    alias master='git checkout master'
    alias stage='git checkout stage'
    alias dev='git checkout dev'
    alias push='git push origin'
    alias pull='git pull origin'
    alias stash='git stash'
    alias stasha='git stash apply'
    alias stashc='git stash clear'
    alias staged='git restore --staged'
    alias restore='git restore'
    undo() { git reset --soft HEAD~"$@" }