Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
// see: https://github.com/chadoe/docker-cleanup-volumes
$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
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 php | |
| <?php | |
| /** | |
| * .git/hooks/pre-commit | |
| * | |
| * This pre-commit hooks will check for PHP errors (lint), and make sure the | |
| * code is PSR-2 compliant. | |
| * | |
| * Dependecy: PHP-CS-Fixer (https://github.com/fabpot/PHP-CS-Fixer) | |
| */ |
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
| server { | |
| location /phpmyadmin { | |
| root /usr/share/; | |
| index index.php index.html index.htm; | |
| location ~ ^/phpmyadmin/(.+\.php)$ { | |
| try_files $uri =404; | |
| root /usr/share/; | |
| fastcgi_pass 127.0.0.1:9000; | |
| fastcgi_index index.php; | |
| fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; |
Most of the hard work is done by @nateevans https://gist.github.com/nateevans/9958390
Thank you!
Requires Twig ^1.2 | ^2.0
{% extends 'knp_menu.html.twig' %}
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
| {% extends 'form_div_layout.html.twig' %} | |
| {% block form_row -%} | |
| <div class="row{% if (not compound or force_error|default(false)) and not valid %} has-error{% endif %}"> | |
| <div class="input-field col s12"> | |
| {{- form_widget(form) -}} | |
| {{- form_label(form) -}} | |
| {{- form_errors(form) -}} | |
| </div> | |
| </div> |
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 | |
| use Symfony\Component\Translation\TranslatorInterface; | |
| function format(\DateTime $date, TranslatorInterface $translator) | |
| { | |
| $diff = date_create()->diff($date); | |
| $seconds = $diff->days * 86400 + $diff->h * 3600 + $diff->i * 60 + $diff->s; | |
| $format = $translator->transChoice('reldate', $seconds); |
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
| {% extends 'form_div_layout.html.twig' %} | |
| {% block form_row -%} | |
| <div class="row{% if (not compound or force_error|default(false)) and not valid %} has-error{% endif %}"> | |
| <div class="input-field col s12"> | |
| {{- form_widget(form) -}} | |
| {{- form_label(form) -}} | |
| {{- form_errors(form) -}} | |
| </div> | |
| </div> |
NewerOlder