Skip to content

Instantly share code, notes, and snippets.

:: Script runes:
::
:: @@: run every fixed period of time
:: ##: import a hoon file from a path,
:: first element of the path is the name
:: of a desk
::
:: Cron scheduler: run /pack script every Sunday at 02:00 AM,
:: restart once a day if it crashed
::

Remove writer role if a channel member did not write anything in the past 24 hours:

const urbit = require("urbit_thread");

function unix_seconds_to_urbit(seconds) {
    const seconds = BigInt(Math.floor(seconds));
    return (seconds + 0x8000000cce9e0d80n) * (1n << 64n);
}