Skip to content

Instantly share code, notes, and snippets.

View rpg600's full-sized avatar

Reinis Grinbergs rpg600

  • SensioLabs
  • Paris
View GitHub Profile
<?php
use Behat\Behat\Hook\Scope\ScenarioScope;
trait Taggable
{
protected $tags = [];
protected $tagLoaded = false;
/**
@rpg600
rpg600 / cheatsheat.md
Last active July 31, 2018 12:18
React/redux workshop cheat sheat

functions

// define a function

function add(x, y) { return x + y; }

// define a function (wow! that is 8 chars shorter)

const add = (x, y) =&gt; x + y;
<?php
// on boucle 5 fois
for ($i = 1; $i <= 5; $i++) {
try {
call_pangolin();
} catch (Exception $e) {
// on affiche l'exception s'il y en a une
echo 'Exception reçue : ', $e->getMessage(), "\n";
}
@rpg600
rpg600 / UserType.php
Created July 22, 2014 11:21
UserType.php
<?php
namespace ReflectGen\Bundle\Form;
use FOS\UserBundle\Doctrine\UserManager;
use ReflectGen\Bundle\Infra\Mailer;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
@rpg600
rpg600 / User.php
Last active August 29, 2015 14:04
UserAssignmentType.php
<?php
namespace ReflectGen\Bundle\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use FOS\UserBundle\Model\User as BaseUser;
use ReflectGen\Bundle\Entity\Traits\PlatformAwareTrait;
use ReflectGen\Bundle\Framework\Validator\Constraints as ReflectGenAssert;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
@rpg600
rpg600 / Vagrantfile
Created June 28, 2013 11:29
Vagrantfile
Vagrant::Config.run do |config|
config.vm.box = "squeeze64puppet3"
config.vm.box_url = "http://l4bs.slynett.com/vagrant/squeeze64-puppet3.box"
config.vm.customize [ "modifyvm", :id, "--name", "Default Symfony 2 VM 232a4e9ea0727b13c9f49c00d301f745" ]
config.vm.customize [ "modifyvm", :id, "--memory", "1024", "--cpus", "2" ]
config.vm.network :hostonly, "11.11.11.11"
config.vm.host_name = "dev.local"
@rpg600
rpg600 / init.pp
Created June 28, 2013 11:28
init.pp
# Class: apache
#
# This class installs Apache
#
# Parameters:
#
# Actions:
# - Install Apache
# - Manage Apache service
#