Skip to content

Instantly share code, notes, and snippets.

View owulveryck's full-sized avatar

Olivier Wulveryck owulveryck

View GitHub Profile
@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 / 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 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

@owulveryck
owulveryck / main.go
Last active July 2, 2021 06:00
Simple script to turn a webpage into an epub
package main
import (
"log"
"net/http"
"net/url"
"os"
"path/filepath"
"strings"
@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 / sample_test.go
Created June 15, 2021 13:23
CUE -> OpenAPI generation
package main
import (
"bytes"
"encoding/json"
"fmt"
"log"
"cuelang.org/go/cue"
"cuelang.org/go/cue/load"
@owulveryck
owulveryck / sample_test.go
Created June 14, 2021 09:55
Simple cloudevents creation from a cue value
package main
import (
"encoding/json"
"log"
"reflect"
"testing"
"time"
"cuelang.org/go/cue"
@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 / Makefile
Last active May 26, 2021 15:47
convert all pictures from the jpg directory into webp
SOURCE_DIR := jpg
OUTPUT_DIR := webp
jpg_srcs := $(shell find $(SOURCE_DIR) -type f -name '*.jpg')
webp := $(patsubst $(SOURCE_DIR)/%.jpg, $(OUTPUT_DIR)/%.webp, $(jpg_srcs))
toWebo: $(webp)
$(OUTPUT_DIR)/%.webp : $(SOURCE_DIR)/%.jpg
magick $< -quality 50 -define webp:lossless=true $@