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 / .conkyrc
Created September 29, 2011 08:11
My conky configuration
background no
font Sans:size=10
xftfont Sans:size=10
use_xft yes
xftalpha 0.9
update_interval 3.0
total_run_times 0
own_window yes
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
@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.
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;
<?php
/**
* @param $form
* @return array
*/
private function getErrorsAsArray($form)
{
$errors = [];
foreach ($form->getErrors() as $error) {
@desarrolla2
desarrolla2 / example1.php
Last active December 18, 2015 10:59
Charla Monolog
<?php
$record = 'OLA K ASE';
/**
* Log record
*
* @param string $record
*/
function log($record){
@desarrolla2
desarrolla2 / PrimeNumber.php
Last active December 16, 2015 14:09
PrimeNumber.php
<?php
/**
* This file is part of the planetubuntu proyect.
*
* Copyright (c)
* Daniel González <daniel.gonzalez@freelancemadrid.es>
*
* This source file is subject to the MIT license that is bundled
* with this package in the file LICENSE.
@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.
*/
@desarrolla2
desarrolla2 / cheatsheet.md
Created August 30, 2012 09:56
cheatsheet.md

Header 1

Header 2

Header 3 ### (Hashes on right are optional)

Header 4

Header 5

Markdown plus h2 with a custom ID ## {#id-goes-here}

Link back to H2

This is a paragraph, which is text surrounded by whitespace. Paragraphs can be on one