Skip to content

Instantly share code, notes, and snippets.

View qgustavor's full-sized avatar
🎯
Focusing

Gustavo Rodrigues qgustavor

🎯
Focusing
View GitHub Profile
// Download Deno here: https://deno.land/#installation
// Download this file
// Run it using: deno run -A adb-auto-connect.ts [ip address]
import PQueue from 'https://deno.land/x/p_queue@1.0.1/mod.ts'
import ProgressBar from 'https://deno.land/x/progress@v1.2.7/mod.ts'
const hostname = Deno.args[0] ?? '' // <-- set default ip address here to make the argument optional
// Check if it's needed and prompt
@qgustavor
qgustavor / estatísticas-uf-br.md
Last active June 30, 2022 22:09
Estatísticas das páginas da Wikipédia das Unidades federativas do Brasil

Unidades federativas em ordem decrescente de tamanho da página

Estado Visitas nos últimos 30 dias Tamanho da página em bytes
Minas Gerais 28223 217883
Paraná 18765 206310
Paraíba 11981 187723
São Paulo (estado) 50973 185755
Espírito Santo (estado) 16508 185221
Santa Catarina 19523 183358
@qgustavor
qgustavor / duckduckgo.user.css
Last active January 4, 2023 20:50 — forked from Thesola10/duckduckgo.user.css
Replaces the default DuckDuckGo icon with Virtual Youtuber Oozora Subaru from Hololive.
/* ==UserStyle==
@name DuckDuckGo From Hologra Episode 139
@namespace thesola10
@version 1.0.0
@license MIT
@updateURL https://gist.github.com/qgustavor/f46d933d45dac29b6894f8c60d0d1e9d/raw/duckduckgo.user.css
@author thesola10, qgustavor
==/UserStyle== */
@-moz-document domain("duckduckgo.com") {
// Run in console in a page with sha256 loaded as a global
(async function () {
let durations = []
for (let i = 0; i < 100; i++) {
const times = 5000
const value = ''
const start = Date.now()
let hashHex = value
for (let i = 0; i < times; i++) {
const hashBuffer = await crypto.subtle.digest('SHA-256', new TextEncoder().encode(hashHex).buffer)
const fs = require('fs')
async function main () {
const files = await fs.promises.readdir('.')
for (const file of files) {
if (!file.endsWith('.ass')) continue
const data = await fs.promises.readFile(file, 'utf-8')
const lines = data.split(/\r?\n/g)
const timeCounts = {}
// ----------------------- recipe -----------------------
// -- Convert files from queue until the buffer gets 12 files
// Files are converted based on the source
// * 10 bit videos are converted to 8 bit
// * 4:4:4 videos are converted to 8 bit with -pix_fmt yuv420p
// * AC3 audios are converted to AAC
// * (maybe) splited MKVs are merged (needs to run before ffmpeg)
// -- Check if the next 12 to 24 files were downloaded
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@qgustavor
qgustavor / index.md
Last active February 19, 2021 01:53
Bookmarklet que pula as músicas de animes

Se você não aprecia as músicas de animes, você não está sozinho.

Vários serviços tratam as aberturas e encerramentos como se fossem algo desnecessário. Mesmo quando os serviços têm licença para traduzir eles preferem não traduzir pois acham que não são importantes. Se você não gosta, tudo bem, você foi influenciado a também achar que o trabalho de vários animadores é algo que só pode ser apreciado uma vez só e não tem quase nenhuma importância.

Se quiser pular, pule.

@qgustavor
qgustavor / mega.js
Last active October 31, 2020 15:31
Simple MEGA downloader
export async function getMegaFile (megaUrl) {
const { handler, wrappedKey } = parseMegaUrl(megaUrl)
const url = await getDownloadUrl(handler)
const response = await fetch(url)
if (!response.ok) throw Error('MEGA request failed with ' + response.statusText)
const data = await response.arrayBuffer()
return decryptAesCtr(data, unwrapMegaKey(wrappedKey))
}
@qgustavor
qgustavor / locodol-karaoke.svg
Last active August 7, 2020 19:42
Karaoke animation in the episode 12 of Locodol at 13:04
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.