Skip to content

Instantly share code, notes, and snippets.

@evanj
evanj / com_github_datadog_zstd.patch
Created August 9, 2023 12:44
Bazel rules_go bug workaround for github.com/DataDog/zstd
diff -u orig/BUILD.bazel new/BUILD.bazel
--- orig/BUILD.bazel 2023-08-09 08:39:50
+++ new/BUILD.bazel 2023-08-09 08:42:02
@@ -1,102 +1,26 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+load("@rules_cc//cc:defs.bzl", "cc_library")
+cc_library(
+ name = "zstd_cc",
+ srcs = glob([
@evanj
evanj / celo-stake-off.md
Last active December 8, 2019 19:48
Celo stake off gist

CELO_VALIDATOR_GROUP_ADDRESS=4d838eaefe4234307e66f8d3f3019bc305b0d1b5 CELO_VALIDATOR_ADDRESS=e556d76384334a7138ca85e5eb4281c909628ae1

@evanj
evanj / transformer.go
Created February 25, 2019 22:45
Blog post transformer.go
type Transformer interface {
Transform(output []byte, input []byte) (written int, read int, err error)
}
@evanj
evanj / reader.go
Created February 25, 2019 22:42
Blog post reader.go
type Reader interface {
Read(p []byte) (n int, err error)
}
@evanj
evanj / writer.go
Last active February 25, 2019 22:41
Blog post writer.go
type Writer interface {
Write(p []byte) (n int, err error)
}
@evanj
evanj / crc32c.go
Created August 6, 2018 15:43
Prints crc32c hashes in the same format as Google Cloud storage
// Prints CRC32C hashes in the same format as Google Cloud Storage
//
// Usage: crc32c (paths to hash)
// See also: gsutil hash
package main
import (
"encoding/base64"
"encoding/hex"
"fmt"
@evanj
evanj / Dockerfile
Last active May 6, 2020 06:06
connectbug: Make lots of outbound connections to cause DNS errors in Kubernetes. See https://github.com/kubernetes/kubernetes/issues/45976
FROM python:2.7.13-slim
COPY . /app/
WORKDIR /app
ENTRYPOINT ["python", "connectbug.py"]
@evanj
evanj / google_oauth.go
Created November 28, 2016 17:05
Go Google Oauth2 example using the tokeninfo endpoint
package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
"golang.org/x/oauth2"

Keybase proof

I hereby claim:

  • I am evanj on github.
  • I am epcjones (https://keybase.io/epcjones) on keybase.
  • I have a public key whose fingerprint is 3877 9685 9042 684D 83E4 C875 C252 E16D 2E4B 9E55

To claim this, I am signing this object: