Skip to content

Instantly share code, notes, and snippets.

@raulfraile
raulfraile / study_group.md
Last active August 29, 2015 14:07
Study group

Study group

The goal of the study group is to learn together cool/advanced/edge stuff that we are not used to see in the PHP world, such as:

  • Turing machines
  • Data mining
  • Esoteric languages
  • Database internals
  • Data structures
  • Algorithms
@raulfraile
raulfraile / servergrove_mail_checker.php
Created April 15, 2015 12:32
ServerGrove mail checker
<?php
<<<CONFIG
packages:
- "swiftmailer/swiftmailer: ~5.0"
CONFIG;
$from = $argv[1];
$to = $argv[2];
$transport = \Swift_SmtpTransport::newInstance('mail.servergrove.com', 25)
@raulfraile
raulfraile / servergrove.com.har
Created April 30, 2015 11:11
servergrove.com HAR file
This file has been truncated, but you can view the full file.
{
"log": {
"version": "1.2",
"creator": {
"name": "WebInspector",
"version": "537.36"
},
"pages": [
{
"startedDateTime": "2015-04-30T11:03:32.737Z",
@raulfraile
raulfraile / jsonlint.php
Created June 2, 2015 08:42
JSON linter
<?php
<<<CONFIG
packages:
- "seld/jsonlint: 1.3.1"
CONFIG;
use Seld\JsonLint\JsonParser;
$parser = new JsonParser();
@raulfraile
raulfraile / kernel
Created July 21, 2011 15:43
prueba symfony
<?php
namespace { require_once __DIR__.'/autoload.php'; }
namespace Symfony\Component\DependencyInjection
{
@raulfraile
raulfraile / gist:1261181
Created October 4, 2011 08:53
Colorear errores Symfony2 + Twig + Twitter Bootstrap
{% block field_row %}
<div class="clearfix{% if errors|length > 0 %} error{% endif %}">
...
{% endblock %}
@raulfraile
raulfraile / gist:1761071
Created February 7, 2012 18:18
PHP 5.4 tests
=====================================================================
FAILED TEST SUMMARY
---------------------------------------------------------------------
Bug #32001 (xml_parse*() goes into infinite loop when autodetection in effect), using UTF-* [ext/xml/tests/bug32001.phpt]
=====================================================================
@raulfraile
raulfraile / gist:1887653
Created February 22, 2012 21:50
Colecciones en formularios de Symfony
/* Form hijo */
<?php
namespace Acme\Bundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilder;
class HijoType extends AbstractType
@raulfraile
raulfraile / gist:1887983
Created February 22, 2012 22:28
Entity hija
/**
* @var Padre
*
* @ORM\ManyToOne(targetEntity="Padre")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="padre_id", referencedColumnName="id")
* })
*/
private $padre;
/**
* @ORM\OneToMany(targetEntity="Hija", mappedBy="padre", cascade={"persist", "remove"})
*/
private $hijas;