Skip to content

Instantly share code, notes, and snippets.

View Juan-Esc's full-sized avatar

Juan-Esc

  • Madrid
View GitHub Profile
@w00kie
w00kie / index.ts
Last active October 30, 2025 02:11
Cloudflare Worker that bundles R2 objects in a Zip file
import { z } from 'zod';
import { ZipWriter, BlobReader, configure } from '@zip.js/zip.js';
// Without this, we get uncaught error due to Workers runtime bug
// See: https://github.com/gildas-lormeau/zip.js/discussions/514
configure({
useCompressionStream: false,
});
// Payload schema that lists the files to be bundled, their filenames and the archive filename
@chafreaky
chafreaky / validateJWT.js
Created February 5, 2022 22:59
Validate a JWT token in DeSo (BitClout) against a Public Key
const jsonwebtoken = require('jsonwebtoken');
const bs58check = require('bs58check');
const EC = require('elliptic').ec;
const ec = new EC('secp256k1');
const KeyEncoder = require('key-encoder').default;
/**
* Thank you to https://github.com/mattetre/bitclout-jwt-validate/blob/main/index.js
* @param {String} publicKey
* @param {String} jwt
@trenutoo
trenutoo / migrate-pterodactyl.md
Last active April 3, 2026 04:30
Pterodactyl panel and wings migration

Pterodactyl Migration

Migrating panel

  1. Backup your hidden .env file containing the decryption APP_KEY from /var/www/pterodactyl

  1. Export the database, in this case ours is named panel
@fnky
fnky / promise-tuple.js
Last active September 18, 2024 16:39
Retrieve tuples from Promise results / async functions
/**
* Returns a Promise which resolves with a value in form of a tuple.
* @param promiseFn A Promise to resolve as a tuple.
* @returns Promise A Promise which resolves to a tuple of [error, ...results]
*/
export function tuple (promise) {
return promise
.then((...results) => [null, ...results])
.catch(error => [error])
}
@0xjac
0xjac / private_fork.md
Last active May 8, 2026 11:39
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare git@github.com:usi-systems/easytrace.git