Skip to content

Instantly share code, notes, and snippets.

View blazarecki's full-sized avatar

Benjamin Lazarecki blazarecki

View GitHub Profile
{% extends 'base.html.twig' %}
{% block body %}
{{ form(form) }}
{% endblock %}
<?php
namespace AppBundle\Tests;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Symfony\Component\Validator\Constraints\Collection;
use Symfony\Component\Validator\Constraints\Length;
use Symfony\Component\Validator\Constraints\NotBlank;
class TestCollection
{
"@context": "/contexts/Error",
"@type": "Error",
"hydra:title": "An error occurred",
"hydra:description": "Class \"AppBundle\\Entity\\State\" have no identifier.",
"trace": [{
"namespace": "",
"short_class": "",
"class": "",
"type": "",
{
"@context": "\/contexts\/Error",
"@type": "Error",
"hydra:title": "An error occurred",
"hydra:description": "Class \u0022AppBundle\\Entity\\State\u0022 is not a valid entity or mapped super class.",
"trace": [{
"namespace": "",
"short_class": "",
"class": "",
"type": "",
@blazarecki
blazarecki / requirements.md
Last active February 6, 2016 12:56
Workshop docker #1 - PHP dev env with docker - requirements

Before the workshop

Requirements

  • docker >= 1.9
  • docker-compose >= 1.5
  • docker-machine >= 0.5 (for MacOSX user only)
  • PHPStorm

All this requirements are provided by docker-toolbox.

export class HydraNormalizer {
rewriteRules: any;
normalizeRelations(model: string, element: any): void {
if (!this.rewriteRules[model]) {
return;
}
this.rewriteRules[model].forEach((column: string) => {
if (!element[column]) {
{{ define "upstream" }}
{{ if .Address }}
{{/* If we got the containers from swarm and this container's port is published to host, use host IP:PORT */}}
{{ if and .Container.Node.ID .Address.HostPort }}
# {{ .Container.Node.Name }}/{{ .Container.Name }}
server {{ .Container.Node.Address.IP }}:{{ .Address.HostPort }};
{{/* If there is no swarm node or the port is not published on host, use container's IP:PORT */}}
{{ else }}
# {{ .Container.Name }}
server {{ .Address.IP }}:{{ .Address.Port }};
brew install hhvm --verbose
==> Downloading https://github.com/facebook/hhvm/archive/HHVM-2.4.2.tar.gz
Already downloaded: /Library/Caches/Homebrew/hhvm-2.4.2.tar.gz
==> Verifying hhvm-2.4.2.tar.gz checksum
tar xf /Library/Caches/Homebrew/hhvm-2.4.2.tar.gz
==> Patching
patching file CMake/HPHPFindLibs.cmake
patching file hphp/runtime/ext/gd/libgd/gdft.cpp
==> rm -rf hphp/submodules/folly
==> ln -s /usr/local/opt/folly hphp/submodules/folly
@blazarecki
blazarecki / PopupDictionary.php
Last active November 10, 2021 15:54
Alert, confirm and prompt with mink
<?php
namespace Widop\Mink\Extension;
/**
* Dictionary to manage popups.
*
* @author Benjamin Lazarecki <benjamin.lazarecki@gmail.com>
*/
trait PopupDictionary