Skip to content

Instantly share code, notes, and snippets.

@qgustavor
qgustavor / _usage.md
Last active February 17, 2026 21:03
Migrates a TypeScript codebase from .ts file extensions to .cts or .mts

deno run --allow-read --allow-write --allow-run --ignore-env https://gist.github.com/qgustavor/e0432e75d131d3460db5901a5fb23992/raw/ts-to-cts-mts.mts

Escadas válidas conforme Blondel

Altura do piso Base do piso
15.5 32
15.5 32.5
15.5 33
16 31
16 31.5
16 32
@qgustavor
qgustavor / cola-duam.user.js
Last active September 5, 2025 13:12
Um user-script para colar os números do DUAM diretamente sem dor de cabeça, porque o pessoal do TI da prefeitura de Goiânia só sabe mexer naquele sistema novo (fonte: eles próprios falaram em uma reunião que tive com eles).
// ==UserScript==
// @name Cola DUAM
// @namespace Violentmonkey Scripts
// @match https://www.goiania.go.gov.br/sistemas/samin/asp/samin00002f0.asp*
// @grant none
// @version 1.0
// @author -
// @description 9/5/2025, 9:55:33 AM
// ==/UserScript==
@qgustavor
qgustavor / jumpcutter-tldv.user.js
Last active July 23, 2025 14:34
JumpCutter for tldv.io: Speeds up silent parts in tldv.io meetings
// ==UserScript==
// @name JumpCutter for tldv.io
// @namespace Violentmonkey Scripts
// @match https://tldv.io/app/meetings/*
// @grant none
// @version 1.4
// @author qgustavor
// @description Speeds up silent parts in tldv.io meetings
// ==/UserScript==
@qgustavor
qgustavor / whatsapp-increase-volume.user.js
Created March 12, 2025 15:37
Increase WhatsApp Web Audio Volume
// ==UserScript==
// @name Increase WhatsApp Web Audio Volume
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Intercept audio creation and redirect to Web Audio API with increased volume using createMediaElementSource
// @author ChatGPT
// @match https://web.whatsapp.com/*
// @run-at document-start
// ==/UserScript==
// ==UserScript==
// @name Block DuckDuckGo's AI
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Add kbg=-1 and kbe=0 to DuckDuckGo URLs if missing
// @author qgustavor
// @match *://duckduckgo.com/*
// @grant none
// @installUrl https://gist.github.com/qgustavor/c2dba88fdec3d2383310b1503d766065/raw/no-duck-ai.user.js
// @updateUrl https://gist.github.com/qgustavor/c2dba88fdec3d2383310b1503d766065/raw/no-duck-ai.user.js
@qgustavor
qgustavor / ssp-captcha-breaker.user.js
Last active February 19, 2025 15:39
Quebra o "captcha" da Secretaria de Segurança Pública do Governo de Goiás (SSP-GO)
// ==UserScript==
// @name Quebra o "captcha" da Secretaria de Segurança Pública do Governo de Goiás (SSP-GO)
// @namespace Violentmonkey Scripts
// @match https://raivirtual.ssp.go.gov.br/*
// @grant none
// @version 1.0
// @author qgustavor
// @description Quebra o "captcha" da Secretaria de Segurança Pública do Governo de Goiás (SSP-GO)
// ==/UserScript==
@qgustavor
qgustavor / blue-prince.md
Last active January 16, 2025 13:35
Annotations for the Blue Prince game

Warning

THIS PAGE INCLUDES SPOILERS! This document is a work in progress, you can contribute by leaving a comment.

Annotations for the Blue Prince game

Introdution

I have noticed that the Blue Prince game (at the time of writting only a demo was released), despite being really interesting, is a game where is really hard to find info about it in the internet.

Surely you can find a lot about the game by playing the demo, but that requires you to have a computer that can handle the game (and mine is having some few issues at the moment). The easiest way to get info about this game I could find so far is checking playthoughts on YouTube, but you can't just Ctrl+F a video.

@qgustavor
qgustavor / check-cnpj-example.js
Last active July 25, 2024 13:18
Code to check a CNPJ number and automatically suggest fixes in case of a single digit typo
import { checkCNPJ } from './check-cnpj.js'
const userCNPJ = '01.005.727/0001-23'
const result = checkCNPJ(userCNPJ)
if (result.valid) {
console.log(`The CNPJ ${result.formattedCNPJ} is valid.`)
} else {
console.log(`The CNPJ ${result.formattedCNPJ} is invalid.`)
if (result.possibleCorrections.length > 0) {
@qgustavor
qgustavor / population-model.js
Created May 7, 2024 16:14
Population model to simulate what could happen if two female woman could have female children together and children had 95% chance of inheriting their parents' sexuality
// Function to interpolate missing rates
function interpolateRate(rates, age) {
const surroundingRates = Object.entries(rates)
.filter(([key]) => Number(key) <= age)
.sort((a, b) => Number(a[0]) - Number(b[0])) // Sort by age (ascending)
if (surroundingRates.length === 0) {
// No rates available, return 0 (adjust as needed)
return 0
}