Skip to content

Instantly share code, notes, and snippets.

View DayvitSiqueira's full-sized avatar
💻
Coding

Dayvit Siqueira DayvitSiqueira

💻
Coding
View GitHub Profile
@DayvitSiqueira
DayvitSiqueira / .zshrc
Last active August 13, 2022 19:54
My ZSH RC
# 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
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;
"scripts": {
"dev": "ts-node-dev --transpile-only --ignore-watch node_modules --respawn src/server.ts"
},
@DayvitSiqueira
DayvitSiqueira / .eslintrc.json
Last active January 17, 2022 19:19
My .eslintrc.json
{
"env": {
"es2020": true,
//"es2021": true,
"node": true,
"jest": true
},
"extends": [
"airbnb-base",
"plugin:@typescript-eslint/recommended",
FOR REACT NATIVE
root
├── src
│ ├── components
│ │ ├── Header
│ │ ├── ├── index.js
│ │ ├── ├── styles.js
│ │ ├── Card
│ │ ├── ├── index.js
{Array.from({ length: 5 }).map((_, index) => (
<h2>
Item repetido.
</h2>
))}
@DayvitSiqueira
DayvitSiqueira / estados-do-brasil-lista.txt
Last active September 14, 2023 19:18
estados-do-brasil-lista
// Lista
AC, Acre
AL, Alagoas
AP, Amapá
AM, Amazonas
BA, Bahia
CE, Ceará
DF, Distrito Federal
ES, Espirito Santo
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())