Skip to content

Instantly share code, notes, and snippets.

View JKrag's full-sized avatar

Jan Krag JKrag

  • Eficode
  • Copenhagen
  • 15:43 (UTC +01:00)
  • LinkedIn in/jankrag
View GitHub Profile
@technige
technige / zen_of_cypher.md
Last active April 1, 2020 09:57
The Zen of Cypher

The Zen of Cypher

  • Write functions() in lower case, KEYWORDS in upper.
  • START each keyword clause
    ON a new line.
  • Use either camelCase or snake_case for node identifiers but be consistent.
  • Relationship type names should use UPPER_CASE_AND_UNDERSCORES.
  • Label names should use CamelCaseWithInitialCaps.
  • MATCH (clauses)-->(should)-->(always)-->(use)-->(parentheses)-->(around)-->(nodes)
  • Backticks `cân éscape odd-ch@racter$ & keyw0rd$` but should be a code smell.
@JKrag
JKrag / CatPedigrees.adoc
Last active August 29, 2015 13:55
Working on a GraphGist for Neo4J

Exploring cat pedigrees in Neo4J

This is a Neo4J GraphGist where I discover how to model pedigrees in Neo, and various Cypher queries to explore the data.

The data used is from a public available online pedigree of cats. I have stripped of all the names and registration data for simplicity. From a large dataset, I have extracted all the cats belonging to the very small breeds, giving a total of about 600 cats instead of 200K.

The following picture shows a sketch of my general data-model. The arrows between cats could also have been illustrated as "recursive" arrows back to the same cat node-type, but I think that this visualisation better describes the DAG (Directed Acyclical Graph) property of a pedigree/family tree.

@jexp
jexp / neo.sh
Last active May 18, 2016 17:44
#!/bin/bash
# usage neo.sh [-h host:port] [-u user:pass] [cmd]
# end cypher statements with semicolon
# terminate read loop with ^d or return
HOST="localhost:7474"
if [ "$1" == "-h" ]; then
shift; HOST="$1";shift;
fi
AUTH=""
@agnoster
agnoster / README.md
Last active September 25, 2024 09:27
My ZSH Theme

agnoster.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

For Mac users, I highly recommend iTerm 2 + Solarized Dark