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
| git checkout master && \ | |
| git branch -D test2 && \ | |
| git checkout -b test2 | |
| git ls-files | xargs git update-index --add --chmod=-x | |
| git commit -m "Local mode changed" && \ | |
| git checkout -- . && \ | |
| git rebase -i HEAD~4 |
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
| <?php | |
| setlocale(LC_ALL, NULL); | |
| setlocale(LC_ALL, 'pt_BR'); | |
| $time = "segunda-feira, 28 de julho de 2014 10h10min07s UTC-3"; | |
| $timeParts = explode(',', $time); | |
| $timeParsed = strptime( |
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
| # apt-get install pv | |
| # pv -t -p <your-filename>.sql | mysql -u <your-username> -p -D <your-database-name> | |
| pv -t -p database.sql | mysql -u root -p -D test |
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
| git config core.fileMode false |
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
| echo "flush_all" | nc -q 2 localhost 11211 |
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
| # Credentials | |
| export PROXY_SERVER_IP="proxyserver.com" | |
| export PROXY_SERVER_PORT="3128" | |
| export PROXY_USERNAME="your-user" | |
| export PROXY_PASSWORD="your-password@123" | |
| PROXY_CONFIG="http://${PROXY_USERNAME/\@/%40}:${PROXY_PASSWORD/\@/%40}@${PROXY_SERVER_IP}:${PROXY_SERVER_PORT}/" | |
| # System | |
| export {http,HTTP,https,HTTPS}_{proxy,PROXY}=$PROXY_CONFIG |
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
| # git show 0a6cba589532c1b8079e10d9f16511a0d3cd8961:src/filename.ext | |
| git show <treeish>:<file> | |
| # or | |
| git show HEAD~1:src/filename.ext |
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
| #!/usr/bin/env bash | |
| DATE_FORMAT="+%Y-%m-%d %H:%M:%S" | |
| echo "["$(date "$DATE_FORMAT")"] Running PHPCSFixer ..." | |
| COMMAND_GIT_DIFF="git diff --cached --name-status --diff-filter=ACM" | |
| COMMAND_PHP_CS_FIXER="./vendor/fabpot/php-cs-fixer/php-cs-fixer fix --dry-run --level=psr2 --verbose" | |
| PHP_FILES_TO_BE_COMMITED=`$COMMAND_GIT_DIFF | grep -E -o '\W+.*?\.php'` |
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
| #!/usr/bin/env bash | |
| BASE_PROJECT_DIR=`pwd` | |
| rm $BASE_PROJECT_DIR/.git/hooks/pre-commit 2> /dev/null | |
| ln -s $BASE_PROJECT_DIR/bin/git/hooks/pre-commit $BASE_PROJECT_DIR/.git/hooks/pre-commit | |
| chmod +x $BASE_PROJECT_DIR/.git/hooks/pre-commit |
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
| <?php | |
| // Nota: O ideal é que esse script fique em outro arquivo para | |
| // não misturar regras de negócio com o HTML ... | |
| $wsdl = "http://ws.registrocivil.org.br/listarCartoriosReceitaFederal.cfc?wsdl"; | |
| try { | |
| $options = array( | |
| 'soap_version' => SOAP_1_1, |
OlderNewer