Skip to content

Instantly share code, notes, and snippets.

package main
import (
"bytes"
"fmt"
"regexp"
"strings"
"testing"
)
@mem
mem / tools.yaml
Created November 25, 2022 22:38
my tools.yaml file
tools:
entgo.io/ent/cmd/ent:
github.com/766b/godox:
github.com/akavel/up:
github.com/caddyserver/caddy/v2/cmd/caddy:
github.com/cli/cli:
clone: true
build:
- make bin/gh
- cp bin/gh ${OUTDIR}
@mem
mem / gist:83f6c9bb82cf7ea2eeea5668d596068f
Created September 27, 2023 00:44
how to use go:linkname
package main
import (
"fmt"
_ "unsafe"
_ "github.com/prometheus/prometheus/model/textparse"
dto "github.com/prometheus/prometheus/prompb/io/prometheus/client"
)
@mem
mem / get-proto-metrics
Created October 24, 2023 00:17
How to get a Prometheus endpoint to serve Probobuf instead of the text exposition format
curl \
--include \
-H 'Accept: application/vnd.google.protobuf; proto=io.prometheus.client.MetricFamily; encoding=compact-text' \
$@