Skip to content

Instantly share code, notes, and snippets.

View JavierCane's full-sized avatar
🤟
Working on @CodelyTV

Javier Ferrer González JavierCane

🤟
Working on @CodelyTV
View GitHub Profile
@JavierCane
JavierCane / CBDE - Neo4j
Last active August 29, 2015 14:01
CBDE - Neo4j for the TPC-H structure
= CBDE - Pràctica Neo4j
:neo4j-version: 2.0.3
:author: Martí Zamora Casals & Javier Ferrer González
:twitter: @JavierCane
== Disclaimer
Pràctica feta per en Martí Zamora Casals i en https://twitter.com/JavierCane[Javier Ferrer González]. +
@JavierCane
JavierCane / Neo4j training queries
Last active August 29, 2015 14:02
Neo4j training queries
== Neo4j training
=== System init
We'll initialize the system with the actors, movies and directors dataset provided with the Neo4j installation.
// setup
// hide
[source,cypher]
----
CREATE (TheMatrix:Movie {title:'The Matrix', released:1999, tagline:'Welcome to the Real World'})
@JavierCane
JavierCane / Neo4j training inserts
Last active August 29, 2015 14:02
Neo4j training inserts
== Neo4j training (inserts, deletes and updates)
=== System init
We'll initialize the system with the actors, movies and directors dataset provided with the Neo4j installation.
// setup
// hide
[source,cypher]
----
CREATE (TheMatrix:Movie {title:'The Matrix', released:1999, tagline:'Welcome to the Real World'})
@JavierCane
JavierCane / ProductsJSONParser.java
Created June 11, 2013 14:36
parse attribute into hashmap
private static HashMap<String, String> getAttribute( JSONObject attributesJson )
{
HashMap<String, String> attribute = new HashMap<String, String>();
try
{
attribute.put( "key", attributesJson.getString( "key" ) );
attribute.put( "value", attributesJson.getString( "value" ) );
}

#Usage

  • Launch Automator (Applications > Utilities > Automator)
  • Select Utilities from the Library
  • Drag "Run AppleScript" into workflow
  • Paste and edit the below as appropriate.

###The AppleScript

<?php
namespace AppBundle\Controller;
use FOS\RestBundle\Controller\FOSRestController;
use Symfony\Component\HttpFoundation\Request;
final class CourseController extends FOSRestController
{
public function getCourseAction(Request $request)
{
return $this->getDoctrine()
->getEntityManager()
<?php
namespace AppBundle\Controller;
use FOS\RestBundle\Controller\FOSRestController;
use Symfony\Component\HttpFoundation\Request;
final class CourseController extends FOSRestController
{
public function getCourseAction(Request $request)
{
return $this->getDoctrine()
->getEntityManager()
<?php
namespace AppBundle\Tests\Controller;
use AppBundle\Controller\CourseController;
use Doctrine\Bundle\DoctrineBundle\Registry;
use Doctrine\ORM\AbstractQuery;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\QueryBuilder;
use PHPUnit_Framework_TestCase;
<?php
namespace CodelyTv\Api\Controller;
use CodelyTv\Context\Meetup\Module\Video\Domain\Create\CreateVideoCommand;
use CodelyTv\Infrastructure\Bus\Command\CommandBus;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
<?php
namespace CodelyTv\Context\Meetup\Module\Video\Domain\Create;
use CodelyTv\Context\Meetup\Module\Video\Domain\Video;
use CodelyTv\Context\Meetup\Module\Video\Domain\VideoId;
use CodelyTv\Context\Meetup\Module\Video\Domain\VideoRepository;
use CodelyTv\Context\Meetup\Module\Video\Domain\VideoTitle;
use CodelyTv\Context\Meetup\Module\Video\Domain\VideoUrl;
use CodelyTv\Infrastructure\Bus\Event\DomainEventPublisher;