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 / bsky_jazco_import.cypher
Last active May 8, 2023 09:30
BlueSky User Interactions Neo4j Import, data collection courtesy https://bsky.jazco.dev/
create constraint user_key if not exists for (u:User) require (u.key) is unique;
// add nodes
call apoc.load.json("https://bsky.jazco.dev/exported_graph_minified.json","$.nodes")
yield value as nv
call { with nv
merge (n:User {key:nv.key})
on create set n += apoc.map.clean(nv.attributes,["key"],[])
} in transactions of 10000 rows;
@wagenrace
wagenrace / load_gi50.cypher
Created April 8, 2022 06:47
Loading the GI50 of NCI60 into neo4j
// CSV file can be downloaded here:
// https://wiki.nci.nih.gov/download/attachments/147193864/GI50.zip?version=2&modificationDate=1649214698000&api=v2
LOAD CSV WITH HEADERS FROM 'file:///GI50.csv' AS row
MERGE (chem:Chemical {nsc: toInteger(row.NSC)})
MERGE (cell:CellLine {name: row.CELL_NAME})
MERGE (dis:Disease {name: row.PANEL_NAME})
WITH chem, cell, dis, row
MERGE (chem)-[:GI50 {concentration: row.AVERAGE, research: "NCI60", unit: row.CONCENTRATION_UNIT, experiment_id: row.EXPID, count: row.COUNT}]->(cell)
MERGE (cell)-[:CELL_LINE_OF]->(dis);
CREATE CONSTRAINT word_name IF NOT EXISTS ON (w:Word) ASSERT w.name IS UNIQUE;
CREATE CONSTRAINT cap_idx_char IF NOT EXISTS FOR (cap:CharAtPos) REQUIRE (cap.idx, cap.char) IS NODE KEY;
LOAD CSV FROM
"https://gist.githubusercontent.com/jexp/b1882301adb95a8015d6c29d3e24e341/raw/6fe6ac31b9ed46900451e17b5215e9088ec09a6e/wordle.csv" as row
MERGE (w:Word {name:row[0]});
:auto MATCH (w:Word)
CALL { WITH w
@jexp
jexp / 01-load.cypher
Last active July 6, 2021 09:44
Wahlomat Daten Sachsen Anhalt 2021
create index on :Partei(name);
create index on :These(name);
create constraint if not exists on (p:Partei) assert p.id is unique;
create constraint if not exists on (t:These) assert t.id is unique;
load csv with headers from
"https://gist.github.com/jexp/189e9d7a47095ff96ff522fe350f0d36/raw/fa2f356514ec981067856ad7a5f6dfb017122c8d/wom-sa-2021.csv"
as row
merge (p:Partei {id:toInteger(row.`Partei: Nr.`)}) on create set p.text = row.`Partei: Name`, p.name = row.`Partei: Kurzbezeichnung`
@jexp
jexp / giphy.py
Created June 8, 2021 22:16
Random Giphy images in Jupyter notebook to keep your audience entertained while they wait for data processing
!pip install giphy_client
import giphy_client
import random
from IPython.core.display import display, HTML
api_instance = giphy_client.DefaultApi()
api_key = '***' # from https://developers.giphy.com/dashboard/
search = 'science'
api_response = api_instance.gifs_search_get( api_key, search, limit=25)
images = [img.images.fixed_height.url for img in api_response.data]
@jexp
jexp / transcript.txt
Created April 2, 2021 20:06
Devrel twitter space hoste by Colby with Angie, Sarah, Kelsey, Emily, James
Dev Rel
Don’t sound smart
Help others feels smart
Break thinks down to simple bits
Developer empathy
Not just for senior audiences
Netlify - docs, dx-eng, eng-integrations
Employee of community. Company is a sponsor
Ambassador progr.
@IanColdwater
IanColdwater / twittermute.txt
Last active April 22, 2024 17:26
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@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 / _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)