Skip to content

Instantly share code, notes, and snippets.

View fatecitu's full-sized avatar

Prof. Ricardo Leme - Fatec Itu fatecitu

  • Fatec Itu
  • Itu, SP, Brazil
View GitHub Profile
@fatecitu
fatecitu / home.html
Created May 14, 2024 22:09
Exemplo de home
<!--/**
* Copyright 2023 Prof. Ms. Ricardo Leme All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@fatecitu
fatecitu / link para download
Created August 28, 2023 12:55
Estados e Municipios
@fatecitu
fatecitu / formataRG.js
Last active May 24, 2023 01:10
Formatar RG com JS
function formatarRG(campo) {
// Remove caracteres não numéricos
var rg = campo.value.replace(/\D/g, '');
// Adiciona pontos e traço conforme o usuário digita
rg = rg.replace(/(\d{2})(\d)/, '$1.$2');
rg = rg.replace(/(\d{3})(\d)/, '$1.$2');
rg = rg.replace(/(\d{3})(\d{1,2})$/, '$1-$2');
// Verifica se o último dígito é X e adiciona a string de retorno
@fatecitu
fatecitu / erros.js
Created May 10, 2023 00:23
Lista de Erros Firebase
/**
* errors.
* Constante com a tradução em pt-BR dos principais erros de autenticação
**/
const errors = {
'auth/app-deleted': 'O banco de dados não foi localizado.',
'auth/expired-action-code': 'O código da ação o ou link expirou.',
'auth/invalid-action-code': 'O código da ação é inválido. Isso pode acontecer se o código estiver malformado ou já tiver sido usado.',
'auth/user-disabled': 'O usuário correspondente à credencial fornecida foi desativado.',
@fatecitu
fatecitu / cidades.json
Last active October 24, 2022 11:48
Munícipios - Cidades do Brasil em JSON (com latitude e longitude)
[
{
"codigo_ibge" : 5200050,
"nome" : "Abadia de Goiás",
"latitude" : -16.7573,
"longitude" : -49.4412,
"capital" : false,
"codigo_uf" : 52
},
{
@fatecitu
fatecitu / estados.json
Last active October 24, 2022 11:45
Estados - UF - Unidades da Federação em JSON (com latitude e longitude)
[
{
"codigo_uf": 11,
"uf": "RO",
"nome": "Rondônia",
"latitude": -10.83,
"longitude": -63.34
},
{
"codigo_uf": 12,