Skip to content

Instantly share code, notes, and snippets.

View devdrops's full-sized avatar
🔥
Paz Entre Nós, Guerra Aos Senhores

Davi Marcondes Moreira devdrops

🔥
Paz Entre Nós, Guerra Aos Senhores
View GitHub Profile
@devdrops
devdrops / zendskeletonapplication_changes.md
Last active August 29, 2015 13:55
ZendSkeletonApplication: alterações necessárias!

Alterações ASAP:

  • Corrigir o caminho do componente de tradução;
    • Atenção em Application\Module->onBootstrap();
    • Atenção em module.config.php;
  • Modificar a forma de retorno de mensagem do InputFilter inválido em Core\Model\Entity->valid();
  • Criar branches:
    • Usando Doctrine;
    • Sem o uso do Doctrine;
  • Com possibilidade de alteração do estilo CSS (adicionar temas customizados).
@devdrops
devdrops / zf2_issue_filter.md
Last active August 29, 2015 14:05
Zend\Filter\DateTimeFormatter throws Exception when receives invalid date

08/07/2014 3:05pm

####Problem: While filtering using Zend\Filter\DateTimeFormatter to validate dates in pt_BR format. When inserting '1', it throws an Exception 'Invalid date string provided'.

Checking https://github.com/zendframework/zf2/blob/master/library/Zend/Filter/DateTimeFormatter.php#L77 , Zend\Filter\DateTimeFormatter throws an Exception to prevent \DateTime from crash (maybe?). This is somehow weird because filters shouldn't throw Exceptions IMHO.

Here's the method:

/**

@devdrops
devdrops / criteria.md
Last active August 29, 2015 14:12
Clean Code criteria

Clean Code criteria

Messages

  • Blank line at https://github.com/RocketBus/project/blob/feature/ABC-1234/path/to/file.php#L50

    There is a unnecessary blank line, which should be removed.

@devdrops
devdrops / dependencies.md
Last active September 8, 2015 18:38
Symfony "get-in-shape" dependencies list.
@devdrops
devdrops / command_from_controller.md
Created September 18, 2015 20:50
Calling a command from a controller, and get it's output.
@devdrops
devdrops / list.md
Last active October 14, 2015 02:50
Javier Eguiluz Awesome List of Awesome Slides with Symfony Related Content, yay! :D

Javier Eguiluz Awesome List of Awesome Slides with Symfony Related Content, yay! :D

First and most important: thank you @javiereguiluz!!

Title Published At Link
Twig Tips and Tricks february 2013 http://www.slideshare.net/javier.eguiluz/twig-tips-and-tricks
Silex Al Limite june 2013 http://www.slideshare.net/javier.eguiluz/silex-al-lmite
Symfony Tips and Tricks november 2014 http://www.slideshare.net/javier.eguiluz/symfony-tips-and-tricks
Mastering Twig september 2015 http://www.slideshare.net/javier.eguiluz/mastering-twig-druaplcon-barcelona-2015
@devdrops
devdrops / example.md
Last active December 7, 2015 13:23
PHP: using for instead of foreach

#PHP: using for instead of foreach

If you use PHPMD, you'll probably have already found the Avoid unused local variables such as $foo message at your foreach loops, where $foo represents the index for each value in your loop, as below:

foreach ($values as $foo => $bar) {
  // stuffs
}
@devdrops
devdrops / composer.json
Last active December 23, 2015 05:49
Added phpunit/phpunit to composer.json file. Trying to solve PHPUnit issues on a ZF2 project (see http://www.zfnapratica.com.br/ for details)
{
"name": "zendframework/skeleton-application",
"description": "Skeleton Application for ZF2",
"license": "BSD-3-Clause",
"keywords": [
"framework",
"zf2"
],
"homepage": "http://framework.zend.com/",
"require": {
@devdrops
devdrops / tips.bat
Created October 13, 2013 17:55
File created to implement a loop structure in a bat file to create a basic folder structure while the user still wants to create it.
@echo off
color 0A
title Window Title Goes Here!
cls
:start
echo.
echo ************************************
echo * BAT FILE TO CREATE STRUCTURES *
echo ************************************