Skip to content

Instantly share code, notes, and snippets.

@jmolivas
jmolivas / javascript-data-grid.md
Last active August 29, 2015 13:57
Javascript data grid widget
@jmolivas
jmolivas / EntityRepository.php
Created March 26, 2014 16:30
Entity repository extract
/**
* @param integer $id
*
* @return array
*/
public function findBySomething($id)
{
$queryBuilder = $this->queryBySomething($id);
return $queryBuilder->getQuery()->getResult();
@jmolivas
jmolivas / Vagrantfile
Created April 29, 2014 15:24
Adding customizable configuration to Vagrantfile
require "yaml"
parameter_file = "./parameters.yml"
parameters = Array.new(0)
if File.exists?(parameter_file)
parameters = YAML::load_file(parameter_file)
end
# Apply configuration values if available
@jmolivas
jmolivas / gist:90b406b459b76a5e374e
Created September 1, 2014 04:23
ORM won't kill any kittens
public function indexAction(){
$entityManager = $this->getDoctrine()->getManager();
$articles = $entityManager->getRepository('ORMDemoBundle:Article')->findAll();
return $this->render(
'ORMDemoBundle:Article:index.html.twig',
['articles' => $articles]
);
@jmolivas
jmolivas / console-container-debug.sh
Last active August 29, 2015 14:08
Two Drupal core bugs found using the console project
$ bin/console container:debug
<?php
namespace Drupal\AppConsole\Command;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Drupal\Core\Extension\ExtensionDiscovery;