Skip to content

Instantly share code, notes, and snippets.

View RangerMauve's full-sized avatar
💜
Decentralizing

Mauve Signweaver RangerMauve

💜
Decentralizing
View GitHub Profile
@theodric
theodric / steam-deck-arch-chroot.txt
Last active December 26, 2023 13:16
Setting up an Arch chroot environment on the Steam Deck, then using as NOT a chroot environment
## So you want to use stuff like 'tmux' and 'lolcat' on the Steam Deck, but they haven't been included in the base OS?
# One way to do it is this.
# 1. setup a chroot environment so there is a file structure in which Pacman can download/unpack packages and their dependencies.
# 2. don't use it as a chroot environment; rather, add the various /bin directories inside it to your $PATH, and create an /etc/ld.so.conf.d/deck-local-arch.conf to permit the bins to find the libs they need.
mkdir -p ~/.local/packer
cd ~/.local
#these steps are required, or else the pacstrap will fail with 'marginal trust' errors
pacman -Sy archlinux-keyring
pacman-key --populate archlinux
@i-infra
i-infra / appropriate_phone_infra.md
Last active December 2, 2021 22:27
How to get a (GVoice) phone number that you can use, safely, to interact with strangers, online. [2021]

Appropriate Phone Infra (Operational GVoice) v0.9.0

Public Release Feb17, 2021.

Copyright 2021, AKA Infra

Released under Creative Commons by Attribution 4.0 International (CC BY 4.0)

You are free to:

  • Share — copy and redistribute the material in any medium or format
@qwtel
qwtel / whatwg-stream-to-async-iterable.ts
Created October 12, 2020 09:02
Convert WHATWG web streams to async iterables and back
export async function* streamToAsyncIterable<T>(stream: ReadableStream<T>): AsyncIterableIterator<T> {
const reader = stream.getReader();
try {
while (true) {
const { done, value } = await reader.read();
if (done) return;
yield value;
}
} finally { reader.releaseLock() }
}

Hyperswarm DHT setup

Checking your network for P2Pness

Running a node

Running a dht node is as simple as installing the DHT cli.

npm i -g @hyperswarm/cli
@cjihrig
cjihrig / wasi.c
Last active March 21, 2020 14:14
WASI C Header
#include "uvwasi.h"
__wasi_errno_t __wasi_args_get(char** argv, char* argv_buf) {
return __WASI_ENOTSUP;
}
__wasi_errno_t __wasi_args_sizes_get(size_t* argc, size_t* argv_buf_size) {
return __WASI_ENOTSUP;
@pfrazee
pfrazee / 0.8-new-apis.md
Last active May 4, 2018 17:56
Reference for new APIs in Beaker 0.8

New APIs in Beaker 0.8

This Gist is a quick writeup for devs using the beta or master build. We'll get a more complete writeup in the Beaker site docs on 0.8's final release. Feel free to open issues for discussion.

DatArchive

We've done some work on the DatArchive API to make it easier to use. Prior to 0.8, Dats had a "staging area" folder which you had to commit() to publish. In 0.8, Beaker will automatically sync that folder. As a result, the staging-area methods (diff() commit() and revert()) were deprecated. There are also some new methods, and a few changes to how events work.

Here's a full reference:

So, as I mentioned last time, I have two fundamental goals with dat that are not addressed by simply running dat share.

  • Uptime: making sure that the site is seeded even if my local laptop is closed, eaten by a bear, or disconnected from the internet
  • Resilience: ensuring that there's a way to restart my website if the original seeding computer is lost. I try to make everything on my primary work/personal computer work in such a way that I can recover it all, easily, onto a new machine if I need to

To break these down a bit more, uptime is a combination of two things:

  • Ensuring that there are seeders
  • Ensuring that those seeders are seeding, and they're up-to-date
'use strict';
const parseMs = require('parse-ms');
const plur = require('plur');
const units = [{ s: 'y', l: 'year' },
{ s: 'd', l: 'day' },
{ s: 'h', l: 'hour' },
{ s: 'm', l: 'minute' },
{ s: 's', l: 'second' },
{ s: 'ms', l: 'millisecond' }];
@cblgh
cblgh / dat-quickstart.md
Last active May 1, 2018 19:29
make the p2p web with dat's primitives

low level primitives (in ascending abstraction)

  • hypercore works with individual posts in an append-only feed
  • hyperdrive abstracted filestore / works with files
  • hyperdiscovery create p2p swarms for hypercores, hyperdrives, and hyperdbs
  • hyperdb key-value database

higher level abstractions

  • webdb database; basically a document(?) store
  • dat-node built ontop of hypercore & hyperdrive, abstracts a bunch of stuff; less complex but also less flexible
@chourobin
chourobin / 0-bridging-react-native-cheatsheet.md
Last active October 14, 2024 15:10
React Native Bridging Cheatsheet