Skip to content

Instantly share code, notes, and snippets.

Maël Valais maelvls

Block or report user

Report or block maelvls

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile


  0x109959d		488d059c1a0500		LEAQ go.itab.*main.concrete,main.abstract(SB), AX
  0x10995a4		8400			TESTB AL, 0(AX)
  0x10995a6		488d05eba40f00		LEAQ runtime.zerobase(SB), AX
  0x10995ad		48890424		MOVQ AX, 0(SP)
  0x10995b1		e81a000000		CALL main.(*concrete).f(SB)
maelvls / gracefully_shutdown.go
Last active Sep 23, 2019
Graceful shutdown with Context + channels (
View gracefully_shutdown.go
// The point of this snippet is to showcase how to handle gracefully any incoming
// SIGINT (manual ctrl-c) or SIGTERM (process is killed) for a long-running task
// such as a server.
package main
import (
maelvls /
Last active Sep 8, 2019
Creating a gcloud project and service account for Rob Pike's upspin
gcloud projects create upspin42
gcloud iam service-accounts create --project  upspin-service-account
gcloud iam service-accounts create --project upspin42 upspin-service-account
gcloud projects add-iam-policy-binding upspin42 --role=roles/owner
gcloud iam service-accounts keys create json_key.json --iam-account --project upspin42
gcloud alpha billing projects link --billing-account $(gcloud alpha billing accounts list --format json | jq -r '.[0].name') upspin42

gcloud dns record-sets transaction start --zone maelvls
gcloud dns record-sets transaction add --project august-period-234610 --zone=maelvls --type=A --ttl 300 --name

How to work with the authorization.go middleware

I wanted to make sure no one gets slowed down in their PRs because of the introduction of authorization.go. It has been added to all the services and all HTTP endpoints are affected. Here is how to get around that.

The current impl of authorization.go is algorithm-agnostic regarding the verification. The gateway or sidecar proxy (Envoy/Istio) will handle the verification.

maelvls / openapi.yml
Last active Jul 29, 2019
OpenAPI example with discriminator (union types or 'inheritance')
View openapi.yml
openapi: 3.0.2
title: Dogs and cats
description: some dogs and some cats
version: 1.0.0

Software (I run macOS):

  • USB overdrive (the default macOS mouse acceleration drives me crazy; also allows me to invert up/down scolling for the mouse only; I keep "natural scrolling" turned on in the system settings)
  • HyperSwitch for switching between windows with alt+tab (cmd+tab only allows to switch between apps)
  • iTerm 2 + zsh + antigen + async prompt theme (agkozak-zsh-prompt) + tons of stuff around command line

Desk setup:

maelvls /
Last active Jul 4, 2019
Resources I gathered about remote work things
  • 📖 Remote: Office Not Required (2003, by 37signals/Basecamp): amazon
  • 📺🇫🇷 Aussi efficace à la maison qu'au bureau (Jean-Laurent de Morlhon): youtube
  • 🎙Remote Work Podcast (by apple podcast
maelvls /
Created Jun 17, 2019
Prettier but for Java
maelvls /
Last active Jun 15, 2019
About me -- looking for startup opportunities
  • I speak and write English fluently (learnt a lot during my PhD). Come try my delicious and refreshing french-flavoured accent! 😄
  • I enjoy contributing to open-source projects; when I do, it is mostly a way of scratching a developer itch on one of my tools. I sent pull requests to [ocaml-minisat][], [ocaml-qbf][], [ocamlyices2][] and [opam][] (OCaml), [gitlab-ce][] (Ruby on rails, Rspec), [boost-graph][] (C++).
  • I authored and am the maintainer of various projects: [homebrew-amc][] (Ruby, Travis CI), [touist][] (OCaml) and four [vscode-extensions][] (they use Typescript; one of them has 29k download! 😊).

I don't use Hyper anymore (too much memory, too slow to render). I fall back to Cmder. I use scoop instead of choco as my package manager on windows. I use WSL + apt and sometimes Homebrew as my package managers on the WSL/Ubuntu side. Cmder + powerline:

You can’t perform that action at this time.