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 / jquery01.html
Created September 19, 2019 17:51
Jquery Tutorial #1 Mostrar y Ocultar DIV con animación
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Tutorial jQuery Remasterizado</title>
<script src="http://code.jquery.com/jquery-1.8.0.min.js"></script>
<script>
var pagina = $(document);
pagina.on("ready", animar);
function showMessage(message){
const processDiv = document.getElementById('process');
processDiv.innerHTML = message;
processDiv.style.display = 'block';
}
function hideMessage() {
const processDiv = document.getElementById('process');
processDiv.style.display = 'none';
}
@porfidev
porfidev / index.html
Last active March 9, 2019 01:05
Tutorial para mostrar imagenes en el navegador a partir de un input file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Image Review</title>
<link href="styles.css" rel="stylesheet" />
</head>
<body>
<div class="main-container">
<div class="input-container">
@porfidev
porfidev / Constantes.php
Last active January 28, 2021 22:01
PHPMailer Tutorial 2019
<?php
define('EMAIL_SENDER', '[email protected]');
define('EMAIL_PASSWORD', 'your-secret-password');
@porfidev
porfidev / react-input-to-state.js
Last active September 14, 2020 11:15
React - Any form value to state
import React, { Component } from "react";
import "./App.css";
class App extends Component {
state = {
nombre: "",
email: "",
esAdmin: "",
genero: "",
color: "",
<?php
$name = "file-" . time();
$myfile = fopen($name, "w")
?>
@porfidev
porfidev / 02-getList.es6
Last active February 13, 2018 17:22
Javascript ES6 Util Codes
let langSentence = 'Estos son los lenguajes requeridos: Javascript, PHP, Java, Python.';
// Inicio y fin de busqueda
let startSearch = langSentence.indexOf(':');
let endSearch = langSentence.indexOf('.', startSearch + 1);
// Obtener el texto despujes del inicio y fin
let langString = langSentence.substring(startSearch + 1, endSearch);
// Convertir cada elemento separado por coma en un elemento del arreglo
@porfidev
porfidev / abstract_factory_GameMaker.ts
Created January 16, 2018 18:33
Fábrica Abstracta para Typescript
import {PS4GameFactory, XBOXGameFactory} from "./factory_clases";
export class GameMaker {
public constructor() {
const ps4Game = new PS4GameFactory();
this.tester(ps4Game);
const xboxGame = new XBOXGameFactory();
this.tester(xboxGame);
}
@porfidev
porfidev / background-changer.js
Created January 2, 2018 01:47
Cambiar imagen de fondo con las obtenidas de un folder cada determinado tiempo
var folder = "images/";
var availableImages = [];
var time = 4000;
// Ejecutar un AJAX a un folder con las imágenes
// Importante que sea de acceso publico y sin un index.
$(document).ready(function () {
$.ajax({
url: folder,
success: function (data) {
@porfidev
porfidev / regexp.js
Created November 28, 2017 23:16
Expresiones REgulares Cheat Sheet
/** Declaración de expresiones regulares **/
var regexp = new RegExp('abc'); // Objeto
var regexp2 = /abc/; // Literales
/** Encontrar al menos un carácter en la lista **/
var regexp3 = /[0123456789]/;
var regexp3alter = /[0-9]/;
/** GUIA RAPIDA DE ATAJOS