This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const gh = (path) => new URL(path, 'https://nobsdelivr.private.coffee/gh'); | |
| const getJson = (url) => | |
| fetch(url, { headers: { Accept: "application/json" } }) | |
| .then((response) => response.json()) | |
| .catch((error) => { | |
| console.error(error); | |
| }); | |
| async function fetchInstances() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { registerHooks } from "node:module"; | |
| import { | |
| Worker, | |
| MessageChannel, | |
| receiveMessageOnPort, | |
| } from "node:worker_threads"; | |
| const channel = new MessageChannel(); | |
| const { port1: mainPort, port2: workerPort } = channel; | |
| mainPort.unref(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env nix | |
| #! nix shell nixpkgs#argc nixpkgs#jq --command bash | |
| # shellcheck shell=bash | |
| # vim: filetype=bash | |
| # @describe Bootstrap a launch agent plist | |
| # @option -c --command! Command to run | |
| # @option -C --cwd <DIR> Working directory | |
| # @option -e --env*, Environment variables | |
| # @option -l --label! Launch agent label | |
| # @option -n --name! Program name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { spawn } from "node:child_process"; | |
| import { on, once } from "node:events"; | |
| async function spawnAsync(...args) { | |
| const subprocess = spawn(...args); | |
| /** @see https://github.com/sindresorhus/nano-spawn/blob/cc231e2c7/source/spawn.js#L24-L26 */ | |
| subprocess.once("error", () => {}); | |
| const until = ["spawn", "close"].reduce((out, event) => { | |
| out[event] = once(subprocess, event); |