Skip to content

Instantly share code, notes, and snippets.

View bobvanluijt's full-sized avatar

Bob van Luijt bobvanluijt

View GitHub Profile
@bobvanluijt
bobvanluijt / setup-docker-with-GPU-support.sh
Last active June 8, 2023 10:54
Setup Docker with GPU support on Ubuntu
# STEP 1
$ sudo apt update && \
sudo apt -qq -y install \
gcc \
make \
software-properties-common \
apt-transport-https \
ca-certificates \
curl \
git \
[
"Product A",
"Product B",
"Product C",
"Product D"
]
{
"Paragraph": [
{
"inDocument": [
{
"number": "NEN-EN 15774 en",
"title": "Food processing machinery - Machines for processing fresh and filled pasta (tagliatelle, cannelloni, ravioli, tortellini, orecchiette and gnocchi) - Safety and hygiene requirements"
},
{
"number": "NEN-EN 13621 en",
@bobvanluijt
bobvanluijt / first-result.json
Last active June 16, 2021 11:57
NEN - first result in JSON
{
"Paragraph": [
{
"_additional": {
"answer": {
"certainty": 0.76,
"result": "50 mm"
}
},
"inDocument": [
{
Get {
Paragraph (
ask: {
question: "what is the distance between the frame and the outside wall of the bowl?",
properties: ["text"]
},
limit:1
){
text
@bobvanluijt
bobvanluijt / NEN-1.graphql
Last active June 14, 2021 14:16
NEN - first GraphQL query
{
Get {
Paragraph (
limit: 3 # show the first three results
nearText: {
concepts: ["machines to make pasta"] # the semantic query
certainty: 0.6 # between 0.0 and 1.0, the higher the certainty the more the document should match the query
}){
inDocument {
... on Document {
@bobvanluijt
bobvanluijt / NEN-data.json
Last active June 14, 2021 14:34
NEN – example data
[
{
"class": "Document",
"properties": [
{
"name": "title",
"dataType": [
"string"
]
},
@bobvanluijt
bobvanluijt / show-publication-vectors.graphql
Created April 20, 2021 14:20
Show Publication vectors in GraphQL for Weaviate's News Article demo dataset
{
Get {
Publication {
name
_additional {
vector
}
}
}
}
@bobvanluijt
bobvanluijt / microtonal.js
Created June 7, 2020 18:52
Microtonal JS
// https://pages.mtu.edu/~suits/notefreqs.html
// https://pages.mtu.edu/~suits/NoteFreqCalcs.html
// create web audio api context
var audioCtx = new(window.AudioContext || window.webkitAudioContext)();
// microtonal division
var microtonalDiv = 24;
var c4 = 261.6256;
@bobvanluijt
bobvanluijt / Weaviate-vector.ho
Created May 8, 2020 14:36
Example of Weaviate vector generator
// takes an array of vectors and outputs a single mean vector
function meanVector(inputVectors) {
// sum up each dimension in a single “sum” vector
sums = new Array(dimensions(inputVectors))
for i = 0; i < dimensions(inputVectors); i ++ {
for j = 0; j < inputVectors.length(); j ++ {
sums[i] += inputVectors[j][i]
}
}