Skip to content

Instantly share code, notes, and snippets.

View porfidev's full-sized avatar
⚛️
Now coding react-native

Porfirio Chávez porfidev

⚛️
Now coding react-native
View GitHub Profile
@porfidev
porfidev / stateIsoToStateName.js
Last active November 29, 2019 18:43
Javascript ISO códigos de estados de México a Nombre. Este funciona con código ISO completo 'MX-XYZ' o código de tres letras 'XYZ' (referencia de códigos de: https://www.iso.org/obp/ui/#iso:code:3166:MX)
const isoStatesCodes = [
{
code: 'MX-AGU',
name: 'Aguascalientes',
},
{
code: 'MX-BCN',
name: 'Baja California',
},
{
@porfidev
porfidev / SkeletonLocationLoader.js
Created March 5, 2020 20:00
Tried and react-native component but it fails because consume a lot of resources.
import React from 'react';
import { View } from 'react-native';
import LinearGradient from 'react-native-linear-gradient';
class SkeletonLocationLoader extends React.Component {
constructor(props) {
super(props);
this.state = {
backgroundColor: '#F1F1F1',
highlightColor: '#FFF',
@porfidev
porfidev / covid-19-Mexico_app_covid-api.js
Created March 27, 2020 03:38
Gráfica con Datos del Coronavirus COVID-19 en México - #Javacript #Plotly #API
export const STATUS = {
CONFIRMED: 'confirmed',
DEATHS: 'deaths',
RECOVERED: 'recovered',
};
class CovidApi {
constructor() {
this.baseUrl = 'https://api.covid19api.com';
this.country = {
@porfidev
porfidev / map-image-menu_index.html
Created September 24, 2020 17:25
Display slide menu
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Image Map</title>
<link href="styles.css" rel="stylesheet" />
</head>
<body>
<div class="container">
<div class="hover"></div>
@porfidev
porfidev / react-simple.html
Created March 4, 2021 06:49
Como integrar React.js 17 en cualquier Webpage
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>React en 1 minuto</title>
</head>
<body>
<div id="root"></div>
<script
@porfidev
porfidev / ejemplo.html
Created March 4, 2021 23:07
React component example whit high cost
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8" />
<title>React.js Optimization</title>
</head>
<body>
<div id="root"></div>
<script
src="https://unpkg.com/react@17/umd/react.development.js"
@porfidev
porfidev / machine.js
Last active May 4, 2022 23:03
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@porfidev
porfidev / prueba-react-01.html
Created July 30, 2022 17:06
Cambiar el estado de un texto y aumentar el contador de cambios con un efecto en React.js
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>porfi.dev React JS | Prueba 01</title>
</head>
<body>
<div id="app_container"></div>
@porfidev
porfidev / prueba-react-02.html
Created July 31, 2022 17:02
Actualizar el valor del padre desde el hijo con componentes de clase
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>porfi.dev React JS | Prueba 02</title>
<style>
.TabStrip {
display: flex;
flex-direction: row;
}
@porfidev
porfidev / uploadURLFILes.html
Created December 6, 2022 03:54
How to Upload image to Firebase Storage from URL
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Upload URL FILES</title>
</head>
<body>
<script type="module">
// Import the functions you need from the SDKs you need