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 / 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 / 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 / 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 / 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 / tutorial-cambio-imagenes_index.html
Last active November 24, 2019 06:54
jQuery Tutorial #5 👍Como cambiar la imagen de fondo
<!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;
}
@porfidev
porfidev / tutorial-formato-numeros.js
Created October 25, 2019 15:38
Complemento para el tutorial del video https://youtu.be/xcFBSCcMfbc
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 October 17, 2019 22:08
Peticiones HTTP post sin Curl
<?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 October 17, 2019 22:01
Peticiones HTTP get sin Curl
<?php
include('vendor/rmccue/requests/library/Requests.php');
Requests::register_autoloader();
$url = 'https://jsonplaceholder.typicode.com/posts';
$response = Requests::get($url);
@porfidev
porfidev / sumar-radio-button-javascript.html
Created October 4, 2019 16:46
Como sumar los radio buttons de un formulario con Javascript en 2019
<html>
<head>
<title>CAFETERIA</title>
<meta charset="utf-8" />
<style>
body {
background-color: #e1e637;
}
h1 {
color: #ff090e;
@porfidev
porfidev / index.html
Created September 19, 2019 18:14
Refactor de tutorial #1 Mostrar y Ocultar Divs
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Tutorial jQuery Remasterizado</title>
<link href="style.css" rel="stylesheet">
</head>
<body>
<button id="showContainer" type="button">Mostrar mensaje</button>
<button id="hideContainer" type="button">Ocultar mensaje</button>