Skip to content

Instantly share code, notes, and snippets.

View vinaypuppal's full-sized avatar
🤓
Working from home

vínαч puppαl vinaypuppal

🤓
Working from home
View GitHub Profile
@Rich-Harris
Rich-Harris / http-apis.md
Last active November 3, 2022 09:02
Next-gen Node HTTP APIs

I saw this poll on Twitter earlier and was surprised at the result, which at the time of writing overwhelmingly favours option 1:

Screen Shot 2020-09-10 at 10 19 22 AM

I've always been of the opinion that the (req, res, next) => {} API is the worst of all possible worlds, so one of two things is happening:

  • I'm an idiot with bad opinions (very possibly!)
  • People like familiarity
@itsMapleLeaf
itsMapleLeaf / README.md
Last active May 24, 2024 03:53
Typed remix helpers

This is no longer needed! Remix's built-in types have improved significantly. But I'll keep this here for historical reasons.


Typed helpers for low-boilerplate type inference with Remix data.

  • I suffix them with *Typed so I don't accidentally import the core remix helpers.
  • This doesn't support regular Response objects to prevent accidentally using them with the typed helpers.
@AggressivelyMeows
AggressivelyMeows / tardis-redirector.js
Last active April 21, 2025 02:29
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",
@jsjoeio
jsjoeio / index.ts
Last active July 12, 2021 14:59
Timezone related functions
import {
fromUnixTime,
format,
} from "date-fns"
/**
* Checks if a timezone string is valid or not
*
* We do this to catch typos.
*
@cj
cj / @remix-run+dev+1.0.6.patch
Created December 14, 2021 17:09
Remix Transpile Modules
diff --git a/node_modules/@remix-run/dev/compiler.js b/node_modules/@remix-run/dev/compiler.js
index 22c5ac0..bb8ae60 100644
--- a/node_modules/@remix-run/dev/compiler.js
+++ b/node_modules/@remix-run/dev/compiler.js
@@ -352,6 +352,7 @@ async function createServerBuild(config, options) {
} // allow importing css files for bundling / hashing from node_modules.
+ if (config.transpileModules.includes(id)) return false;
if (id.endsWith(".css")) return false;