Skip to content

Instantly share code, notes, and snippets.

@zhiboz
zhiboz / 1 - loadlineagedata.cql
Created April 25, 2020 22:51 — forked from rvanbruggen/1 - loadlineagedata.cql
Demonstration of how to use the Neo4j Graph Database for Data Lineage
//load nodes
LOAD CSV WITH HEADERS FROM "https://docs.google.com/spreadsheets/u/0/d/1eL3IrbzgvZzkNnQUwDCZ1mwVfA6sypZYvDHBoeq48IM/export?format=csv&id=1eL3IrbzgvZzkNnQUwDCZ1mwVfA6sypZYvDHBoeq48IM&gid=0" AS csv
CALL apoc.create.nodes([csv.Label], [{id: csv.ID, name: csv.Name}]) YIELD node
RETURN count(node);
MATCH (n)
SET n:Node;
CREATE INDEX ON :Node(id);
@zhiboz
zhiboz / 1-contacttracing-import.cql
Created April 25, 2020 22:49 — forked from rvanbruggen/1-contacttracing-import.cql
Contact tracing example #cypher #neo4j
//contact tracing data import
//full spreadsheet with synthetic data
//https://docs.google.com/spreadsheets/d/1R-XVuynPsOWcXSderLpq3DacZdk10PZ8v6FiYGTncIE/edit#gid=0
// person sheet˝
// https://docs.google.com/spreadsheets/u/0/d/1R-XVuynPsOWcXSderLpq3DacZdk10PZ8v6FiYGTncIE/export?format=csv&id=1R-XVuynPsOWcXSderLpq3DacZdk10PZ8v6FiYGTncIE&gid=0
// Person: PersonId PersonName Healthstatus ConfirmedTime
// place sheet
@zhiboz
zhiboz / importtaxonomy.cql
Created April 25, 2020 22:49 — forked from rvanbruggen/importtaxonomy.cql
Google Product Taxonomy
//Import Google Product Taxonomy
//WITH IDENTIFIERS
//downloaded from https://support.google.com/merchants/answer/1705911
create index on :Cat1(name);
create index on :Cat2(name);
create index on :Cat3(name);
create index on :Cat4(name);
create index on :Cat5(name);
create index on :Cat6(name);
@zhiboz
zhiboz / fetch_tree.adoc
Created April 17, 2020 15:00 — forked from jexp/fetch_tree.adoc
Fetch a Tree with Neo4j

Fetch a Tree with Neo4j

Today I came across a really interesting StackOverflow question:

Given a forest of trees in a Neo4j REST server, I`m trying to return a single tree given the root vertex. Being each tree quite large, I need a de-duplicated list of all vertices and edges in order to be able to reconstruct the full tree on the client side.

@zhiboz
zhiboz / README.md
Created April 16, 2020 19:54
Automatic delivery time finder for Costco Instacart

Costco.js - An automatic Costco delivery time finder

Usage

  1. Install Tampermonkey
  2. Install the script from GreasyFork: Link
  3. Shop!

Notes

  1. The script refreshes every 5 minutes.
  2. Try checking the console if the script doesn't seem to be running.
  3. The script will log "Loading..." and "Running..." if properly working.
@zhiboz
zhiboz / README.md
Created April 16, 2020 19:54
Automatic delivery time finder for Costco Instacart

Costco.js - An automatic Costco delivery time finder

Usage

  1. Install Tampermonkey
  2. Install the script from GreasyFork: Link
  3. Shop!

Notes

  1. The script refreshes every 5 minutes.
  2. Try checking the console if the script doesn't seem to be running.
  3. The script will log "Loading..." and "Running..." if properly working.
@zhiboz
zhiboz / Makefile
Created March 17, 2020 01:00
JSON to BSON conversion in C
all: json2bson
clean:
rm -f json2bson
json2bson: json2bson.c
${CC} $(shell pkg-config --cflags json libmongo-client glib-2.0) -Wall -O0 -ggdb3 -std=c99 ${CFLAGS} \
$(shell pkg-config --libs json libmongo-client glib-2.0) -o $@ $^
check: all
./json2bson <test.json >test.bson
@zhiboz
zhiboz / inputrc
Created February 28, 2019 00:03 — forked from snipe/inputrc
~/.inputrc for nice bash history up-arrows. This allows you to search through your history using the up and down arrows … i.e. type "cd /" and press the up arrow and you'll search through everything in your history that starts with "cd /". Create ~/.inputrc and fill it with this:
"\e[A": history-search-backward
"\e[B": history-search-forward
set show-all-if-ambiguous on
set completion-ignore-case on

Keybase proof

I hereby claim:

  • I am zhiboz on github.
  • I am zhiboz (https://keybase.io/zhiboz) on keybase.
  • I have a public key ASBWlDFjzlEHuko04YOZT2uF3aKU9v7cjlGXyNnKIeK7gQo

To claim this, I am signing this object: