Skip to content

Instantly share code, notes, and snippets.

View jexp's full-sized avatar
🐉
Watching the chamaeleon.

Michael Hunger jexp

🐉
Watching the chamaeleon.
View GitHub Profile
@jexp
jexp / JQAssistantReader.java
Last active August 29, 2015 14:07
jQAssistant concept and constraint definitions as AsciiDoc (http://jqassistant.org | http://github.com/buschmais/jqassistant)
package jexp.adoc;
import org.asciidoctor.Asciidoctor;
import org.asciidoctor.ast.ContentPart;
import org.asciidoctor.ast.DocumentHeader;
import org.asciidoctor.ast.StructuredDocument;
import java.io.File;
import java.util.*;
// On https://analytics.twitter.com/user/<name>/home
// run this in developer console
// essentially:
$(".home-group-row").map(function(x) { var group=$(this); return group.find(".home-group-header").text()+","+ ['tweets','tweetviews','profile-views','mentions','followers'].map(function(tag) { return group.find(".metric-"+tag).text(); }).join(","); }).toArray().join("\n")
// prettied up:
var metrics = ['tweets','profile-views','mentions','followers','tweetviews'];
"month\t" + metrics.join("\t") + "\n" +
@jexp
jexp / how-is-x-done.adoc
Created June 28, 2016 10:01
neo4j knowledge base template

How is X done

To display the nodes with the most properties defined, run the following Cypher Statement:

@jexp
jexp / _links.adoc
Last active December 8, 2016 16:08
Run Multi-Instance Causal Cluster of Neo4j 3.1 RC1 (also see the links)
@jexp
jexp / __numbers_31.txt
Last active December 14, 2016 00:59
Concurrent Neo4j Performance Tests via HTTP + Cypher (usage: ./_run_ab.sh 4 10000 create_plain.json)
Unusable on spinning disk, these results are from an SSD.
1M x create node+rel in 38s, 26k r/s
1M x create 2 nodes, 2 relationships, 2 properties in 47s, 21k r/s -> 80k records / s
1M x create 2 nodes with labels, 2 rels, 0 properties in 140s, 7k r/s
100k x create 100 rel + node -> 10M in 20s, 5k r/s
1M lookups by id in 22s, 43k r/s
1M lookup by id compiled runtime in 21s, 47k r/s
@jexp
jexp / neo_datatable.js
Last active January 30, 2017 15:05
Bookmarklet to zoom and pan Neo4j graph viz and query plans, Hold "Alt" to zoom & pan.
javascript: (function() {
var createTable = function() { $("neo-table > table.table.data:not(datatable)").addClass("datatable").DataTable(); };
if ($("#style-datatable").length == 0) {
$("body").append($('<link id="style-datatable" rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.13/css/jquery.dataTables.min.css">'));
$.getScript('//cdn.datatables.net/1.10.13/js/jquery.dataTables.min.js',createTable);
} else {
createTable();
}
})();
@jexp
jexp / _usage.adoc
Last active February 13, 2017 01:53
Augment Neo4j Browser with Zoom, DataTable and Charts Moved to: https://github.com/jexp/spoon-neo4j/

Add Bookmarklet

Please note there is now a dedicated project for this: https://github.com/jexp/spoon-neo4j/

Adds these features to Neo4j Browser

  • DataTable (search, sort, paginage)

  • Zoom for graphs and query plans (Hold Alt- and drag / pan)

  • Charts (Currently Line-Charts)

@jexp
jexp / memegraph.adoc
Last active March 13, 2017 12:54
Creating a reddit meme graph with neo4jsandbox.com and Cypher's LOAD CSV from https://github.com/umbrae/reddit-top-2.5-million/blob/master/data/memes.csv

The Reddit Meme Graph

@jexp
jexp / RunNeo4jImport.bat
Last active May 24, 2017 08:41
launch neo4j-shell in Neo4j-Desktop (exe on Windows, dmg on OSX)
"C:\Program Files\Neo4j Community\jre\bin\java" -cp "C:\Program Files\Neo4j Community\bin\neo4j-desktop-3.0.2.jar" \
org.neo4j.tooling.ImportTool %*
@jexp
jexp / spark-neo4j-pagerank.scala
Created October 13, 2015 20:49
DBPedia in Neo4j -> Read from Neo4j -> Run PageRank (5 iterations) -> Write back to Neo4j
// running spark on a large single machine
// 6 workers, with 12G RAM each -> 72G total and 8G for the driver -> 80G RAM in total
// the machine has 6 physical CPUs
// the jar contains just AnormCypher.org + Dependencies
neo@neo:/tmp/spark$ bin/spark-shell --jars ../neo4j/target/scala-2.10/Neo4j-Spark-Demo-assembly-1.0.jar --driver-memory 8G --executor-memory 12G --master local[6]
Welcome to
____ __
/ __/__ ___ _____/ /__
_\ \/ _ \/ _ `/ __/ '_/