Skip to content

Instantly share code, notes, and snippets.

View cyriltovena's full-sized avatar
🔥

Cyril Tovena cyriltovena

🔥
View GitHub Profile
@bradwilson
bradwilson / Cacheability.cs
Created January 23, 2014 20:53
Using chaining to create cached results in ASP.NET Web API v2
public enum Cacheability
{
NoCache,
Private,
Public,
}
@staltz
staltz / introrx.md
Last active November 17, 2024 01:08
The introduction to Reactive Programming you've been missing
package main
import (
"net/http"
"database/sql"
"fmt"
"log"
"os"
)
.
├── books
│   ├── handlers.go
│   └── models.go
├── config
│   └── db.go
└── main.go
@posener
posener / go-table-driven-tests-parallel.md
Last active October 29, 2024 13:01
Be Careful with Table Driven Tests and t.Parallel()

Be Careful with Table Driven Tests and t.Parallel()

We Gophers, love table-driven-tests, it makes our unittesting structured, and makes it easy to add different test cases with ease.

Let’s create our table driven test, for convenience, I chose to use t.Log as the test function. Notice that we don't have any assertion in this test, it is not needed to for the demonstration.

func TestTLog(t *testing.T) {
	t.Parallel()
@cyriltovena
cyriltovena / demo.md
Created April 21, 2020 19:48
Loki Webinar Demo

First deploy the demo app.

kubectl apply -f tns.yaml

Make sure tiller is installed in your cluster.

Add our chart repository

helm repo add loki https://grafana.github.io/loki/charts

@bboreham
bboreham / tree.go
Created January 4, 2023 11:01
Tournament Tree aka Loser Tree, in Go
// Loser tree, from https://en.wikipedia.org/wiki/K-way_merge_algorithm#Tournament_Tree
package loser
import (
"math"
)
// Ideally Ordered would be any int, float, etc., bit we need to have a maxVal too, so kludge it.
type Ordered interface{ ~uint64 }