Skip to content

Instantly share code, notes, and snippets.

View ikwattro's full-sized avatar

Christophe Willemsen ikwattro

View GitHub Profile
@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
@ikwattro
ikwattro / pullRequestEventPayload.markdown
Created August 21, 2014 00:18
Github Data Archive Event Payloads

PullRequestEventPayload

Array
(
    [created_at] => 2014-06-01T00:06:23-07:00
    [payload] => Array
        (
            [action] => opened
            [number] => 3
@ikwattro
ikwattro / basic-query1.markdown
Last active August 29, 2015 14:05
neo4j-github-recommendation
MATCH (u:User)-[r:DO]->()
RETURN u.name, count(r) as events
ORDER BY events DESC
LIMIT 1
---------
u.name	events
imclab	273
Returned 1 row in 2755 ms
@ikwattro
ikwattro / result.php
Created August 24, 2014 17:39
packagist api response
Packagist\Api\Result\Package Object
(
[name:protected] => sylius/sylius
[description:protected] => Modern ecommerce for Symfony2
[time:protected] => 2013-01-18T20:48:01+00:00
[maintainers:protected] => Array
(
[0] => Packagist\Api\Result\Package\Maintainer Object
(
[name:protected] => pjedrzejewski
@ikwattro
ikwattro / escape.php
Last active August 29, 2015 14:06
escapeTerm
<?php
public function escapeTerm($input)
{
$pattern = '/(\+|-|&&|\|\||!|\(|\)|\{|}|\[|]|\^|"|~|\*|\?|:|\/|\\\)/';
return preg_replace($pattern, '\\\$1', $input);
}
@ikwattro
ikwattro / pattern.md
Last active August 29, 2015 14:06
Neo4j graphaware changefeed pattern tracker

Using the graphfeed module from Graphaware, it is easy to track specific changes made to the graph:

((([-,:{}'"\w\s]))(?\-)(\[[-:{}|\w]*\]-?)(([-,:{}'"\w\s]))){1,}

Will match the following pattern :