Skip to content

Instantly share code, notes, and snippets.

@maxtaco
maxtaco / bot-signup-flow.md
Last active Nov 11, 2021
New bot signup flow
View bot-signup-flow.md

Get a Bot Token

As your keybase user run:

$ keybase bot token create > /tmp/bot-token

You'll get back a base64 token, like: 6C37sjCBgMNf06Z6oTgixIxHJpja8G-Qp. This is your bot token that allows you to sign up bots.

@maxtaco
maxtaco / input.avdl
Last active May 25, 2017
A blurpy demo
View input.avdl
record Cat {
map<Blurp,Noozle> bird;
map<Noozle> bee;
map<Blurp,array<Noozle>> birds;
map<Blurp,int> pickles;
map<string,int> penny;
map<int,string> pa;
array<map<Blurp,array<Noozle>>> wow;
}
View variant2.avdl
@namespace("shit.1")
protocol bar {
enum Types {
NONE_0,
BOZO_1,
BIPPY_2,
AGGLE_3,
FLAGGLE_4
View variant.avdl
@namespace("foo.1")
protocol bar {
enum BoopType {
NONE_0,
BURN_1,
BILLY_2,
TILLY_3
}
View foo.go
type Wrapper struct {
fd int
}
func open(s string) *Wrapper {
return &Wrapper{ openPipe(s); }
}
func (w *Wrapper) Close() {
Close(w.fd)
@maxtaco
maxtaco / foo.avdl
Last active Oct 7, 2015
New RPC/Go interface idea.
View foo.avdl
@namespace("foo.1")
protocol bar {
A myfunc(b B, c C);
}
@maxtaco
maxtaco / p3skb.iced
Last active Sep 8, 2015
Some worked p3skb examples
View p3skb.iced
{KeyManager} = require 'kbpgp'
{make_esc} = require 'iced-error'
passphrase = "foxtrot bananas"
main = (cb) ->
esc = make_esc cb
# generate, sign and lock...
@maxtaco
maxtaco / kbRPC.coffee
Last active Sep 4, 2015
KB wrapper w/ session awareness on top of regular RPC
View kbRPC.coffee
##
## Extremely rough & hacky pseudocode, but I guarantee we can get something
## like this to work. I believe this is the interface you wanted, but
## we can easily implement it on top of the interface we have.
##
class KbClient extends Client
# construct with a KbTransport below....
@maxtaco
maxtaco / ICS_in_ES6.md
Last active Nov 16, 2016
IcedCoffeeScript ES6 Implementation
View ICS_in_ES6.md

ES6 IcedCoffeeScript Implementation

It's been a real challenge to continuously merge my IcedCoffeeScript branch with the CoffeeScript mainline. The more progress Jeremy and the team make in master, the harder a time I have in the branch. The core issue here is the the iced transform is quite deep. It's doing a CPS translation of the entire abstract syntax tree, rendering the emitted code all but unrecognizable if iced features are at play.

Whenever ES6 is ready for primetime, yield and generators can do all of this heavy lifting, meaning the ICS patch can much simpler. Here's an example that I hand-coded. The input is the first file input.iced, which does basic ICS loops and if/else control flow exercises. The hypothetical output

@maxtaco
maxtaco / p3skb.iced
Created Aug 5, 2014
How to decode and decrypt P3SKB format into Standard PGP blocks
View p3skb.iced
{unpack,pack} = require 'purepack'
{createHash} = require 'crypto'
{decrypt} = require 'triplesec'
assert = require 'assert'
{encode} = require('pgp-utils').armor
key = """hKRib2R5gqRwcml2gqRkYXRhxRgEHJTX3gAAAAOsc5gaUOoq7pdC2Co5YVQXH49bzq2YEAxmjlmGDysfrRbToJD41vpfCsWh1MC0fxV/+LopyzZqssbCuCiDOG5ZZqCHxqYZdTRZFD0WW1CQAOeiu8W7AOKSnaTaPKtrCxw01wpQqO0BXuFK+D91taE4voFQOdlQeynLut1YZvgYsW6DXln5zDECrxy2MZNYP8CqaTRVfr1WTXeloBsF+8sMx/6soVfmTSa+R66c/CZO0tLB5vfGTlfI5wWM+18umjp+0CNXVvTPOCcCmqVinoKGZoi/VqWgokK4Ku4WRRbfwlQVUi5CZFa/FEqJd2AWiUYWdP+X1In6uNG70jSO+PXaYBYBlEMuEbS8cq/3CWe4T/wP3ktYE8aZg1VKO6+jUbrAehK+EBzKe8OMFu+JOhN0XYepO9BzAs1DmHb7/23mzf/sgDyqRQQXOUcIFA3STULaJnXyHSamOh21hBTOVfBU/vSSCIjX8WIKxWBuRPEgMZ7X4INH3LF79RiTaxTHdorIxuc9g2bklSvF4pbiva2NqbPPtUwWKMbjff+Vp3fKCFxGhUqqXXjy2aippsvDn43+WJ93rsgE1DpLGc0tghZejmwUFopyJ1n23JIKqKArjSpOAJBM5wv1u0qV94uBNPP1pHGEvdukz3NNL11rwHRyoHY7ShdF//uwjI0Xqo7u2FvMatXUNWgcx2URWQpft6PfbGLvyjXdO893dhWn5Ig7Ee3Dg2wvSHfHWXU6V0BdrFv0rMZva9b4ecZsNd+61QHGkCw8Ga6yG0wqp+9Qe/zDlUQkV+/gKocoU6VEoUL9xw8