Skip to content

Instantly share code, notes, and snippets.

Avatar
⚛️
Now coding react-native

Porfirio Chávez porfidev

⚛️
Now coding react-native
View GitHub Profile
@porfidev
porfidev / ejemplo.html
Created Mar 4, 2021
React component example whit high cost
View ejemplo.html
<!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 / react-simple.html
Created Mar 4, 2021
Como integrar React.js 17 en cualquier Webpage
View react-simple.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>React en 1 minuto</title>
</head>
<body>
<div id="root"></div>
<script
View map-image-menu_index.html
<!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 / covid-19-Mexico_app_covid-api.js
Created Mar 27, 2020
Gráfica con Datos del Coronavirus COVID-19 en México - #Javacript #Plotly #API
View covid-19-Mexico_app_covid-api.js
export const STATUS = {
CONFIRMED: 'confirmed',
DEATHS: 'deaths',
RECOVERED: 'recovered',
};
class CovidApi {
constructor() {
this.baseUrl = 'https://api.covid19api.com';
this.country = {
@porfidev
porfidev / SkeletonLocationLoader.js
Created Mar 5, 2020
Tried and react-native component but it fails because consume a lot of resources.
View SkeletonLocationLoader.js
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 / stateIsoToStateName.js
Last active Nov 29, 2019
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)
View stateIsoToStateName.js
const isoStatesCodes = [
{
code: 'MX-AGU',
name: 'Aguascalientes',
},
{
code: 'MX-BCN',
name: 'Baja California',
},
{
@porfidev
porfidev / tutorial-cambio-imagenes_index.html
Last active Nov 24, 2019
jQuery Tutorial #5 👍Como cambiar la imagen de fondo
View tutorial-cambio-imagenes_index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Full Height Background Image | elporfirio.com</title>
<style>
body, html {
height: 100%;
margin: 0;
}
View tutorial-formato-numeros.js
import React from "react";
import "./App.css";
function FormatNumber({ number }) {
return (
<span style={{ color: "red" }}>
{new Intl.NumberFormat("ES-MX", {
style: "currency",
currency: "MXN"
}).format(number)}
@porfidev
porfidev / httpPostRequest.php
Created Oct 17, 2019
Peticiones HTTP post sin Curl
View httpPostRequest.php
<?php
include('vendor/rmccue/requests/library/Requests.php');
Requests::register_autoloader();
$url = 'https://jsonplaceholder.typicode.com/posts';
$postData = array([
'title' => 'Hola Mundo',
@porfidev
porfidev / httpGetRequest.php
Created Oct 17, 2019
Peticiones HTTP get sin Curl
View httpGetRequest.php
<?php
include('vendor/rmccue/requests/library/Requests.php');
Requests::register_autoloader();
$url = 'https://jsonplaceholder.typicode.com/posts';
$response = Requests::get($url);