Skip to content

Instantly share code, notes, and snippets.

View AggressivelyMeows's full-sized avatar
🏳️‍🌈
Hard at work!

AggressivelyMeows

🏳️‍🌈
Hard at work!
View GitHub Profile

Keybase proof

I hereby claim:

  • I am AggressivelyMeows on github.
  • I am ceruthedev (https://keybase.io/ceruthedev) on keybase.
  • I have a public key whose fingerprint is 62D3 5789 58B2 02D3 7F6E BB12 73CF F78C B060 4A56

To claim this, I am signing this object:

@AggressivelyMeows
AggressivelyMeows / worker.js
Last active September 5, 2021 15:45
A worker to upload and read files from a private B2 bucket.
// A simple guide on how to use this Worker.
// To upload to the private bucket, you can send a POST request to the URL you want the file to end up at.
// For example: worker-url.com/images/user-1/subfolder/hi.png
// Once done, you can test your file by going to:
// worker-url.com/images/user-1/subfolder/h1.png
// Super simple API to use, much better than dealing with B2 directly, in my opinion.
addEventListener('fetch', event => {
event.respondWith(handleRequest(event))
@AggressivelyMeows
AggressivelyMeows / worker.js
Created June 10, 2021 06:58
Worker to grab the meta tags of a site
// Single-line install of CFW-EU (https://www.npmjs.com/package/cfw-easy-utils)
var cfweu = {};function t(e){var t="",s="0123456789abcdef";return new Uint8Array(e).forEach((e=>{t+=s[e>>4]+s[15&e]})),t}const s={uuidv4:()=>([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16))),async hashPassword(e,s){var r=(s=s||{}).salt||crypto.getRandomValues(new Uint8Array(8)),n=s.iterations||45e3;"string"==typeof r&&(r=function(e){(e=e.replace(/^0x/,"")).length%2!=0&&console.log("WARNING: expecting an even number of characters in the hexString");var t=e.match(/[G-Z\s]/i);t&&console.log("WARNING: found non-hex characters",t);var s=e.match(/[\dA-F]{2}/gi).map((function(e){return parseInt(e,16)}));return new Uint8Array(s).buffer}(r));const a=new TextEncoder("utf-8").encode(e),i=await crypto.subtle.importKey("raw",a,{name:"PBKDF2"},!1,["deriveBits","deriveKey"]),o=await crypto.subtle.deriveKey({name:"PBKDF2",salt:r,iterations:n,hash:"SHA-256"},i,{name:"AES-CBC",
@AggressivelyMeows
AggressivelyMeows / tardis-redirector.js
Last active June 19, 2021 02:26
A magic redirector that uses zero-width-spaces to create a secret key to your URLs. Trick people into thinking its magic with TARDIS redirector!
// Single-line install of CFW-EU (https://www.npmjs.com/package/cfw-easy-utils)
var cfweu = {};function t(e){var t="",s="0123456789abcdef";return new Uint8Array(e).forEach((e=>{t+=s[e>>4]+s[15&e]})),t}const s={uuidv4:()=>([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16))),async hashPassword(e,s){var r=(s=s||{}).salt||crypto.getRandomValues(new Uint8Array(8)),n=s.iterations||45e3;"string"==typeof r&&(r=function(e){(e=e.replace(/^0x/,"")).length%2!=0&&console.log("WARNING: expecting an even number of characters in the hexString");var t=e.match(/[G-Z\s]/i);t&&console.log("WARNING: found non-hex characters",t);var s=e.match(/[\dA-F]{2}/gi).map((function(e){return parseInt(e,16)}));return new Uint8Array(s).buffer}(r));const a=new TextEncoder("utf-8").encode(e),i=await crypto.subtle.importKey("raw",a,{name:"PBKDF2"},!1,["deriveBits","deriveKey"]),o=await crypto.subtle.deriveKey({name:"PBKDF2",salt:r,iterations:n,hash:"SHA-256"},i,{name:"AES-CBC",
SaaS:
name: string
createdAt: createdAt()
plans: [Plan]
visitors: [Visitors->visits]
registrations: [Visitor->registrations]
logins: [User->logsIn]
users: [User->uses]
onboardings: [User->onboards]
activations: [User->activates]