Skip to content

Instantly share code, notes, and snippets.

View elialejandro's full-sized avatar
😋
Be happy

Eli Alejandro elialejandro

😋
Be happy
  • Chiapas
View GitHub Profile
@elialejandro
elialejandro / index.html
Created September 26, 2019 17:29
Demo, Vue + Axios
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<div id="app">
{
"nombreApp" : "Componentes",
"rutas" : [
{
"ruta" : "alert",
"icon" : "add_alert",
"texto": "Alertas"
}
]
}
<?php
// Application/Entity/AuthUser.php
namespace Application\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
*/
@elialejandro
elialejandro / AuthController.php
Last active August 5, 2018 02:42
Example Zend Form and Ajax
<?php
namespace Application\Controller;
use Application\Form\LoginForm;
use Zend\Authentication\AuthenticationService;
use Zend\Mvc\Controller\AbstractActionController;
use Zend\View\Model\JsonModel;
use ZF\ApiProblem\ApiProblem;
use ZF\ApiProblem\ApiProblemResponse;
<!doctype html>
<html lang="es">
<head>
<meta charset="utf-8">
<title>Angular</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
<?php
include 'connect.php';
if (isset($_POST['add'])) {
$studentId = $_POST['studentId'];
$firstname = $_POST['firstname'];
$middlename = $_POST['middlename'];
$lastname = $_POST['lastname'];
$contactnumber = $_POST['contactnumber'];
@elialejandro
elialejandro / AutoinstallMYSQL.sh
Last active July 7, 2020 17:08
MySQL 5.7 No directory, logging in with HOME=/
# Install MySQL
mysql_config_file="/etc/mysql/my.cnf"
echo "mysql-server mysql-server/root_password password secret" | sudo debconf-set-selections
echo "mysql-server mysql-server/root_password_again password secret" | sudo debconf-set-selections
apt-get -y install mysql-client mysql-server
sed -i "s/bind-address\s*=\s*127.0.0.1/bind-address = 0.0.0.0/" ${mysql_config_file}
usermod -d /var/lib/mysql/ mysql
@elialejandro
elialejandro / JwtAuth.php
Last active October 10, 2017 01:48
JwtAuth para Symfony usando características de PHP 5.5 o superior
<?php
namespace AppBundle\Services;
use Doctrine\ORM\EntityManagerInterface;
use Firebase\JWT\JWT;
class JwtAuth
{
protected $em;
<?php
//IMAGEN EN FORMATO PNG
$image = imagecreatefromstring(base64_decode("iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAEYSURBVBgZBcHPio5hGAfg6/2+R980k6wmJgsJ5U/ZOAqbSc2GnXOwUg7BESgLUeIQ1GSjLFnMwsKGGg1qxJRmPM97/1zXFAAAAEADdlfZzr26miup2svnelq7d2aYgt3rebl585wN6+K3I1/9fJe7O/uIePP2SypJkiRJ0vMhr55FLCA3zgIAOK9uQ4MS361ZOSX+OrTvkgINSjS/HIvhjxNNFGgQsbSmabohKDNoUGLohsls6BaiQIMSs2FYmnXdUsygQYmumy3Nhi6igwalDEOJEjPKP7CA2aFNK8Bkyy3fdNCg7r9/fW3jgpVJbDmy5+PB2IYp4MXFelQ7izPrhkPHB+P5/PjhD5gCgCenx+VR/dODEwD+A3T7nqbxwf1HAAAAAElFTkSuQmCC"));
imagepng($image, "prueba.png");