Skip to content

Instantly share code, notes, and snippets.

Avatar

Olivier Wulveryck owulveryck

View GitHub Profile
@owulveryck
owulveryck / AAA sample.md
Last active Sep 13, 2022
Trivial server that validates data and send it to kafka
View AAA sample.md

Running the sample:

go run . definition.cue

Getting the OpenAPI

❯ curl http://localhost:8181/openapi returns:

{
@owulveryck
owulveryck / iris.csv
Last active Aug 8, 2022
Linear regression on iris dataset with Gorgonia and gota
View iris.csv
sepal_length sepal_width petal_length petal_width species
5.1 3.5 1.4 0.2 setosa
4.9 3.0 1.4 0.2 setosa
4.7 3.2 1.3 0.2 setosa
4.6 3.1 1.5 0.2 setosa
5.0 3.6 1.4 0.2 setosa
5.4 3.9 1.7 0.4 setosa
4.6 3.4 1.4 0.3 setosa
5.0 3.4 1.5 0.2 setosa
4.4 2.9 1.4 0.2 setosa
@owulveryck
owulveryck / sally.ly
Last active Aug 7, 2022
Sally - Vasco Rossi - Piano || Lilypond source
View sally.ly
\version "2.22.2"
\header {
title = "Sally"
composer = "Vasco Rossi"
}
harmonies = \chordmode {
d2 d:maj7 |
d1:7 |
@owulveryck
owulveryck / app.js
Last active Jun 17, 2022
WebSocket simple example / server in go, client in JS
View app.js
window.addEventListener("load", function(evt) {
var output = document.getElementById("output");
var input = document.getElementById("input");
var ws;
var print = function(message) {
var d = document.createElement("div");
d.innerHTML = message;
output.appendChild(d);
View compute-weeks-left.go
package cmd
import (
"encoding/json"
"errors"
"fmt"
"net/http"
)
type TimeTraveler struct {
@owulveryck
owulveryck / AAaa note.md
Last active Mar 19, 2022
havre / a docker like that runs an embedded squashfs image
View AAaa note.md

About

This is a proof of concept of a portable operating system a-la-docker.

It is a single binary that contains an image of an OS in SquashFS and the binary to run it.

a make will build the binary with an embedded alpine image. make havre-xenial will build a binary with an embedded ubuntu image.

What does the binary do?

@owulveryck
owulveryck / AAA README.md
Last active Feb 13, 2022
Generateur de QR Code tous anti covid
View AAA README.md

go run . > output.png

@owulveryck
owulveryck / AAA README.md
Last active Jan 3, 2022
app.yaml environment variables substitution
View AAA README.md

This is a code snippet that reads an "app.yaml" file on stdin; then it:

  • seek for env_variables entry in the file
  • for each key: value pair, it looks for an environment variables named value
  • if it exists, it substitute the value with value found in the environment.

Exemple:

cat app.yaml

@owulveryck
owulveryck / README.md
Last active Aug 1, 2021
Simple linear regression with plot in go with gonum
View README.md

Very simple linear regression

curl -s //www.lauradhamilton.com/data_files/cricket_chirps_versus_temperature.txt | go run main.go > output.svg
2018/06/13 19:57:59 3.3057614388773593*x+24.966014428303183
@owulveryck
owulveryck / main.go
Last active Jul 2, 2021
Simple script to turn a webpage into an epub
View main.go
package main
import (
"log"
"net/http"
"net/url"
"os"
"path/filepath"
"strings"