Skip to content

Instantly share code, notes, and snippets.

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

Tiago Rangel tiagorangel2011

:octocat:
tiagorangel.com
View GitHub Profile

aspe:keyoxide.org:CV3KDZMFHPQ2THPQJT2657RBHY

@tiagorangel2011
tiagorangel2011 / 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:

@tiagorangel2011
tiagorangel2011 / jwt-decoder.js
Last active March 15, 2023 22:15
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
@tiagorangel2011
tiagorangel2011 / logrsetup.html
Last active July 27, 2022 18:54
The logr.js setup
<!-- Default, logs are injected on the page -->
<script src="https://jscdn.glitch.me/cdn/logrjs@web.js" crossorigin="anonymous"></script>
<!-- Logs are only on the console -->
<script src="https://jscdn.glitch.me/cdn/logrjs@console.js" crossorigin="anonymous"></script>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tiagorangel2011
tiagorangel2011 / ratings.html
Created September 3, 2021 07:21
File for Tryp article
<!DOCTYPE html>
<html>
<head>
<script src="https://trypaddonserver.glitch.me/files/javascript/v1.js"></script>
<script>
function getvalues() {
var values = trypaddons.comments("get");
var commentor = values.comments;
var rat = values.rating;
alert("Comments: " + commentor + "\nRating:" + rat);
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
function Uint8Array(t) {
}
function onOpen() {
}
function init() {
}
function getCaptcha() {
}
function setCaptcha(e) {
}