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
# If you come from bash you might have to change your $PATH. | |
# export PATH=$HOME/bin:/usr/local/bin:$PATH | |
# Path to your oh-my-zsh installation. | |
export ZSH="$HOME/.oh-my-zsh" | |
# Set name of the theme to load --- if set to "random", it will | |
# load a random theme each time oh-my-zsh is loaded, in which case, | |
# to know which specific one was loaded, run: echo $RANDOM_THEME | |
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes |
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 validaCpfCnpj(val) { | |
if (val.length == 14) { | |
var cpf = val.trim(); | |
cpf = cpf.replace(/\./g, ''); | |
cpf = cpf.replace('-', ''); | |
cpf = cpf.split(''); | |
var v1 = 0; | |
var v2 = 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
"scripts": { | |
"dev": "ts-node-dev --transpile-only --ignore-watch node_modules --respawn src/server.ts" | |
}, |
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
Show hidden characters
{ | |
"env": { | |
"es2020": true, | |
//"es2021": true, | |
"node": true, | |
"jest": true | |
}, | |
"extends": [ | |
"airbnb-base", | |
"plugin:@typescript-eslint/recommended", |
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
FOR REACT NATIVE | |
root | |
├── src | |
│ ├── components | |
│ │ ├── Header | |
│ │ ├── ├── index.js | |
│ │ ├── ├── styles.js | |
│ │ ├── Card | |
│ │ ├── ├── index.js |
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
{Array.from({ length: 5 }).map((_, index) => ( | |
<h2> | |
Item repetido. | |
</h2> | |
))} |
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
// Lista | |
AC, Acre | |
AL, Alagoas | |
AP, Amapá | |
AM, Amazonas | |
BA, Bahia | |
CE, Ceará | |
DF, Distrito Federal | |
ES, Espirito Santo |
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 options = { year: "numeric", month: "long", day: "numeric" }; | |
const date = new Date(2020, 11, 31) // 2020-12-31T03:00:00.000Z | |
console.log(date.toLocaleDateString("pt-br", options)) | |
// 31 de dezembro de 2020 | |
console.log(date.toLocaleDateString("pt-br", { ...options, month: 'numeric'})) | |
// 31/12/2020 | |
const regex = /^([0-9]{4})[-](0[1-9]|1[0-2])[-](0[0-9]|1[0-9]|2[0-9]|3[0-1])/gm | |
const dateRx = new Date(2020, 11, 31) // 2020-12-31T03:00:00.000Z | |
const [full, year, month, day] = regex.exec(dateRx.toISOString()) |