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 / 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 / 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 / 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 / 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 / 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
# english output for tools
export JAVA_TOOL_OPTIONS=-Duser.language=en
# sdkman
sdk list
sdk list java
#sdk install java 20-open
sdk use java 20-open
java -version
@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;
// sdk install java 20-open
// java -version
/*
openjdk version "20" 2023-03-21
OpenJDK Runtime Environment (build 20+36-2344)
OpenJDK 64-Bit Server VM (build 20+36-2344, mixed mode, sharing)
*/
// jshell --enable-preview --add-exports java.base/jdk.internal.vm=ALL-UNNAMED --add-modules=jdk.incubator.concurrent
This file has been truncated, but you can view the full file.
{
"laureates": [
{
"id": "745",
"knownName": {
"en": "A. Michael Spence",
"se": "A. Michael Spence"
},
"givenName": {
"en": "A. Michael",
@jexp
jexp / aoc_day1.cypher
Last active December 4, 2022 12:15
Advent of Code 2022 in some languages
with split($input, "\n\n") as elves
unwind elves as elf
return reduce(s=0, c in split(elf,"\n") | s + toInteger(c)) as total
order by total desc limit 1;
with split($input, "\n\n") as elves
unwind elves as elf
with reduce(s=0, c in split(elf,"\n") | s + toInteger(c)) as total
order by total desc limit 3