This file contains hidden or 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
// tamanho do tabuleiro ao todo e quantas colunas tem em uma fileira | |
const boardSize = 500; | |
const holesPerRow = 50; | |
// tempo em ms de delay do intervalo do game loop | |
const loopDelay = 25; | |
// emojis, só pra deixar bonitinho kkkk | |
const emojis = { | |
blank: '🟫', |
This file contains hidden or 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 pluralExtList = [ | |
{ | |
1: "um", | |
2: "dois", | |
3: "três", | |
4: "quatro", | |
5: "cinco", | |
6: "seis", | |
7: "sete", | |
8: "oito", |
This file contains hidden or 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 HTML = [ | |
- estrutura de uma tag | |
- o que é head e body | |
- tags da head (meta, link, title... ) | |
- cabeçalhos | |
- tags básicas (p, div, span, a, b, i, u, img) | |
- tag de estilo e script | |
- listas | |
- tabelas | |
- formulários e inputs |
This file contains hidden or 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
// quando o usuário inserir um número, executa: | |
// pega a linha e coluna com base no id | |
const line = Math.floor(this.id / 9) | |
const row = this.id % 9 | |
// verifica se existe algum número igual a ele na vertical | |
const verifyVertical = board[line].includes(this.value) | |
// verifica se existe algum número igual a ele na horizontal |
This file contains hidden or 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
interface HTMLElement { | |
setStyle(newStyles: Partial<CSSStyleDeclaration>): void; | |
} | |
HTMLElement.prototype.setStyle = function (newStyles) { | |
for (let style in newStyles) { | |
this.style[style] = newStyles[style]! | |
} | |
} |
This file contains hidden or 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
HTMLElement.prototype.setStyle = function (newStyles) { | |
for (let style in newStyles) { | |
this.style[style] = newStyles[style]; | |
} | |
}; |
This file contains hidden or 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 getPages(base, maxChars, splitTerm = '\n') { | |
const pages = [] | |
// generates an array of items based in the string | |
const contentItems = base.split(splitTerm) | |
let content = '' | |
for (let i = 0; i < contentItems.length; i++) { | |
let part = contentItems[i] + splitTerm | |
// if content + part will be more than the max chars allowed, |
This file contains hidden or 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 { default: axios } = require('axios'); | |
const qrcode = require('qrcode-terminal'); | |
const { Client, MessageMedia } = require('whatsapp-web.js'); | |
const client = new Client(); | |
client.on('qr', (qr) => { | |
// Generate and scan this code with your phone | |
qrcode.generate(qr, {small: true}); | |
}); |
NewerOlder