Skip to content

Instantly share code, notes, and snippets.

View dennisverspuij's full-sized avatar

Dennis Verspuij dennisverspuij

  • SpuyMore Web/Applications
  • Netherlands
View GitHub Profile
@dennisverspuij
dennisverspuij / nvm.sh
Created September 14, 2018 09:10
Bash profile script for seamless installation, loading and execution of nvm (Node Version Manager) at once. Supports custom NVM_DIR, --no-use, nvm unload, etcetera. Install as /etc/profile.d/nvm.sh to make available globally on your Unix system.
function _nvm {
local DO_RUN=yes
unalias nvm
if [ "`type -t nvm`" != "function" ] ; then
NVM_DIR="${NVM_DIR:-${ORIG_NVM_DIR:-$HOME/.nvm}}"
ORIG_NVM_DIR="$NVM_DIR"
if [ ! -d "$NVM_DIR" ] ; then
mkdir "$NVM_DIR"
TMPPROFILE="${NVM_DIR}.tmp"
touch "$TMPPROFILE"
@dennisverspuij
dennisverspuij / neo4j_explore.py
Last active September 14, 2018 09:11
Python 2/3 utility for interactively unraveling structure from a Neo4j graph database.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Python 2/3 utility for interactively unraveling structure from a Neo4j graph database.
First adjust the DRIVER statement for the database you wish to explore. Then run python neoexplore.py.
The script will first scan the database for unique combinations of labels, and offer you queries to explore these.
E.g. >0 (A, B)*123 presents a query for exploring 123 nodes with both labels A and B by typing >0.
First the possible properties are listed, e.g. .[someprop]*67 means 67 out of 123 nodes have property someprop.
The square brackets emphasize the property does not always exist.
Second possible outgoing relations are listed, e.g. <>5 >10* [somereltype]*50 (C, D)*20 means 10 out of the 123