Skip to content

Instantly share code, notes, and snippets.

@kchristidis
kchristidis / protobuf-serialization.md
Last active April 12, 2024 20:09
Notes on protocol buffers and deterministic serialization (or lack thereof)

There doesn't seem to be a good resource online describing the issues with protocol buffers and deterministic serialization (or lack thereof). This is a collection of links on the subject.

Protocol Buffers v3.0.0. release notes:

The deterministic serialization is, however, NOT canonical across languages; it is also unstable across different builds with schema changes due to unknown fields.

Maps documentation:

Wire format ordering and map iteration ordering of map values is undefined, so you cannot rely on your map items being in a particular order.

@taoyuan
taoyuan / npm-using-https-for-git.sh
Last active July 4, 2024 14:05
Force git to use https:// instead of git://
# npm using https for git
git config --global url."https://github.com/".insteadOf git@github.com:
git config --global url."https://".insteadOf git://
# npm using git for https
git config --global url."git@github.com:".insteadOf https://github.com/
git config --global url."git://".insteadOf https://
@Rican7
Rican7 / conventional-json.go
Last active November 27, 2023 07:10
Marshal JSON in Golang using common lower-snake-case object key conventions
package main
import (
"bytes"
"encoding/json"
"fmt"
"regexp"
"time"
)