Skip to content

Instantly share code, notes, and snippets.

View alangabrielbs's full-sized avatar
🇧🇷
JS/TS | ReactJS | NextJS

Alan Gabriel alangabrielbs

🇧🇷
JS/TS | ReactJS | NextJS
View GitHub Profile
@alangabrielbs
alangabrielbs / script.js
Created July 31, 2021 17:38
testando conhecimento
// Converta o array "wrongDataFormat" para o objeto do comentário abaixo.
const wrongDataFormat = [
'preto-PP',
'preto-M',
'preto-G',
'preto-GG',
'preto-GG',
'branco-PP',
'branco-G',
@alangabrielbs
alangabrielbs / select.html
Created June 8, 2020 13:00
<select> com todos os estados brasileiros
<select id="estado" name="estado">
<option value="AC">Acre</option>
<option value="AL">Alagoas</option>
<option value="AP">Amapá</option>
<option value="AM">Amazonas</option>
<option value="BA">Bahia</option>
<option value="CE">Ceará</option>
<option value="DF">Distrito Federal</option>
<option value="ES">Espírito Santo</option>
<option value="GO">Goiás</option>
import axios from 'axios';
import { getToken } from '~/services/auth';
const api = axios.create({
baseURL: `${process.env.REACT_APP_API}`,
});
api.interceptors.request.use(async config => {
const token = getToken();
if (token) {
{
"workbench.startupEditor": "newUntitledFile",
"workbench.colorTheme": "Omni",
"editor.fontSize": 14,
"editor.lineHeight": 25,
"editor.tabSize": 2,
"window.zoomLevel": 0,
"editor.fontFamily": "Fira code, IBM Plex Mono, Monaco, 'Courier New', monospace",
"editor.fontLigatures": true,
"explorer.compactFolders": false,
@alangabrielbs
alangabrielbs / masks.js
Last active May 20, 2022 16:11
masks js
export const cpfMask = (value) => {
return value
.toString()
.replace(/\D/g, '')
.replace(/(\d{3})(\d)/, '$1.$2')
.replace(/(\d{3})(\d)/, '$1.$2')
.replace(/(\d{3})(\d{1,2})/, '$1-$2')
.replace(/(-\d{2})\d+?$/, '$1')
}