Skip to content

Instantly share code, notes, and snippets.

//
// AlgoForme.h
// AlgoForme
//
// Created by ARIAS Johann on 02/07/2015.
// Copyright (c) 2015 ARIAS Johann. All rights reserved.
//
#ifndef __AlgoForme__AlgoForme__
#define __AlgoForme__AlgoForme__
@choomz
choomz / GaufretteHandler.php
Created May 8, 2014 16:48
Events in upload process
<?php
/**
* This file is part of the VlabsMediaBundle package.
*
* (c) Valentin Ferriere <http://www.v-labs.fr>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
<?php
public function linkUserAction($id, Request $request)
{
/* @var $cm \Kitano\ConnectionBundle\Manager\ConnectionManagerInterface */
$cm = $this->get('kitano_connection.manager.connection');
/* @var $dm \Doctrine\ODM\MongoDB\DocumentManager */
$dm = $this->get('doctrine_mongodb')->getManager();
@choomz
choomz / Galery.php
Created February 13, 2013 20:47
Mapping exemple for an image galery with VlabsMediaBundle and dotrine ORM OneToMany bidirectional mapping
<?php
namespace Vlabs\GaleryDemoBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use Vlabs\MediaBundle\Annotation\Vlabs;
/**
* Vlabs\GaleryDemoBundle\Entity\Galery
<VirtualHost *:80>
ServerName gitlab.host.com
DocumentRoot /home/gitlab/gitlab/public
ErrorLog /var/log/apache2/gitlab_error.log
CustomLog /var/log/apache2/gitlab_access.log combined
<Proxy balancer://unicornservers>
BalancerMember http://127.0.0.1:8080
</Proxy>
{{ entity.image|vlabs_filter('resize', {'width': 300, 'height': 300 })|vlabs_media('image') }}
{{ entity.image|vlabs_filter('resize', {'width': 400, 'height': 300 })|vlabs_media('VlabsMediaBundle:Templates:image.html.twig') }}
{{ entity.image|vlabs_filter('crop', {'width': 200, 'height': 300 })|vlabs_media('VlabsMediaBundle:Templates:image.html.twig') }}
@choomz
choomz / gist:4361768
Created December 22, 2012 23:19 — forked from reel/gist:1638095
<?php
/*
* This class will give us a simple interface to interact with Datatables
*
* Meant to work with Datatables v1.9
*
* DO NOT FORGET TO ADD A GET() METHOD TO YOUR ENTITIES...
*
@choomz
choomz / gist:4361766
Created December 22, 2012 23:18 — forked from reel/gist:1638094
<?php
/*
* This class will give us a simple interface to interact with Datatables
*
* Meant to work with Datatables v1.9
*
* DO NOT FORGET TO ADD A GET() METHOD TO YOUR ENTITIES...
*
@choomz
choomz / gist:4077639
Created November 15, 2012 09:31
FiltType
<?php
namespace Vlabs\MediaBundle\Form\Type;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\Form\FormView;
use Vlabs\MediaBundle\Form\DataTransformer\BaseFileToStringTransformer;
@choomz
choomz / interface
Created November 5, 2012 08:38
Adapter media bundle
<?php
namespace Vlabs\MediaBundle\Adapter;
use Doctrine\Common\EventArgs;
interface AdapterInterface
{
/**
* Gets the mapped object from the event arguments.