Skip to content

Instantly share code, notes, and snippets.

@mneedham
mneedham / neo4j-wait.sh
Created Jan 19, 2017 — forked from benbc/neo4j-wait.sh
Example of using curl to wait for a Neo4j server to be up
View neo4j-wait.sh
#!/bin/bash
end="$((SECONDS+10))"
while true; do
[[ "200" = "$(curl --silent --write-out %{http_code} --output /dev/null http://localhost:7474)" ]] && break
[[ "${SECONDS}" -ge "${end}" ]] && exit 1
sleep 1
done
View WorldCup2014.adoc

The World Cup Graph

Initial Data Setup

View WorldCup2014.adoc

The World Cup Graph

The football World Cup is just under a week away so I thought we deserved a World Cup graph for the occasion. It’s still a work in progress but here’s what I’ve got so far.

View _financial_exposure.adoc

Modelling time-varying financial exposures in Neo4j

Answer to this Stackoverflow Question

Question

How would one model this kind of data in Neo4j?:

> HOLDINGS
   Portfolio                         Holding    Instrument       Date BALANCE.USD
View create_users.adoc

How to create relatonships between elements in a collection

This GraphGist answers a Stackoverflow question.

Creating A Sample User Graph

We want to create a social network, and have to connect some people. Let’s do that in two steps.

View navigation.adoc

Learning dem graph gists

Awesome

Something something, graph gist

View neo4j_last_startup.sh
#!/bin/bash
# tiny script to extract the logs of the latest startup sequence in a Neo4j instance
#
if (( $# == 0 )); then
echo "call me: $0 <path_to_messages.log>"
exit 1
fi
View neo4R_example.R
library('RCurl')
library('RJSONIO')
query <- function(querystring) {
h = basicTextGatherer()
curlPerform(url="http://localhost:7474/db/data/cypher",
postfields=paste('query',curlEscape(querystring), sep='='),
writefunction = h$update,
verbose = FALSE
)
View GraphGist-simple.adoc

A simple GraphGist

You create a GraphGist by creating a GitHub Gist in AsciiDoc and enter the URL to it in the form on this page.

Click on the Page Source button in the menu to see the source for this GraphGist!

Include a query console

//console

View GraphGist-simple.adoc

A simple GraphGist

You create a GraphGist by creating a GitHub Gist in AsciiDoc and enter the URL to it in the form on this page.

Click on the Page Source button in the menu to see the source for this GraphGist!

Include a query console

//console