Follow this https://ubuntu.com/tutorials/how-to-run-ubuntu-desktop-on-a-virtual-machine-using-virtualbox#1-overview. Assuming you tick the guest additions, it will all be setup.
Then setup shared folders:
| // I've deliberately named this `forP_` becaus it matches Haskell's `forP_` too | |
| function forP_<T, P extends PromiseLike<void> = Promise<void>>( | |
| items: readonly T[], | |
| f: (item: T) => PromiseLike<void>, | |
| seed?: P | |
| ): P { | |
| return items.reduce((pChain, item) => { | |
| return pChain.then(() => f(item)); | |
| }, seed ?? Promise.resolve()) as P; |
| import type { JsonWebKey } from 'crypto'; | |
| import crypto from 'crypto'; | |
| /** | |
| * Generates equivalent to RSASSA-PKCS1-v1_5 keypair | |
| */ | |
| async function generateKeyPairRSA(): Promise<{ | |
| publicKey: JsonWebKey, | |
| privateKey: JsonWebKey | |
| }> { |
It's the relationship between entities that allow them to co-operate with each other.
For trust to be required, there must be vulnerability, as in chance that the counter party might cheat.
At the same time, for trust to exist, one must believe that the counter party has an incentive to co-operate instead of cheating.
If there is no vulnerability, there is no need for trust.
There are number of ways of creating tagged unions.
type X = { type: A, prop: number } | { type: B, prop: string };
type Y = { type: A, data: { prop: number } } | { type: B, data: { prop: string } };
type Z = ['A', { prop: number }] | ['B', { prop: string }];| import * as nobleEd25519 from '@noble/ed25519'; | |
| /** | |
| * Checks if the public key is a point on the Ed25519 curve | |
| */ | |
| function validatePublicKey(publicKey: Buffer): boolean { | |
| try { | |
| nobleEd25519.Point.fromHex(publicKey); | |
| return true; | |
| } catch { |
| /** | |
| * Webcrypto random bytes is limited to 65,536 in one call. | |
| * The below functions will make repeated calls to acquire random bytes. | |
| */ | |
| const webcrypto = globalThis.crypto?.webcrypto || globalThis.window?.crypto; | |
| async function sleep(ms: number): Promise<void> { | |
| return await new Promise<void>((r) => setTimeout(r, ms)); | |
| } |
| #!/usr/bin/env bash | |
| set -o errexit | |
| set -o nounset | |
| set -o pipefail | |
| shopt -s inherit_errexit | |
| count=0 | |
| glab api 'projects/:fullpath/issues?state=opened' --paginate | jq -c '.[]' | while read -r issue_object; do |
Imagine this...
async function main () {
const config = await (async (
a = 'a',
b = 'b',
c = `${a}/${b}`,
d = ((
e = 'e',