Skip to content

Instantly share code, notes, and snippets.

View jonathaningram's full-sized avatar

Jonathan Ingram jonathaningram

View GitHub Profile
<!DOCTYPE html>
<html>
<head>
{% if block('title') %}
{% set title = block('title') ~ ' - My App' %}
{% else %}
{% set title = 'My App' %}
{% endif %}
<title>{{ title }}</title>
</head>
{% extends 'MyAppCoreBundle::layout.html.twig' %}
{% block title %}
{{ 'my_app.core.view.somewhere.something.title'|trans }}{{ parent() }}
{% endblock %}
@jonathaningram
jonathaningram / gist:1476139
Created December 14, 2011 11:04
Cannot remove entities then flush on a "Tree" structured entity
<?php
/**
* @Gedmo\Tree(type="nested")
*
* @ORM\Entity(repositoryClass="Gedmo\Tree\Entity\Repository\NestedTreeRepository")
* @ORM\Table(name="node_tree")
* @ORM\InheritanceType("JOINED")
* @ORM\DiscriminatorColumn(name="discr", type="string")
* @ORM\DiscriminatorMap({"node" = "Node", "sub_node" = "SubNode"})
<service id="security.acl.object_identity_retrieval_strategy" class="Jbi\CoreBundle\Security\Acl\Domain\ObjectIdentityRetrievalStrategy" public="false">
<argument type="service" id="doctrine.orm.entity_manager" />
</service>
<?php
namespace Jbi\CoreBundle\Security\Acl\Domain;
use Symfony\Component\Security\Acl\Exception\InvalidDomainObjectException;
use Symfony\Component\Security\Acl\Model\ObjectIdentityRetrievalStrategyInterface;
use Symfony\Component\Security\Acl\Domain\ObjectIdentity;
use Doctrine\ORM\EntityManager;
@jonathaningram
jonathaningram / is_null.sh
Created May 3, 2012 02:08
Changing is_null($x) to null === $x or !is_null($x) to null !== $x in PHP
#!/bin/bash
# Assume we look in tmp
# For is_null
find tmp/ -type f -name "*.php" -exec sed -i -r 's#\([^\!]\)is_null\s*(\([^()]*\))#\1\2 === null#g' {} \;
# For !is_null
find tmp/ -type f -name "*.php" -exec sed -i -r 's#[\!]is_null\s*(\([^()]*\))#\1 !== null#g' {} \;
$ httpd -S
VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
_default_:443 app.supert.ag (/etc/httpd/conf.d/ssl.conf:74)
*:80 app.supert.ag (/etc/httpd/conf/httpd.conf:1043)
Syntax OK
<VirtualHost _default_:443>
# General setup for the virtual host, inherited from global configuration
#DocumentRoot "/var/www/html"
#ServerName www.example.com:443
# Use separate log files for the SSL virtual host; note that LogLevel
# is not inherited from httpd.conf.
ErrorLog logs/ssl_error_log
TransferLog logs/ssl_access_log
Acme
Domain
Entity
Factory
Repository
Service
Acme
Domain
Entity
CategoryInterface.php
ProductInterface.php
Factory
CategoryFactoryInterface.php
ProductFactoryInterface.php
Repository
CategoriesRepositoryInterface.php