Skip to content

Instantly share code, notes, and snippets.

View mrcmorales's full-sized avatar
🏠
Working from home

Marc Morales Valldepérez mrcmorales

🏠
Working from home
  • Freelance
  • Amposta
View GitHub Profile
class WouzeeEventListener
{
protected $eventDispatcher;
public function __construct(EventDispatcherInterface $eventDispatcher)
{
$this->eventDispatcher = $eventDispatcher;
@mrcmorales
mrcmorales / gist:e3cd9f13828dea230036
Created November 15, 2014 15:53
Script test server hardware
wget freevps.us/downloads/bench.sh -O - -o /dev/null|bash
<?php
namespace CliCons\ExtranetBundle\Form\Type;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
class ConstructionFormType extends AbstractType
{
/** @var Ivory\GoogleMapBundle\Model\Map */
$map = $this->get('ivory_google_map.map');
$infoWindow = $this->get('ivory_google_map.info_window');
$marker = $this->get('ivory_google_map.marker');
$map->setMapOption('zoom', 4);
$map->setMapOption('mapTypeId', 'roadmap');
$map->setStylesheetOptions(array(
'width' => '100%',
public function findByPosition($latitude=40.46366700000001, $longitude=-3.7492200000000366, $distance=1500)
{
$config = $this->getEntityManager()->getConfiguration();
$config->addCustomNumericFunction('COS', 'DoctrineExtensions\Query\Mysql\Cos');
$config->addCustomNumericFunction('ACOS', 'DoctrineExtensions\Query\Mysql\Acos');
$config->addCustomNumericFunction('RADIANS', 'DoctrineExtensions\Query\Mysql\Radians');
$config->addCustomNumericFunction('SIN', 'DoctrineExtensions\Query\Mysql\Sin');
$qb = $this->createQueryBuilder('d')
->add('from','CliConsCoreBundle:User u')
@mrcmorales
mrcmorales / migrations table
Created December 28, 2013 14:17
add all migrations in new database
ls app/DoctrineMigrations | sed 's/[^0-9]*//g' | xargs -L 1 app/console doctrine:migrations:version --add
<?php
namespace Circuit\AppBundle\CsvModel;
use Circuit\AppBundle\Entity\Inscription;
use EasyCSV\Writer;
/**
* Class UserExportCsvWriter.
*/
@mrcmorales
mrcmorales / TwigFunction.php
Last active March 24, 2016 12:42
Twig function example
<?php
namespace Circuit\AppBundle\Twig;
use Circuit\AppBundle\Entity\Category;
use Circuit\AppBundle\Entity\Competition;
use Circuit\AppBundle\Entity\CompetitionSeason;
use Circuit\AppBundle\Entity\Event;
use Circuit\AppBundle\Entity\Race;
use Circuit\AppBundle\Enum\GenderEnum;
<VirtualHost *:80>
ServerName circuit.local
DocumentRoot /home/marc/work/circuit/web
<Directory /home/marc/work/circuit/web>
# enable the .htaccess rewrites
AllowOverride All
Require all granted
</Directory>