Skip to content

Instantly share code, notes, and snippets.

View owulveryck's full-sized avatar

Olivier Wulveryck owulveryck

View GitHub Profile
@owulveryck
owulveryck / figure1.go
Last active November 30, 2022 06:54
Article Wardley sources
// Stages of evolution
package main
import (
"image/color"
"log"
"math"
"os"
"golang.org/x/image/font/opentype"
@owulveryck
owulveryck / app.js
Last active November 24, 2022 22:08
WebSocket simple example / server in go, client in 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);
@owulveryck
owulveryck / sample.go
Last active October 17, 2022 19:07
Simple webservice to validate data with CUE
package sample
import (
"bytes"
"fmt"
"io"
"io/ioutil"
"net/http"
"net/http/httptest"
"testing"
@owulveryck
owulveryck / AAAREADME.md
Last active October 12, 2022 14:01
Wardley Map with Graphviz

Generate the map

gvpack -u board.gv map.gv annotations.gv | neato -n -Tsvg > map.svg

Generate the gvmap

echo "digraph {$( cat board.gv annotations.gv <(gvmap -e map.gv) | egrep -v "digraph|^}$")}" | neato -n -Tsvg > withgvmap.svg

@owulveryck
owulveryck / AAA sample.md
Last active September 13, 2022 19:34
Trivial server that validates data and send it to kafka

Running the sample:

go run . definition.cue

Getting the OpenAPI

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

{
@owulveryck
owulveryck / iris.csv
Last active August 8, 2022 02:30
Linear regression on iris dataset with Gorgonia and gota
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 August 7, 2022 07:51
Sally - Vasco Rossi - Piano || Lilypond source
\version "2.22.2"
\header {
title = "Sally"
composer = "Vasco Rossi"
}
harmonies = \chordmode {
d2 d:maj7 |
d1:7 |
package cmd
import (
"encoding/json"
"errors"
"fmt"
"net/http"
)
type TimeTraveler struct {
@owulveryck
owulveryck / AAA README.md
Last active February 13, 2022 08:42
Generateur de QR Code tous anti covid

go run . > output.png

@owulveryck
owulveryck / AAA README.md
Last active January 3, 2022 16:44
app.yaml environment variables substitution

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