Skip to content

Instantly share code, notes, and snippets.

View desarrolla2's full-sized avatar
💭
Team Manager and Developer | PHP | Symfony.

Daniel González desarrolla2

💭
Team Manager and Developer | PHP | Symfony.
View GitHub Profile
@desarrolla2
desarrolla2 / Lorem.php
Created November 18, 2015 09:38
Lorem Ipsum generator for php faker in spanish
<?php
/*
* This file is part of the mitula.products package.
*
* (c) Daniel González <daniel@desarrolla2.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
<?php
/*
* This file is part of the shows on demand package.
*
* (c) Daniel González <daniel@desarrolla2.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
<?php
ini_set('display_errors',0);
register_shutdown_function('shutdown');
$obj = new stdClass();
$obj->method();
function shutdown()
{
if(!is_null($e = error_get_last()))
<?xml version="1.0" encoding="UTF-8" ?>
<doctrine-mapping
xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"
xmlns:gedmo="http://gediminasm.org/schemas/orm/doctrine-extensions-mapping">
<entity name="Tadium\Component\Promotion\Model\Promotion"
<?php
/**
* This file is part of the lapera.local package.
*
* (c) Daniel González <daniel@desarrolla2.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace LaPera\RestBundle\Controller;
<?php
use FastFeed\Factory;
$fastFeed = Factory::create();
$fastFeed->addFeed('default', 'http://desarrolla2.com/feed');
$items = $fastFeed->fetch('default');
server {
listen 8080;
server_name www.desarrolla2.com blog.desarrolla2.com;
rewrite ^(.*) http://desarrolla2.com$1 permanent;
}
server {
listen 8080;
<?php
namespace Mocks;
use Doctrine\DBAL\Driver\Statement;
/**
* Doctrine DBAL Statement implementing \Iterator.
*
* This class has been created because of a bug in PHPUnit Mock Objects.
@desarrolla2
desarrolla2 / DefaultController.php
Last active December 27, 2015 07:49
performance comparison mysql / doctrine vs ranbbit mq. The aim is to compare which is the performance difference between leaving a message on rabbit, or create a record in mysql. Doctrine and Rabbit are not the same technology, but we want to compare which is the performance difference, to know whether in a particular case, we should introduce r…
<?php
namespace Desarrolla2\Bundle\AnalyticsBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Component\HttpFoundation\JsonResponse;
use Desarrolla2\Bundle\AnalyticsBundle\Entity\Data;
@desarrolla2
desarrolla2 / gist:7216729
Created October 29, 2013 15:23
default.vcl
backend default {
.host = "127.0.0.1";
.port = "8080";
}
# vcl_recv (yes, we’re skimpy with characters, it’s Unix) is called at the beginning of a request, after the complete request has been received and parsed. Its purpose is to decide whether or not to serve the request, how to do it, and, if applicable, which backend to use.
# In vcl_recv you can also alter the request. Typically you can alter the cookies and add and remove request headers.
# Note that in vcl_recv only the request object, req is available.