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 / 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

@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 / GildedRose.php
Last active January 14, 2019 17:48
Base for the GildedRose kata
<?php
class GildedRose {
public static function updateQuality(
$items
) {
for ($i = 0; $i < count($items); $i++) {
if (("Aged Brie" != $items[$i]->getName()) && ("Backstage passes to a TAFKAL80ETC concert" != $items[$i]->getName())) {
if ($items[$i]->getQuality() > 0) {
if ("Sulfuras, Hand of Ragnaros" != $items[$i]->getName()) {
@JavierCane
JavierCane / composer.json
Last active January 14, 2019 17:49
Basic composer.json
{
"name": "unique-name/kata-name",
"description": "Kata description",
"type": "project",
"license": "proprietary",
"require": {
"php": "^7.3"
},
"require-dev": {
"symfony/var-dumper": "^4.2",
<?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;