Skip to content

Instantly share code, notes, and snippets.

View tiagorangel1's full-sized avatar
:octocat:
tiagorangel.com

Tiago Rangel tiagorangel1

:octocat:
tiagorangel.com
View GitHub Profile
const canvas = document.createElement('canvas');
canvas.width = 1000;
canvas.height = 1000;
document.body.appendChild(canvas);
const ctx = canvas.getContext('2d');
let currentIndex = 0;
const totalDigits = 1000000;
const digitsPerRequest = 1000;
script-src
'self'
'wasm-unsafe-eval'
https://cdn.jsdelivr.net
https://apis.google.com
https://cdnjs.cloudflare.com
https://*.woopra.com
https://www.googletagmanager.com
'sha256-aROmP5KBVON8dHdF7kTobxNwhI67hJuBpk+jNh/jbM4='
'sha256-lIXJkTrfgeKmujhwsIkqzNbMkplZdPFm1ERXsf46uOw='

aspe:keyoxide.org:HLPMZEVMMCLIDWVGNDMB4LIB2M

@tiagorangel1
tiagorangel1 / omnibar.css
Last active November 10, 2024 19:32
Simple JS+CSS omnibar.
/* tiagorangel.com * If you use this, please credit me somewhere
* Make sure to set the following variables:
--foreground: r, g, b
--background: r, g, b
Example:
--foreground: 13, 13, 14;
--background: 255, 255, 255;
*/

aspe:keyoxide.org:CV3KDZMFHPQ2THPQJT2657RBHY

@tiagorangel1
tiagorangel1 / hotreload.js
Created February 24, 2024 13:49
Simple hot reload for HTML
setTimeout(async function () {
let o = await (await fetch(location.href)).text();
var i = setInterval(async function () {
var n = await (await fetch(location.href)).text();
if (!(o == n)) { location.reload(); clearInterval(i) }
}, 500)
}, 1)

Keybase proof

I hereby claim:

  • I am tiagorangel2011 on github.
  • I am tr11 (https://keybase.io/tr11) on keybase.
  • I have a public key whose fingerprint is 083A DAEA B2D0 D2B5 AB34 128F 37C5 0ED7 02C7 C04C

To claim this, I am signing this object:

@tiagorangel1
tiagorangel1 / jwt-decoder.js
Last active April 23, 2024 17:58
JWT decoder used for Authflow
// 💡 Tip: need to decode with node.js? Use the @authflow-js/verify npm module
function decryptJWT(e) {
function b64(e) {
return decodeURIComponent(Array.prototype.map.call(atob(e), function (e) {
return "%" + ("00" + e.charCodeAt(0).toString(16)).slice(-2)
}).join(""))
}
try {
const r = e
@tiagorangel1
tiagorangel1 / logrsetup.html
Last active May 27, 2024 15:17
The logr.js setup
<!-- Default, logs are injected on the page -->
<script src="https://jscdn.glitch.me/cdn/[email protected]" crossorigin="anonymous"></script>
<!-- Logs are only on the console -->
<script src="https://jscdn.glitch.me/cdn/[email protected]" crossorigin="anonymous"></script>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.