Skip to content

Instantly share code, notes, and snippets.


Tristan Bessoussa tristanbes

View GitHub Profile
tristanbes / Book.php
Created Mar 19, 2012
How to dynamically add translations to your I18N object using SonataAdminBundle & DoctrineExtensions
View Book.php
namespace Demo\BookBundle\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use Gedmo\Mapping\Annotation as Gedmo;
* Demo\BookBundle\Entity\Book
tristanbes / Condition.php
Created May 22, 2012
The form's client data is expected to be of type scalar, but is an instance of class Doctrine\ORM\PersistentCollection
View Condition.php
namespace GamerCertified\TeamBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
* GamerCertified\TeamBundle\Entity\Conditions
* @ORM\Table(name="conditions")
View Car.php
class Car
* @ORM\OneToMany(targetEntity="Condition", mappedBy="Car", cascade={"all"}, orphanRemoval=true)
private $conditions;
View gist:3150616
Failed loading dlopen(, 9): image not found
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/zend/lib/php_extensions/' -
dlopen(/usr/local/zend/lib/php_extensions/, 9): no suitable image found.
Did find: /usr/local/zend/lib/php_extensions/ mach-o, but wrong architecture in Unknown on line 0
View gist:3150677
curl -s | bash -s 5.4
View Category.php
namespace AwesomeNamespace\AwesomeBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
use Gedmo\Mapping\Annotation as Gedmo;
* AwesomeNamespace\AwesomeBundle\Entity\Profile
View ProfileTranslation.php
namespace AwesomeNamespace\AwesomeBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Translatable\Entity\MappedSuperclass\AbstractPersonalTranslation;
* @ORM\Entity
* @ORM\Table(name="profile_translations",
View ProfileAdmin.php
namespace AwesomeNamespace\AwesomeBundle\Admin;
use Sonata\AdminBundle\Admin\Admin;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Datagrid\ListMapper;
* Profile Admin
View config
# Add the bundle to your composer
"a2lix/translation-form-bundle" : "dev-master"
# Enable the Bundle in the AppKernel.php
new A2lix\TranslationFormBundle\A2lixTranslationFormBundle(),
# Configure the Bundle in the config.yml
tristanbes / gist:3918310
Created Oct 19, 2012
Install Stats.d on a debian server
View gist:3918310
sudo apt-get update && apt-get install git-core curl build-essential openssl libssl-dev
# Don't forget to go to the location you want to install node in (like cd /home/) before running these commands
git clone
cd node
git checkout v0.8.12
./configure --openssl-libpath=/usr/lib/ssl
make test
You can’t perform that action at this time.