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
// Turn all HTML <a> elements into client side router links, no special framework-specific <Link> component necessary! | |
// Example using the Next.js App Router. | |
import { useRouter } from 'next/navigation'; | |
import { useEffect } from 'react'; | |
function useLinkHandler() { | |
let router = useRouter(); | |
useEffect(() => { | |
let onClick = e => { |
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
async function importFromGist(gistURL) { | |
var scriptText = await fetch(gistURL).then(res=> res.text()) | |
var blob = new Blob([scriptText], { | |
type: "application/javascript" | |
}) | |
var url = URL.createObjectURL(blob) | |
return await import(url) | |
} |
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 base64 | |
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes | |
from cryptography.hazmat.primitives import padding | |
from cryptography.hazmat.backends import default_backend | |
from django.utils.encoding import force_bytes, force_text | |
SECRET_KEY = "hellomotherfucker" | |
value = force_bytes("12345678901234567890") | |
backend = default_backend() |
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
// JSON of 3x3 matrices which transform RGB colors into colorspace which | |
// simulate the imparement of various color blindness deficiency. | |
// | |
// Used by Coblis: http://www.color-blindness.com/Coblis-color-blindness-simulator/ | |
// | |
// The original website posting the matrices has been taken down: | |
// http://www.colorjack.com/labs/colormatrix/ | |
// | |
// RGB transform matrices generated by Michael of www.colorjack.com | |
// Which were created using code by Matthew Wickline and the |