Skip to content

Instantly share code, notes, and snippets.

@AwesomeObserver
AwesomeObserver / skelfs.c
Created July 31, 2022 18:32 — forked from bkmeneguello/skelfs.c
FUSE implementation skelekton
/*
FUSE: Filesystem in Userspace
Copyright (C) 2013 Bruno Meneguello
This program can be distributed under the terms of the GNU GPL.
gcc -Wall skelfs.c `pkg-config fuse --cflags --libs` -o skelfs
*/
#define FUSE_USE_VERSION 26
@AwesomeObserver
AwesomeObserver / onSettled.js
Created February 17, 2022 18:39 — forked from acutmore/onSettled.js
utility function to take an array of promises and return an async iterator that yield results as promises settle
/** @param promises {Array<Promise<unknown>>} */
export async function * onSettled(promises) {
let wake;
let wait = new Promise(_ => wake = _);
let pending = promises.length;
const queue = [];
for (const p of promises) {
Promise.allSettled([p]).then(([result]) => {
queue.push(result);