Skip to content

Instantly share code, notes, and snippets.

View maddsua's full-sized avatar

Daniel maddsua

View GitHub Profile
#deb cdrom:[Debian GNU/Linux 13.0.0 _Trixie_ - Official amd64 DVD Binary-1 with firmware 20250809-11:21]/ trixie contrib main non-free-firmware
deb http://deb.debian.org/debian/ trixie main non-free-firmware
deb-src http://deb.debian.org/debian/ trixie main non-free-firmware
deb http://security.debian.org/debian-security trixie-security main non-free-firmware
deb-src http://security.debian.org/debian-security trixie-security main non-free-firmware
# trixie-updates, to get updates before a point release is made;
# see https://www.debian.org/doc/manuals/debian-reference/ch02.en.html#_updates_and_backports
@maddsua
maddsua / cloudflare-worker-r2-backup.js
Created March 2, 2025 22:31
Backups uploader worker for cloudflare r2
export default {
async fetch(request, env, ctx) {
return await backupHandler(request, env, ctx)
.catch((error) => new Response(`${error}`, { status: 500 }));
},
};
const backupHandler = async (request, env, ctx) => {
type Expect<T> = {
result: T;
error: null;
} | {
result: null;
error: Error;
};
type Result<T> = Promise<T> | T;