This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Keep Cifras Awake | |
// @namespace http://tampermonkey.net/ | |
// @version 2024-03-21 | |
// @description try to take over the world! | |
// @author You | |
// @match https://www.cifraclub.com.br/* | |
// @icon https://icons.duckduckgo.com/ip2/cifraclub.com.br.ico | |
// @grant none | |
// @require https://unpkg.com/@zakj/[email protected]/dist/no-sleep.umd.cjs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Reddit no longer exists | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description An userscript to aid people addited on Reddit to forget that this website ever existed | |
// @author qgustavor | |
// @match https://*.reddit.com/* | |
// @icon https://icons.duckduckgo.com/ip2/reddit.com.ico | |
// @grant none | |
// @run-at document-start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Detect Reddit Copy Bot Comments | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Detect copied comments in Old Reddit. | |
// @author qgustavor | |
// @match https://*.reddit.com/* | |
// @icon https://icons.duckduckgo.com/ip2/reddit.com.ico | |
// @grant none | |
// ==/UserScript== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as dnssd from 'npm:ya-dns-sd' | |
const timeout = Number(Deno.args[0]) || 30 | |
// Check if it's needed and prompt | |
const connectedDevices = new TextDecoder().decode(await Deno.run({ | |
cmd: ['adb', 'devices'], | |
stdout: 'piped' | |
}).output()).split(/\r?\n/g).filter(e => e).slice(1).map(e => e.split('\t')[0]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { parseFlags } from 'https://deno.land/x/[email protected]/flags/mod.ts' | |
import parse from 'https://cdn.skypack.dev/pin/@qgustavor/[email protected]/mode=imports/optimized/@qgustavor/ass-parser.js' | |
import stringify from 'https://cdn.skypack.dev/pin/@qgustavor/[email protected]/mode=imports/optimized/@qgustavor/ass-stringify.js' | |
import JSON5 from 'https://deno.land/x/[email protected]/mod.ts' | |
const defaultConfig = { | |
targetDir: '..', | |
filenameReplacement: null, | |
handleLineBreaks: false, | |
shiftTimes: false, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const functions = [ | |
(e, target, source) => Math.round(e * target / source), | |
(e, target, source) => Math.floor(e * target / source), | |
(e, target, source) => Math.ceil(e * target / source), | |
(e, target, source) => 1 + Math.round((e - 1) * target / source), | |
(e, target, source) => 1 + Math.floor((e - 1) * target / source), | |
(e, target, source) => 1 + Math.ceil((e - 1) * target / source), | |
(e, target, source) => Math.round((e - 1) * target / source), | |
(e, target, source) => Math.floor((e - 1) * target / source), | |
(e, target, source) => Math.ceil((e - 1) * target / source), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export async function* recursiveReadDir (url) { | |
for await (const dirEntry of Deno.readDir(url)) { | |
if (dirEntry.isDirectory) { | |
yield * recursiveReadDir(new URL(dirEntry.name, url.href + '/')) | |
} else if (dirEntry.isFile) { | |
yield new URL(dirEntry.name, url.href + '/') | |
} | |
} | |
} |
NewerOlder