Skip to content

Instantly share code, notes, and snippets.

View trepichio's full-sized avatar
🧠
Talk is cheap. Show me the code!

João Trepichio trepichio

🧠
Talk is cheap. Show me the code!
View GitHub Profile
@trepichio
trepichio / adaptive.md
Last active December 27, 2023 18:50
SOMOS

Payload da exchange 'plurall::adaptative.indexer.assessment':

Assessement [{ "student_id": "1234 "event_id": "999" "event_name": " "abilities": [{ "ability_code": "MT_5E2.2", "content_code": "ACGTEFIMA5_OBEFIMA78_CN1EFIMA219_CN2EFIMA143",

@alexbruno
alexbruno / valid.cnpj.ts
Last active September 17, 2024 17:36
Validação de CNPJ
// Regex para validação de string no formato CNPJ
export const regexCNPJ = /^\d{2}.\d{3}.\d{3}\/\d{4}-\d{2}$/
// Método de validação
// Referência: https://pt.wikipedia.org/wiki/Cadastro_Nacional_da_Pessoa_Jur%C3%ADdica
export function validCNPJ(value: string | number | number[] = '') {
if (!value) return false
// Aceita receber o valor como string, número ou array com todos os dígitos
const isString = typeof value === 'string'
/**
Code copyright Dustin Diaz and Ross Harmes, Pro JavaScript Design Patterns.
**/
// Constructor.
var Interface = function (name, methods) {
if (arguments.length != 2) {
throw new Error("Interface constructor called with " + arguments.length + "arguments, but expected exactly 2.");
}
this.name = name;