Skip to content

Instantly share code, notes, and snippets.

const { APIMessage, Message } = require('discord.js')
/**
* @usage Message.quote([content], [options: { ...defaultOptions, messageID }])
* @param {StringResolvable|APIMessage} content
* @param {MessageOptions|MessageAdditions} options
* @param {string} [options.messageID] - the message id that will be quoted
* @param {boolean} [options.mention] - whether the client should mention the author
* @returns void
*/
@rfxct
rfxct / Jogo do bicho.js
Created July 13, 2021 06:01
Pega o último resultado do jogo do bicho e reproduz no console
/**
* @owner ONCode
* @author marc
* @title Último resultado do jogo do bicho
*/
const { JSDOM } = require('jsdom')
const fetch = require('node-fetch')
const URL = 'https://www.ojogodobicho.com/deu_no_poste.htm'
@rfxct
rfxct / RandomMany.js
Last active February 17, 2022 13:15
Gera números sem repetições entre 2 índices.
const randomOut = ({ min, max }, arr) => {
const result = Math.floor(Math.random() * (max - min + 1)) + min
return arr.includes(result) ? randomOut({ min, max }, arr) : result
}
const randomMany = (interval, amount) => {
const available = interval.max < amount ? interval.max : amount
for (var generated = []; generated.length < available;) {
generated.push(randomOut(interval, generated))
/**
* @usage validarCPF(value)
* @param {string} value
* @returns boolean
* @author github.com/rfxct
*/
function validarCPF (value) {
// Remove os caracteres de formatação, caso possua
const cpf = value.replace(/[^\d]/g, '')
/**
* @usage validarCNPJ(value)
* @param {string} value
* @returns boolean
* @author github.com/rfxct
*/
function validarCNPJ (value) {
// Remove os caracteres de formatação, caso possua
const cnpj = value.replace(/[^\d]/g, '')
{
"name": "Rogue Rewrite",
"description": "a rewrite of rogue",
"authors": [
{
"name": "marc",
"id": "610663056925523998"
}
],
"semanticColors": {
/**
2 + 3 = 10
8 + 4 = 96
7 + 2 = 63
6 + 5 = 66
9 + 4 = ?
*/
function resolveWithExpo(a: number, b: number): number {
return a * b + a ** 2;
{
"socket.url": "wss://live-arena-d74c8s.habblet.city/",
"asset.url": "https://images.habblet.city/leet-asset-bundles",
"image.library.url": "https://images.habblet.city/c_images/",
"hof.furni.url": "https://images.habblet.city/library/hof_furni",
"images.url": "https://images.habblet.city/images",
"gamedata.url": "https://www.habblet.city/gamedata",
"sounds.url": "${asset.url}/sounds/%sample%.mp3",
"external.samples.url": "${hof.furni.url}/mp3/sound_machine_sample_%sample%.mp3",
"avatar.asset.url": "${asset.url}/libraries/figure/%libname%.nitro",