Skip to content

Instantly share code, notes, and snippets.

View ikwattro's full-sized avatar

Christophe Willemsen ikwattro

View GitHub Profile
@ikwattro
ikwattro / console.log
Created May 17, 2015 13:02
TimeTree Neo4j setup
14:59:01.053 [main] INFO c.g.s.GraphAwareEnterpriseNeoServer - Setting startup timeout to: 120000ms based on 120000
14:59:03.133 [main] INFO c.g.r.b.RuntimeKernelExtension - GraphAware Runtime enabled, bootstrapping...
14:59:03.151 [main] INFO c.g.r.b.RuntimeKernelExtension - Bootstrapping module with ID TT, using com.graphaware.module.timetree.module.TimeTreeModuleBootstrapper
14:59:03.236 [main] INFO c.g.m.t.m.TimeTreeModuleBootstrapper - Node Inclusion Strategy set to com.graphaware.common.policy.composite.CompositeNodeInclusionPolicy@c19ff2c3
14:59:03.238 [main] INFO c.g.m.t.m.TimeTreeModuleBootstrapper - Timestamp Property set to time
14:59:03.238 [main] INFO c.g.m.t.m.TimeTreeModuleBootstrapper - Resolution set to DAY
14:59:03.255 [main] INFO c.g.m.t.m.TimeTreeModuleBootstrapper - Time zone set to +01:00
14:59:03.256 [main] INFO c.g.m.t.m.TimeTreeModuleBootstrapper - Relationship type set to FEEDBACK_CREATED_ON
14:59:03.256 [main] INFO c.g.m.t.m.TimeTreeModuleBootstrapper - AutoAttach set to tr
@ikwattro
ikwattro / bash.sh
Last active August 29, 2015 14:21
Simple sed script to deactivate neo4j auth
#!bin/bash
sed -i.bak 's/^\(dbms\.security\.auth_enabled=\).*/\1false/' ./conf/neo4j-server.properties
@ikwattro
ikwattro / transform.php
Created May 16, 2015 22:14
From NeoClient to Vis.js
$q = 'MATCH (n) OPTIONAL MATCH (n)-[r]-() RETURN r,n';
$result = $neoclient->sendCypherQuery($q)->getResult();
$graph = [];
foreach ($result->getNodes() as $node) {
$graph['nodes'][] = [
'id' => $node->getId(),
'label' => $node->getLabels()[0],
'group' => $node->getLabels()[0],
'properties' => $node->getProperties()
@ikwattro
ikwattro / graph.json
Created May 15, 2015 22:40
VisJs Json Example
{
"nodes": [
{
"id": 0,
"label": "Person",
"properties": {
"firstname": "Georgette",
"lastname": "Rogahn",
"birth_date": "1989-09-10 08:57:06",
"_id": "e956024d-4375-356d-97c8-9f95d09f7684",
@ikwattro
ikwattro / google.json
Last active August 29, 2015 14:21
cypherToGoogleDataTableFormatter
{
"cols": [
{
"id": "c.name",
"label": "C.name",
"type": "string"
},
{
"id": "people",
"label": "People",
@ikwattro
ikwattro / neo.js
Created May 13, 2015 19:22
Neo4j + jquery
var token = user + ':' +pwd;
var hash = btoa(token);
var authHeader = 'Basic ' + hash;
$.ajax({
url: endpoint,
type: "POST",
beforeSend: function (xhr){
xhr.setRequestHeader('Authorization', authHeader);
},
data: data,
@ikwattro
ikwattro / import.php
Created March 17, 2015 19:30
Wikimedia clickstream import
<?php
require_once(__DIR__.'/vendor/autoload.php');
use Neoxygen\NeoClient\ClientBuilder;
$client = ClientBuilder::create()
->addConnection('default', 'http', 'localhost', 7474, true, 'neo4j', 'password')
->setAutoFormatResponse(true)
->setDefaultTimeout(500)
@ikwattro
ikwattro / neo4j-http-logging.xml
Created March 16, 2015 05:23
xml props file for multiple patterns logging in neo4j
<configuration>
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>data/log/http.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>data/log/http.%d{yyyy-MM-dd_HH}.log</fileNamePattern>
<maxHistory>30</maxHistory>
</rollingPolicy>
<encoder>
<!-- Note the deliberate misspelling of "referer" in accordance with RFC1616 -->
<pattern>%h %l %user [%t{dd/MMM/yyyy:HH:mm:ss Z}] "%r" %s %b "%i{Referer}" "%i{User-Agent}" %D</pattern>
@ikwattro
ikwattro / instructions.md
Last active October 21, 2020 23:58
OS X Downgrade to Ant 1.9.3
# put this in your .bash_profile
if [ $ITERM_SESSION_ID ]; then
export PROMPT_COMMAND='echo -ne "\033];${PWD##*/}\007"; ':"$PROMPT_COMMAND";
fi
# Piece-by-Piece Explanation:
# the if condition makes sure we only screw with $PROMPT_COMMAND if we're in an iTerm environment
# iTerm happens to give each session a unique $ITERM_SESSION_ID we can use, $ITERM_PROFILE is an option too
# the $PROMPT_COMMAND environment variable is executed every time a command is run
# see: ss64.com/bash/syntax-prompt.html