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 / slides-llm-embeddings-extraction.cypher
Created September 1, 2023 08:43
Neo4j Cypher Script to import slideshare data, create embeddings, a vector index, similarity search and extract authors and keywords
// gcloud projects list
:param projectId => 'xxxx'
// gcloud auth print-access-token
:param apiKey => 'xxx'
call apoc.load.json("https://data.neo4j.com/slideshare-neo4j.json") yield value
unwind value.User.Slideshow as slide
return slide limit 5;
@jexp
jexp / graph_gist_template.adoc
Last active February 22, 2024 17:29 — forked from cheerfulstoic/graph_gist_template.adoc
CHANGEME: GraphGist Template. Fork to make your own, view source to see instruction comments

REPLACEME: TITLE OF YOUR GRAPHGIST

Introduction

@jexp
jexp / stackoverflow.md
Last active February 11, 2024 13:31
DuckDB StackOverflow Queries, DuckDB in Action Book: https://manning.com/books/duckdb-in-action – 40% discount: mlneedham 100% for reviewers
@jexp
jexp / playlist.py
Last active October 14, 2023 23:04
Read correct YouTube Playlist views from the YT data API with Python (here Neo4j Twitch Stream videos)
# -*- coding: utf-8 -*-
# https://developers.google.com/explorer-help/guides/code_samples#python
# pip install --upgrade google-api-python-client google-auth-httplib2 google-auth-oauthlib
# python playlist.py
import os
import sys
import json
@jexp
jexp / gist:09df199130a47493b5fbac0251b6159e
Created August 4, 2023 09:46
Python script to download slideshares for a User
# docs https://www.slideshare.net/developers/documentation
# pip install xmltodict requests
import requests
import time
from hashlib import sha1
import os
import json
import xmltodict
@jexp
jexp / restaurant_recommendation.adoc
Last active July 11, 2023 21:51
Restaurant Recommendation GraphGist

Restaurant Recommendations

We want to demonstrate how easy it is to model a domain as a graph and answer questions in almost natural language.

Graph Based Search and Discovery is prominent a use-case for graph databases like Neo4j.

@jexp
jexp / BitMapOpsComparision.java
Last active July 9, 2023 08:34
RoaringBitMap Benchmark with jbang based on https://xam.dk/blog/jbang-reproducers/
//JAVA 20
//DEPS org.roaringbitmap:RoaringBitmap:0.9.45
//DEPS org.openjdk.jmh:jmh-generator-annprocess:1.36
package de.jexp.rbm;
import org.openjdk.jmh.annotations.*;
import org.roaringbitmap.RoaringBitmap;
import java.util.BitSet;
@jexp
jexp / fetch_tree.adoc
Created June 19, 2015 22:09
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.

@jexp
jexp / nicknames.txt
Created June 26, 2023 13:28
Nicknames - Main name and comma separated list of nicknames after
adam: addy, ade, adie, ad, adi, ady, atim
alexander: alex, alec, xander, lex, sandy, zander, ander, al, axel
amanda: mandy, manda, am, amy, mandi, mands, mendi
andrew: andy, drew, andre, and, drea, dre, andie, andi, andrews
angela: angie, angel, ang, anj, ange, angely, angelica, angelina, angelique
anna: ann, anne, annie, an, ania, anka, anushka, anoushka, anouska
anthony: tony, anth, ant, ton, anthoine, anton, antwan, antonin, antonius
ashley: ash, lee, ashie, ashy, ashleigh, ashlee, ashl, ashli, ashlin
aubrey: aub, bree, brey, brie, aubs, aubry, aubrie, aubri, auberon
augustus: august, gus, gustus, agus, agustus, augie, auggie, augy, gusy