Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am jadeallenx on github.
  • I am jadeallenx (https://keybase.io/jadeallenx) on keybase.
  • I have a public key ASCzYgteA70jTBW7BkqBoqpn-Le6zVZCKrCki8nSsaL9MAo

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am jadeallenx on github.
  • I am mrallen1 (https://keybase.io/mrallen1) on keybase.
  • I have a public key ASCa8v4tZDbyfDBVFnCHukL_19ck6mPJ4o7eiAIxfymcyAo

To claim this, I am signing this object:

@jadeallenx
jadeallenx / thai_tofu.md
Last active April 27, 2021 00:59
thai peanut crispy fried tofu on zoodles

Thai peanut sauce crispy tofu over zucchini noodles

  • 1 pkg extra firm tofu
  • 1 T olive oil
  • 1/4 c peanut butter
  • 2 T tamari
  • 1 1/2 T rice wine vinegar
  • 1 t minced garlic
  • 1 t minced ginger
@jadeallenx
jadeallenx / ss.erl
Created August 21, 2019 21:58
Self Stabilizing Systems in Spite of Distributed Control
%% @doc
%% This Erlang module implements the ideas illustrated in Edsger Dijkstra's
%% famous paper "Self Stabilizing Systems in Spite of Distributed Control"
%% http://courses.csail.mit.edu/6.852/05/papers/p643-Dijkstra.pdf
%% @end
-module(ss).
-export([stop/1, show/1, start/1]).
-define(DELAY, 1000).
-define(THRESHOLD, 0.90).
@jadeallenx
jadeallenx / pro.pl
Created August 1, 2018 05:35
Russian personal pronouns
#!/usr/bin/env perl
use 5.014;
use utf8;
use Text::CSV qw(csv);
use List::Util qw(shuffle pairs);
use List::MoreUtils qw(zip);
my $pn = {
@jadeallenx
jadeallenx / refs.md
Last active January 4, 2018 21:21
Using references in jesse for JSON schema validation

If you use the [jesse][1] application for JSON schema validation, you will no doubt be mystified by the byzantine way that references are handled in the application. I spent well over 30 hours trying to figure it out, since it is totally undocumented what the format should be.

I tried to make things as simple as possible. I had a file with the "base" schema for an item. I called it record.json It looked something like this:

{
   "id": "record",
   "description": "Base schema for a valid record",
   "type": "object",
 
@jadeallenx
jadeallenx / surface2.md
Created December 12, 2017 05:54
Developing on SurfaceBook 2

I recently made the switch back to Windows 10 after spending 15 years using a Mac as my personal laptop. I won't go into all of the rationale behind that decision but the most succinct answer is that I have felt like Apple's doing me a favor by buying their products, not the other way around for the past three releases of macOS. As a rather committed vi partisan, removing the ESC key from the high end Mac Book Pros was kind of the final straw.

In any case, I bought my Surface Book 2 about two weeks ago. This past weekend, I took part in [Spawnfest][1], a 48 hour programming contest aimed at Erlang/Elixir. I wrote all of the code on the Surface Book 2 and I know some people are interested in my experience.

So keeping with the usual trite cliches, I'll use the "Good", "Bad" and "Ugly."

Good

  • Windows Subsystem for Linux was flawless during my work. I used it exclusively to develop code. Git and Erlang and every other tool I needed Just Worked, and worked well.
@jadeallenx
jadeallenx / rebar3_hex_v2_resources.erl
Last active March 17, 2018 19:40
Using hex v2 resources in Erlang
%% A strawman implementation to kick around
-module(rebar3_hex_v2_resources).
-export([
start/0,
decode_resource_from_disk/2,
download_resource/1
]).
%% needs application:ensure_all_started(public_key).
@jadeallenx
jadeallenx / expedition.md
Last active August 21, 2017 03:42
Playing Expedition RPG card game with my kids

Playing Expedition RPG card game with my kids

I spent a few hours playing [Expedition RPG card game][1] with my kids today and I wanted to write up something longer than a tweet to share our experience. If you haven't heard of Expedition, it's along the lines of a more-or-less standard "fantasy" world with fantastic creatures and hardy adventurers, but without so many rules in in it. The mechanics for combat are very lightweight -- more like a LARP type system, but even more streamlined. The pretty cool "twist" to this is the use of a phone app (the app is available for both iOS and Android) to help mediate some of the storytelling and combat.

Players each get an adventurer card which lays out a very barebones personality ("hungry chef", "dutiful soldier", "fretful bard", etc) and six abilities in Magic, Music, Melee or Ranged. Each adventurer has 12 health points. These abilites are part of four decks of cards which are shuffled and dealt out. Depending on t

@jadeallenx
jadeallenx / ringbuffer.erl
Last active August 2, 2017 00:58
ringbuffer interface using a normal Erlang list
-module(ringbuffer).
-ifdef(TEST).
-include_lib("eunit/include/eunit.hrl").
-compile([export_all]).
-else.
-export([
new/0,
new/1,
get_head/1,