Skip to content

Instantly share code, notes, and snippets.

View warpfork's full-sized avatar

Eric Myhre warpfork

View GitHub Profile
@pvh
pvh / week-1.md
Last active June 24, 2020 23:05
Cambria, Week 1

Cambria, Week 1

Welcome, one and all to the Cambria project. Cambria is an ongoing research project here at Ink & Switch exploring how we can operate on evolving data formats in a decentralized system. We hope this work will be exciting not just for folks working on decentralized systems but could also be applicable more broadly to other distributed systems.

What's the problem?

Cambria was motivated by some problems we kept seeing in our work. The most common problem was that someone would add an array field to a document. New documents would work fine (the array would be added at document creation time) but existing documents, or documents shared by older clients, would cause Javascript runtime errors when the code would try to call Array methods on the object.

This is a very common problem in all kinds of distributed systems, and in a centralised system is mostly managed by locking down how the system works. Database schemas prevent writing

@frrist
frrist / Larger
Last active December 10, 2018 16:58
Made using http://picascii.com/
@warpfork
warpfork / README.md
Last active October 28, 2018 12:04
kyss spec

the "Keep Your Serialization Simple" format

Kyss -- "Keep Your Serialization Simple" is a serialization format designed for simplicity, unambiguity, and a pleasant experience for human reading and writing.

Kyss was designed with these criteria in mind:

  • Maps, arrays, strings, ints: all the basics should be unsurprising.
@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.

@warpfork
warpfork / sshfs
Created January 30, 2015 03:38
sshfs
#!/bin/bash
mkdir -p "${locPath}" && \
trap '( fusermount -u "${locPath}" && rmdir "${locPath}" ) 2>/dev/null ; exit $?' INT TERM EXIT && \
(
declare -a opts
opts=();
opts+=("-o sshfs_sync"); # synchronous writes
opts+=("-o no_readahead"); # synchronous reads
opts+=("-o reconnect"); # try harder
@tlrobinson
tlrobinson / docker-pull.sh
Last active October 18, 2023 21:59
Quick and dirty "docker pull"-like shell script.
#!/usr/bin/env bash
set -eu
name="library/redis"
tag="latest"
registry="https://registry-1.docker.io"
blobs="blobs"
data="images/$name/$tag"
@warpfork
warpfork / chans_test.go
Last active August 29, 2015 14:13
"generic" channels & benchmark
package what
import (
"encoding/json"
"reflect"
"testing"
)
type testStruct struct {
A string

Give me back my sanity

One of the many things I do for my group at work is to take care of automating as many things as possible. It usually brings me a lot of satisfaction, mostly because I get a kick out of making people's lives easier.

But sometimes, maybe too often, I end up in drawn-out struggles with machines and programs. And sometimes, these struggles bring me to the edge of despair, so much so that I regularly consider living on a computer-less island growing vegetables for a living.

This is the story of how I had to install Pandoc in a CentOS 6 Docker container. But more generally, this is the story of how I think computing is inherently broken, how programmers (myself included) tend to think that their way is the way, how we're ultimately replicating what most of us think is wrong with society, building upon layers and layers of (best-case scenario) obscure and/or weak foundations.

*I would like to extend my gratitude to Google, StackOverflow, GitHub issues but mostly, the people who make the

@aphyr
aphyr / gist:5198654
Created March 19, 2013 18:17
Thoughts on configuration file complexity.

Some people think that configuration should not be "Turing complete"; others think the configuration language should be as expressive as possible--so much so that it amounts to a programming language itself.

I assert that configuration files which are not Turing complete (or, perhaps a more useful distinction, are not "sufficiently complex languages") are in practice extended to be that complex; and when that happens, the result is often more difficult to understand than if the language were more powerful to start with.

@garybernhardt
garybernhardt / gist:3180009
Created July 26, 2012 03:05
An excerpt from GCC's reload.c
static int
find_reusable_reload (rtx *p_in, rtx out, enum reg_class rclass,
enum reload_type type, int opnum, int dont_share)
{
rtx in = *p_in;
int i;
/* We can't merge two reloads if the output of either one is
earlyclobbered. */
if (earlyclobber_operand_p (out))