Skip to content

Instantly share code, notes, and snippets.

View ikwattro's full-sized avatar

Christophe Willemsen ikwattro

View GitHub Profile
@ikwattro
ikwattro / sfadvancedmailer.php
Created September 24, 2012 12:48
Module php file
<?php
require_once _PS_MODULE_DIR_ . 'sfadvancedmailer/models/Client.php';
/**
*
* @author Christophe Willemsen
*/
class SfAdvancedMailer extends Module {
@ikwattro
ikwattro / gist:3798644
Created September 28, 2012 08:30
adding neo4j server spatial plugin
#install the plugin
cp $NEO4J_SPATIAL_HOME/target/neo4j-spatial-XXXX-server-plugin.zip
$NEO4J_HOME/plugins
cd unzip neo4j-spatial-XXXX-server-plugin.zip -d $NEO4J_HOME/plugins
#start the server
$NEO4J_HOME/bin/neo4j start
curl http://localhost:7474/db/data/
{ "relationship_index" : "http://localhost:7474/db/data/index/relationship", "node" : "http://localhost:7474/db/data/node", "relationship_types" : "http://localhost:7474/db/data/relationship/types", "extensions_info" : "http://localhost:7474/db/data/ext", "node_index" : "http://localhost:7474/db/data/index/node", "reference_node" : "http://localhost:7474/db/data/node/0", "extensions" : { "SpatialPlugin" : { "addSimplePointLayer" : "http://localhost:7474/db/data/ext/SpatialPlugin/graphdb/addSimplePointLayer", "addNodeToLayer" : "http://localhost:7474/db/data/ext/SpatialPlugin/graphdb/addNodeToLayer" } } }
<?php
namespace Lunetics\TimezoneBundle\Validator;
use Symfony\Component\Validator\Constraint;
/**
* @Annotation
*/
class Timezone extends Constraint
@ikwattro
ikwattro / example.html
Created October 3, 2012 17:21
html hypermedia users collection with properties
<ul class="php_users">
<li class="collection_info" id="collection_total">20</li>
<li class="collection_info" id="collection_page">1</li>
<li id="collection_data">
<ul class="users" id="user1">
<li id="user_name">ludo</li>
<li id="user_email">ludo@ludo.com</li>
</ul>
<ul class="users" id="user2">
<li id="user_name">kris</li>
@ikwattro
ikwattro / spatial.php
Created October 6, 2012 07:03
Neo4j Spatial Tests
<?php
require_once('./vendor/autoload.php');
use Kwattro\Neo4jClient;
$bclient = new Neo4jClient();
$client = $bclient->getClient();
$request = $client->get('/db/data');
$response = $request->send();
@ikwattro
ikwattro / products.csv
Last active August 29, 2015 14:04
neo4j translatable modelling imports
id title desc
1 crayon ma description en fr
2 palette maquillage sublime palette de maquillage
3 set de manucure set de 4 accessoires de manucure
@ikwattro
ikwattro / mar-piracy-graphgist.adoc
Created July 20, 2014 18:43
maritime piracy statistics 2013

=Maritime Pircacy Reports of 2013

@ikwattro
ikwattro / instructions.markdown
Last active August 29, 2015 14:04
Import des données RATP dans Neo4j

Creating indexes

CREATE INDEX ON :Stop(id);
CREATE INDEX ON :Route(id);
CREATE INDEX ON :Trip(id);

Loading Stops

USING PERIODIC COMMIT
LOAD CSV WITH HEADERS FROM "file:c:/Users/willemsen.c/Downloads/ratp/sourcedata/full/stops.txt" AS csv
@ikwattro
ikwattro / Foo.php
Created August 1, 2014 15:42 — forked from Ocramius/Foo.php
<?php
class Foo
{
protected $foo;
protected $bar;
protected $baz;
}
@ikwattro
ikwattro / wiw.md
Created August 13, 2014 21:20
Gh4j Queries

Which User did the most forks

MATCH (n:User)-[:DO]-(event)-[:FORK]-(fork:Fork)
WITH n, collect(fork) as forks
ORDER BY forks DESC
RETURN n.name, count(forks) as forkees
LIMIT 1