Skip to content

Instantly share code, notes, and snippets.

View Fang-'s full-sized avatar
🔝

fang Fang-

🔝
  • UTC+2
View GitHub Profile
@Fang-
Fang- / mirage.md
Last active October 5, 2023 23:47
Mirage (EAuth)

mirage (eauth)

Urbit's identity layer pervades everything on Mars. Unfortunately, despite talking to Mars a lot, Earth is not quite so fortunate. A notable example are requests made to Urbit's HTTP server, Eyre. Presently, when viewing for example a blog post hosted by someone else's urbit, there is no way for a user to leave a comment signed by their own identity right then and there: they need to go through their own urbit instead, maybe even installing a matching blog app.

@Fang-
Fang- / open-eyre.md
Last active May 20, 2023 03:32
The Open Eyre

the open eyre

Some have bemoaned Urbit's absence on the clearnet. Everyone accesses their urbits via HTTP, but few apps use that same affordance to expose themselves to the public at large.

But that's not very strange given the current state of HTTP access. As long as you are authenticated as the host ship, you get first-class access to the ship through Eyre's "channels" system, letting you pretend you are in userspace by

@Fang-
Fang- / cached-eyre.md
Last active September 5, 2023 01:58
Publication caches for Eyre

eyre caching

Urbit can function as a webserver, but isn't as fast at that as it could be. It would be good if it could comfortably serve hundreds or even thousands of pageviews a minute. Benchmarks for the status quo are left as an exercise to the reader.

approaches to improving performance

There are two ways in which we can use the scry namespace to make Eyre more performant. Truthfully, there are probably more than two ways, but these specific two have highest relevance in Eyre's recent history.

  • Publication cache: Eyre can track a publication cache with static, known-ahead-of-time responses bound to specific endpoint paths. Eyre would tell the runtime about these known responses, which the runtime would use to serve up responses to GET requests.
  • Stateless reads: The runtime, when receiving a GET request, can scry into Eyre to retrieve a response for it. Eyre might scry into agents to further resolve the read. This way, with GET requests handled as pure reads, they could theoretically be
@Fang-
Fang- / jetting-101.md
Created July 13, 2018 13:48
Explained by a vere noob.

First off, general u3/vere docs are here. They feel pretty opaque, and Paul/~fodwyt, an experienced vere dev, has admitted to reading them every so often and still bringing back new understanding of the doc each time. I suggest to skim it, most of it isn't exactly relevant, but do read the sections on reference counts and reference protocols.

For a quick overview on what goes into adding a jet, see this commit as an example. (Matching Hoon change is here though only the use of ~% and ~/ is of interest.)

Jet registration

To get your jet called whenever the matching Hoon code is called, that code needs to be hinted. Use ~/ and so

@Fang-
Fang- / lib-test-clay.hoon
Created February 13, 2018 20:23
Terrible beginnings of a neat clay testing lib
::
:::: /lib/test/clay/hoon
::
// /===/sys/vane/clay
=+ cloy=(. !>(..zuse))
::
|%
++ core cloy
++ work
|_ cor/_core
@Fang-
Fang- / iina-youtube.js
Last active March 1, 2023 09:44
Turn Youtube links into IINA application links.
// ==UserScript==
// @name Open Youtube links in IINA
// @namespace https://palfun-foslup.urbit.org/
// @description Replaces Youtube links with a link to open them in IINA. Set a useful whitelist for yourself.
// @include *youtube.com/*
// @updateURL https://gist.githubusercontent.com/Fang-/7db1ac4e798a7128f006fa535f42cfb0/raw/25b60b08e55be87d2b0d5630d1f580b15ca2870d/iina-youtube.js
// @downloadURL https://gist.githubusercontent.com/Fang-/7db1ac4e798a7128f006fa535f42cfb0/raw/25b60b08e55be87d2b0d5630d1f580b15ca2870d/iina-youtube.js
// @run-at document-end
// @version 1.0
// ==/UserScript==