Skip to content

Instantly share code, notes, and snippets.

@lucasadrianof
Last active October 2, 2020 18:53
Show Gist options
  • Save lucasadrianof/c9943d94c0873ea52a6f29f5dc987652 to your computer and use it in GitHub Desktop.
Save lucasadrianof/c9943d94c0873ea52a6f29f5dc987652 to your computer and use it in GitHub Desktop.

Revisions

  1. lucasadrianof revised this gist Oct 2, 2020. 1 changed file with 24 additions and 29 deletions.
    53 changes: 24 additions & 29 deletions .bashrc
    Original file line number Diff line number Diff line change
    @@ -1,54 +1,49 @@
    pm2 resurrect >&-;

    alias ll="ls -lah"
    alias runlike="docker run --rm -v //var/run/docker.sock://var/run/docker.sock assaflavie/runlike"
    alias twig-lint="php /d/www/twig-lint.phar lint"

    export faderim_app=app-magazord
    export DISPLAY=host.docker.internal:0.0

    xphp () {
    php -d xdebug.remote_autostart=On $@
    }

    alias git-pull-all="find . -maxdepth 3 -name .git -type d | rev | cut -c 6- | rev | xargs -I {} sh -c 'echo ""Atualizando repositório"" {}; git -C {} pull'"

    xphpjob () {
    xphp cli.php run $@
    docker_magazord() {
    (cd /mnt/Dev/dev/docker-magazord; docker-compose $@)
    }

    phpjob() {
    php cli.php run $@
    docker_magapay() {
    (cd /mnt/Dev/dev/docker-magapay; docker-compose $@)
    }

    dumpdoctrine () {
    php vendor/doctrine/orm/bin/doctrine.php orm:schema-tool:update --dump-sql > d:/scripts-doctrine.sql
    xphp() {
    projeto=$(pwd | grep -o "[a-zA-Z-]*$")
    docker run --rm -it \
    -v ${PWD}:/var/www/html/$projeto \
    -w /var/www/html/$projeto \
    -e faderim_app=$faderim_app \
    magazord php \
    -d xdebug.remote_autostart=On \
    $@
    }

    phpmig () {
    if [ $1 = "execute" ] || [ $1 = "migrate" ]; then
    php cli.php migration:$@ --no-interaction
    else
    php cli.php migration:$@
    fi
    xphpjob() {
    xphp cli.php run $@
    }

    svninfo*() {
    find . -name "*.svn" | sed "s/.svn//g" | sed "s|\.\/||g" | xargs -n1 svn info
    phpmig() {
    additionalParams=$(([ $1 = "execute" ] || [ $1 = "migrate" ]) && echo "--no-interaction" || echo "")
    xphp cli.php migrations:$@ $additionalParams
    }
    switch_rev_sprint() {
    echo Informe a nova revisão:
    read rev
    for dir in $(ls -d /d/htdocs/* | grep sprint); do
    for dir in $(ls -d /mnt/Dev/htdocs/* | grep sprint); do
    url=$(svn info $dir | grep -Po "(?<=^URL: ).*")
    newurl=$(echo $url | sed "s=[0-9]\.[0-9]\{2\}$=$rev=g")
    newurl=$(echo $url | sed "s/[0-9]\.[0-9]\{2\}$/$rev/g")
    echo Alterando versão do $dir para $rev
    svn switch $newurl $dir
    done
    }
    docker_elastic_stack() {
    (cd /d/dev/docker_elastic; docker-compose $@)
    dumpdoctrine () {
    xphp vendor/doctrine/orm/bin/doctrine.php orm:schema-tool:update --dump-sql > /mnt/Dev/temp/scripts-doctrine.sql
    }
  2. lucasadrianof renamed this gist Jul 8, 2020. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. lucasadrianof revised this gist Jul 8, 2020. No changes.
  4. lucasadrianof renamed this gist Jul 8, 2020. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  5. lucasadrianof created this gist Jul 8, 2020.
    54 changes: 54 additions & 0 deletions .bashrc
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,54 @@
    pm2 resurrect >&-;

    alias ll="ls -lah"
    alias runlike="docker run --rm -v //var/run/docker.sock://var/run/docker.sock assaflavie/runlike"
    alias twig-lint="php /d/www/twig-lint.phar lint"

    export faderim_app=app-magazord
    export DISPLAY=host.docker.internal:0.0

    xphp () {
    php -d xdebug.remote_autostart=On $@
    }

    xphpjob () {
    xphp cli.php run $@
    }

    phpjob() {
    php cli.php run $@
    }

    dumpdoctrine () {
    php vendor/doctrine/orm/bin/doctrine.php orm:schema-tool:update --dump-sql > d:/scripts-doctrine.sql
    }

    phpmig () {
    if [ $1 = "execute" ] || [ $1 = "migrate" ]; then
    php cli.php migration:$@ --no-interaction
    else
    php cli.php migration:$@
    fi
    }

    svninfo*() {
    find . -name "*.svn" | sed "s/.svn//g" | sed "s|\.\/||g" | xargs -n1 svn info
    }

    switch_rev_sprint() {
    echo Informe a nova revisão:

    read rev

    for dir in $(ls -d /d/htdocs/* | grep sprint); do
    url=$(svn info $dir | grep -Po "(?<=^URL: ).*")
    newurl=$(echo $url | sed "s=[0-9]\.[0-9]\{2\}$=$rev=g")

    echo Alterando versão do $dir para $rev
    svn switch $newurl $dir
    done
    }

    docker_elastic_stack() {
    (cd /d/dev/docker_elastic; docker-compose $@)
    }