Skip to content

Instantly share code, notes, and snippets.

View bobvanluijt's full-sized avatar

Bob van Luijt bobvanluijt

View GitHub Profile
@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 / 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 / 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 / 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 / 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 / dorel-io-static-server.go
Last active July 13, 2017 17:34
Idea for SPA server instead of NGINX - Dorel IO
/**
* Idea for SPA server instead of NGINX - Dorel IO
*
* You can run this locally: `$ go run dorel-io-static-server.go`
* The concept is that the Wordpress API is asked if the page exsists, if yes, it sends the correct meta data and status code.
* If you try: localhost:8080/foobar you will get a 404
* If yountry: localhost:8080/about-us (or another exsisting page) you will get a 200 with the correct metadata
*
* Bower compontents is always skipped and shown.
*
@bobvanluijt
bobvanluijt / Android Things - device step I.sh
Last active March 30, 2017 01:57
Android Things - device step I
#!/bin/sh
###
# Make sure the locale settings are in order: http://askubuntu.com/a/229512/119583
# Tested on Ubuntu 16.04 LTS
###
##
# Run from /usr/local
##
@bobvanluijt
bobvanluijt / Install hyperGAN with: Install CUDA and Tensorflow 1.0 on Ubuntu 16.04.sh
Last active October 4, 2021 11:32
Install hyperGAN with: CUDA and Tensorflow 1.0 on Ubuntu 16.04 + Python 3.5
#!/bin/bash
# Tensorflow installation bash for Ubuntu 16.04 for x86_64 - Python 2.7
# Set locale (comment when not needed)
sudo sh -c "echo 'LC_ALL=en_US.UTF-8\nLANG=en_US.UTF-8' >> /etc/environment"
# Install CUDA
sudo apt-get update -y
sudo apt-get upgrade -y
@bobvanluijt
bobvanluijt / Weave - places.json
Created February 7, 2017 12:16
Weave - places
{
"Place": {
"properties": {
"id": {
"type": "string"
},
"invitation": {
"$ref": "#/definitions/PlaceInvitation"
},
"member": {
@bobvanluijt
bobvanluijt / Weave - rooms.json
Created February 6, 2017 21:25
Weave - rooms
{
"Room": {
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"placeId": {