Skip to content

Instantly share code, notes, and snippets.

View ryanotella's full-sized avatar

Ryan ryanotella

  • NSW Department of Education
  • Sydney, Australia
View GitHub Profile
@ryanotella
ryanotella / logrotate.conf
Created February 12, 2015 00:25
Example logrotate.conf
/home/user/app/logs/prod.log {
create 600 user group
notifempty
daily
rotate 14
missingok
compress
mail email@address
}
@ryanotella
ryanotella / base.html.twig
Created May 20, 2014 07:41
KnpMenu and base.html.twig
<div class="nav-collapse collapse">
{{ knp_menu_render('TaliceAdminBundle:Menu:main', { 'allow_safe_labels': true , 'nav_type': 'navbar' }) }}
<div class="navbar-text navbar-user pull-right">
<div>
<a id="logoutLink"
data-shift="{{ shift_active() ? 'yes' : 'no' }}"
href="{{ path("user_logout_end_shift") }}">
<i class="icon-off icon-white"></i>
</a>
@ryanotella
ryanotella / AddAdditionalFields.php
Last active January 2, 2016 08:49
Symfony 2.2: Dynamic disabled fields. This won't
<?php
namespace Crana\OrdersBundle\EventListener;
use Symfony\Component\Form\Event\DataEvent;
use Symfony\Component\Form\FormConfigBuilder;
use Symfony\Component\Form\FormConfigInterface;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormFactoryInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
<?php
/** @ORM\Entity */
class AttributeType
{
/**... */
private $id;
/** @ORM\Column(type="string") */
private $name;