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
{ | |
// Material Icon | |
"workbench.iconTheme": "material-icon-theme", | |
"material-icon-theme.folders.associations": { | |
"infra":"app", | |
"entities":"class", | |
"schemas":"class", | |
"typeorm":"database", | |
"repositories":"mappings", | |
"http":"container", |
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
// Remove accents and spaces from a string | |
'rEFerêncIA PAra EDIÇãO de SLUG'.toLowerCase().replaceAll(/ /g,'-').normalize("NFD").replace(/[\u0300-\u036f]/g, "") |
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
/** | |
* @param {Object[]} arrJson | |
* @returns {String} | |
*/ | |
let transformJsonToString = (arrJson) => { | |
let newObj = "["; | |
let counter = 0; | |
arrJson.forEach((element) => { | |
let str = |
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 NUMBER_OF_CPFS = 100 | |
function randomiza(n) { | |
var ranNum = Math.round(Math.random() * n); | |
return ranNum; | |
} | |
function mod(dividendo, divisor) { | |
return Math.round(dividendo - Math.floor(dividendo / divisor) * divisor); | |
} |
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 aws = require('aws-sdk'); | |
const mime = require('mime'); | |
const path = require('path'); | |
const fs = require('fs'); | |
const multerConfig = require('../../config/multerConfig'); | |
const { AWS_BUCKET_REGION, AWS_BUCKET } = process.env; | |
module.exports = class S3Storage { |
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 date = new Date("2022-01-31 00:00"); | |
const actual = new Intl.DateTimeFormat("pt-br", { | |
dateStyle: "full", | |
timeStyle: "long", | |
}).format(date); |
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
import pino from 'pino'; | |
const environment = process.env.ENVIRONMENT || "dev"; | |
const logger = pino({ | |
transport: { | |
target: "pino-pretty" | |
}, | |
base: { | |
pid: environment.toUpperCase() |
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 arr = [1,2,3,4]; | |
const splitedArrItems = []; | |
const splitIdx = 2; | |
const indice = arr.length/splitIdx; | |
for (let i = 0; i < indice; i++) { | |
splitedArrItems.push(arr.splice(0, splitIdx)); | |
} |
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 flags = { | |
visa: /^4\d{12}(\d{3})?$/gm, | |
mastercard: /^(5[1-5]\d{4}|677189)\d{10}$/gm, | |
diners: /^3(0[0-5]|[68]\d)\d{11}$/gm, | |
discover: /^6(?:011|5[0-9]{2})[0-9]{12}$/gm, | |
elo:/^(?:401178|401179|431274|438935|451416|457393|457631|457632|504175|627780|636297|636368|655000|655001|651652|651653|651654|650485|650486|650487|650488|506699|5067[0-6][0-9]|50677[0-8]|509\d{3})\d{10}$/gm, | |
amex: /^3[47]\d{13}$/gm, | |
jcb:/^(?:2131|1800|35\d{3})\d{11}$/gm, | |
aura: /^(5078\d{2})(\d{2})(\d{11})$/gm, | |
hipercard:/^(606282\d{10}(\d{3})?)|(3841\d{15})$/gm, |
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
let response = pm.response.json(); | |
let token = response.token | |
console.log('token ->', token) | |
pm.environment.set("token",token); |
OlderNewer