Skip to content

Instantly share code, notes, and snippets.

View ajgarlag's full-sized avatar

Antonio J. García Lagar ajgarlag

View GitHub Profile
@mindplay-dk
mindplay-dk / migrator.php
Created June 16, 2012 19:11
Migrate a PHP codebase to use namespaces.
<?php
/**
* Namespace Migration Script
*
* @author Rasmus Schultz <rasmus@mindplay.dk>
* @license http://www.gnu.org/licenses/gpl-3.0.txt
*
* This script will scan through an entire PHP codebase and rewrite the
* scripts, adding a namespace clause based on the directory structure,
@okunishinishi
okunishinishi / Remove all git tags
Created March 8, 2014 03:12
Delete all git remote tags
#Delete local tags.
git tag -l | xargs git tag -d
#Fetch remote tags.
git fetch
#Delete remote tags.
git tag -l | xargs -n 1 git push --delete origin
#Delete local tasg.
git tag -l | xargs git tag -d
@guilhermeblanco
guilhermeblanco / issue1.md
Last active August 29, 2015 14:14
Form deficiencies when dealing with GET requests

IntegerType does not properly validate in GET.

When creating a request like this: /page?page=1

And considering I have this in my FormType:

$builder->add('page', 'integer', array(
    'empty_data' => 1,
));
@Invis1ble
Invis1ble / MenuBuilder.php
Last active March 3, 2020 10:04 — forked from nateevans/MenuBuilder.php
KNP Menu Bundle with Bootstrap 3 and Font Awesome 4 (+ fixed several bugs)
<?php
namespace Acme\HelloBundle\Menu;
use Knp\Menu\FactoryInterface;
use Symfony\Component\DependencyInjection\ContainerAware;
class MenuBuilder extends ContainerAware
{
public function mainMenu(FactoryInterface $factory, array $options)