Configure PHP Lumen 5 HTTP Exception Handlers with common JSON responses.
Copy (replace) only the attached files to their respective directories. app/Exceptions/Handler.php and app/Http/Middleware/Authenticate.php
| <?php | |
| /** | |
| * PHP Coding Standards Fixer setting for Laravel 5 on friendsofphp/php-cs-fixer 2.* | |
| * Rules with psr1, psr2, phpdoc and some symfony rules. | |
| * Rules only apply directory and sub-directory inside "app". | |
| * | |
| * Save script to .php_cs and place .php_cs file in the root of your Laravel project | |
| * | |
| * Requirement: |
Configure PHP Lumen 5 HTTP Exception Handlers with common JSON responses.
Copy (replace) only the attached files to their respective directories. app/Exceptions/Handler.php and app/Http/Middleware/Authenticate.php
Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.
| #docker rm $(docker ps -a -q) | |
| function Remove-StoppedContainers { | |
| foreach ($id in & docker ps -a -q) { | |
| & docker rm $id } | |
| } | |
| #docker rmi $(docker images -f "dangling=true" -q) | |
| function Remove-DanglingImages { | |
| foreach ($id in & docker images -q -f 'dangling=true') { | |
| & docker rmi $id } |
| #!/bin/bash | |
| #To execute it directly: sudo bash <(curl -s https://gist.githubusercontent.com/agarzon/ecb0b92d4c8e1bbde126534c76721a58/raw/install-php-tools.sh) | |
| BIN_PATH=/usr/local/bin/ | |
| #COMPOSER | |
| sudo curl -LsS https://getcomposer.org/composer.phar -o ${BIN_PATH}composer | |
| sudo chmod a+x ${BIN_PATH}composer |
baseado no meu outro tutorial https://gist.github.com/luzfcb/1a7f64adf5d12c2d357d0b4319fe9dcd que é mais atualizado que este. Eu não constumo atualizar esse tutorial, mas é bom para dar uma visão geral simplista das configurações.
Use o pyenv https://github.com/pyenv/pyenv para baixar, instalar e gerenciar múltiplas versões do INTERPRETADOR Python na sua maquina.
Primeiro instale as dependências:
Linux (Ubuntu):
Directly from CLI
alias x='exit'
funcsave x
or create a file in
~/.config/fish/functions
with name
| # Get last 100 log entries as a PowerShell object | |
| $gitHist = (git log --format="%ai`t%H`t%an`t%ae`t%s" -n 100) | ConvertFrom-Csv -Delimiter "`t" -Header ("Date","CommitId","Author","Email","Subject") | |
| # Now you can do iterate over each commit in PowerShell, group sort etc. | |
| # Example to get a commit top list | |
| $gitHist|Group-Object -Property Author -NoElement|Sort-Object -Property Count -Descending | |
| # Example do something for each commit | |
| $gitHist|% {if ($_.Author -eq "Mattias Karlsson") {"Me"} else {"Someone else"} } |
| Quick tip for handling CSRF Token Expiration - common issue is when you use csrf protection is that if | |
| a form sits there for a while (like a login form, but any the same) the csrf token in the form will | |
| expire & throw a strange error. | |
| Handling it is simple, and is a good lesson for dealing with other types of errors in a custom manner. | |
| In Middleware you will see a file VerifyCsrfToken.php and be tempted to handle things there. DON'T! | |
| Instead, look at your app/Exceptions/Handler.php, at the render($request, Exception $e) function. | |
| All of your exceptions go through here, unless you have excluded them in the $dontReport array at the |