Skip to content

Instantly share code, notes, and snippets.

View belisarius222's full-sized avatar

Ted Blackman belisarius222

View GitHub Profile
@belisarius222
belisarius222 / reminder.hoon
Last active January 11, 2018 19:55
simple reminder app
/? 310
::
:: models
::
|%
+= move (pair bone card)
+= card [%wait wire p=@da]
--
::
:: main app door
@belisarius222
belisarius222 / reminder.hoon
Created January 11, 2018 19:56
simple reminder mark
/? 310
::
|_ [delta=@dr message=@t]
++ grab
|%
+= noun [delta=@dr message=@t]
--
--
@belisarius222
belisarius222 / algo.md
Last active February 18, 2018 04:26
future Ford design

Ford rebuild algorithm

Steps

  1. Ford receives a ++sign from Clay containing the ++care of new revisions of some files we subscribed to on a ++path.
  2. Ford does a bi-jug lookup of the changed dependencies in its state's deps, which will return a set of ++build-indices whose builds they refer to may need to get rebuilt.
  3. For each of those build indices, Ford calls ++build-up.
@belisarius222
belisarius222 / nuford.hoon
Last active March 13, 2018 00:01
ford data structures
::
:: sys/ford/hoon
::
|%
::
:: +axle: overall ford state
::
+= axle
$: :: date: date at which ford's state was updated to this data structure
::
@belisarius222
belisarius222 / Meteor local mirror
Last active March 26, 2018 15:02 — forked from anonymous/Meteor local mirror
Added `changed` callback and factored out shared --> local conversion.
//common to client and server
SharedCollection = new Meteor.Collection('shared');
//client from here on out
LocalMirror = new Meteor.Collection(null);
var convertSharedToLocal = function(sharedDoc) {
var localDoc = LocalCollection._deepcopy(sharedDoc); // undocumented API, might change
@belisarius222
belisarius222 / up-fleet-tests.md
Last active May 7, 2018 18:36
UP Fleet Tests

Title: Urbit Fleet Tests Author: Ted Blackman ~rovnys-ricfer ted@tlon.io Created: ~2017.12.14

Overview

After a month of labor, Tlon gave birth to a new continuity era, which came out kicking and screaming, covered in amniotic fluid. A slew of issues rapidly appeared in the wild. We'd tested the functionality of the new features, but we hadn't stress-tested them. Some bugs, like herpes, only manifest when the system is under stress.

We need a way to perform automated testing on a fleet of Urbits. We'll want to crank up the load to arbitrary severity while retaining the ability to measure results -- crucially, we want to improve our sleep quality by testing loads much worse than the live network.

@belisarius222
belisarius222 / up-hoon-doc.md
Last active June 2, 2018 00:15
up-hoon-doc.md

UP3: Hoon Docs

author: Ted Blackman  ~rovnys-ricfer  ted@tlon.io

Overview

As anyone who's worked with the language can tell you, the overall levels of sanity and practicality in hoon are actually quite high. So why is it so hard to learn?

@belisarius222
belisarius222 / bi-heap.hoon
Last active June 4, 2018 22:22
Binomial Heap
|%
++ heap
|* a=mold
|= compare=$-([a a] ?)
=> |%
+= bi-tree [val=a rank=@ud kids=(list bi-tree)]
+= bi-heap (list bi-tree)
--
|%
::
:: +build-status: current data for a build, including construction status
::
:: +build-status stores the construction status of a build as a finite
:: state machine (:state), and it also contains the information needed
:: to relate this build to other builds, such as clients and sub-builds.
::
+= build-status
$: :: listeners: current set of external listeners tracking this build
::
listeners=(set listener)
:: +cache-key: a key for looking up a build in the cache
::
+= cache-key
$: sub-results=(list build-result)
$% [%$ literal=cage]
[%alts ~]
[%bake renderer=term query-string=coin path-to-render=rail]
[%bunt mark=term]
[%call ~]
[%cast mark=term]