Skip to content

Instantly share code, notes, and snippets.

View bobvanluijt's full-sized avatar

Bob van Luijt bobvanluijt

View GitHub Profile
@bobvanluijt
bobvanluijt / Install Docker on Ubuntu.sh
Last active April 30, 2025 20:11
Install Docker on Ubuntu (and Weaviate clone)
sudo apt-get update && \
sudo apt-get -qq -y install \
apt-transport-https \
ca-certificates \
curl \
git \
jq \
software-properties-common && \
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - && \
sudo mkdir -p -m 0755 /etc/apt/keyrings && \
@bobvanluijt
bobvanluijt / keys.go
Created January 27, 2018 17:40 — forked from sdorra/keys.go
Golang RSA Key Generation
/*
* Genarate rsa keys.
*/
package main
import (
"crypto/rand"
"crypto/rsa"
"crypto/x509"
@bobvanluijt
bobvanluijt / vector-draft.go
Last active May 23, 2018 13:55
VECTOR DRAFT IN GO
package main
import (
"bufio"
"bytes"
"compress/gzip"
"errors"
"fmt"
"io/ioutil"
"log"
@bobvanluijt
bobvanluijt / csvToCbor.go
Created May 23, 2018 14:46
Creates CBOR from GloVe vector file
package main
import (
"bufio"
"bytes"
"compress/gzip"
"fmt"
"io/ioutil"
"log"
"os"
@bobvanluijt
bobvanluijt / main.go
Created June 5, 2018 19:24
Example of additional functions
// Opaque type that models an index number used to identify a word.
type ItemIndex int
func (*ItemIndex i) IsPresent() {
return i >= 0
}
// Opque type that models a fixed-length vector.
type Vector {
vector []float32
@bobvanluijt
bobvanluijt / check all checkboxes in DOM
Created August 1, 2018 20:00
check all checkboxes in DOM
var checkboxes = document.getElementsByTagName("*");
for (var i=0, max=checkboxes.length; i < max; i++) {
if (checkboxes[i].type == 'checkbox') {
checkboxes[i].checked = true;
}
}
@bobvanluijt
bobvanluijt / group.graphql
Last active October 25, 2018 04:47
Idea for grouping
###
# The result below shows the sum of population of all cities.
###
{
Local {
Get(where:{
operands: [{
path: ["Things", "City", "population"],
operator: GreaterThan
valueInt: 1000000
@bobvanluijt
bobvanluijt / emptyWeaviate.py
Created May 2, 2019 18:36
Remove all concepts from Weaviate
##
# This script removes all things and action (i.e., concepts) from a Weaviate.
#
# Make sure to set the WEAVIATE_URL
##
import requests
from datetime import datetime
WEAVIATE_URL = "localhost"
HEADERS = {'Content-type': 'application/json'}
@bobvanluijt
bobvanluijt / setup-docker.sh
Last active January 31, 2023 20:16
Setup Docker
sudo apt-get update && \
sudo apt-get -qq -y upgrade && \
sudo apt-get -qq -y install \
apt-transport-https \
ca-certificates \
curl \
jq \
software-properties-common && \
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - && \
sudo add-apt-repository \
@bobvanluijt
bobvanluijt / Operator for And and And Or operations.graphql
Created June 13, 2019 11:28
Operator for And and And Or operations
{
Local{
Get{
Things{
Place(where:{
operator:And
operands:[
{
operator:Equal
path:["rating"]