Skip to content

Instantly share code, notes, and snippets.

View FelixLuciano's full-sized avatar
🔭
Discovering

Luciano Felix FelixLuciano

🔭
Discovering
View GitHub Profile
// 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 => {
@7cc
7cc / importFromGist.js
Created September 11, 2019 21:48
js import from Gist
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)
}
@tcitry
tcitry / crypto.py
Created March 14, 2019 16:40
python cryptography AES-256-ECB
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()
@Lokno
Lokno / colorMatrices.js
Last active July 30, 2023 01:02
Color Blindness Matrices
// 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