Skip to content

Instantly share code, notes, and snippets.

View tiagorangel1's full-sized avatar
🍞
2025 will be the year of Bun

Tiago Rangel tiagorangel1

🍞
2025 will be the year of Bun
View GitHub Profile
@tiagorangel1
tiagorangel1 / 5-second previews
Last active December 24, 2024 16:19
System prompts of Arc Max
As a concise and helpful summarizer, create a glanceable "answer card" containing the most important information from the webpage.
Capture the tone, perspective and POV of the writer.
Provide a response using JSON, according to the `Response` schema:
```
interface Response {
blocked: boolean // Does this page ask the user to enable Javascript or complete a security check before accessing the content?
userQuestion: string? // 1-word question to focus the rest of the answer card upon; based on user's search query: 'google'
quickSummary: string? // 3-8 words the user is most likely to want to know, beyond the page's title. Provide a fact or opinion, not just a title.
details: Detail[] // 2-4 key points, solutions or items.
}
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 November 24, 2024 08:41
JWT decoder used for Authflow
// 💡 Tip: need to decode with node.js? Use the @authflow-js/verify npm module
function decryptJWT(e) {
return JSON.parse((typeof Buffer !== "undefined" ? Buffer.from(token.split('.')[1], 'base64') : atob(token.split('.')[1])).toString());
}
@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>