Skip to content

Instantly share code, notes, and snippets.

View JCervantesB's full-sized avatar

Julio Cervantes JCervantesB

View GitHub Profile
@JCervantesB
JCervantesB / appsalon_mvc_php.sql
Created November 14, 2024 18:40
Base de datos AppSalonMVC
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
CREATE TABLE `citas` (
@JCervantesB
JCervantesB / Email.php
Last active November 14, 2024 21:03
Email.php para deployment
<?php
namespace Classes;
use PHPMailer\PHPMailer\PHPMailer;
class Email {
public $email;
public $nombre;
@JCervantesB
JCervantesB / gulpfile.js
Created February 20, 2023 20:58
FestivaMusica
const { src, dest, watch, parallel } = require('gulp');
// css
const sass = require('gulp-sass')(require('sass'));
const plumber = require('gulp-plumber');
// img
const cache = require('gulp-cache');
const imagemin = require('gulp-imagemin');
const webp = require('gulp-webp');
@JCervantesB
JCervantesB / gulpfile.js
Created February 3, 2023 23:14
DevWebCamp
const { src, dest, watch, parallel } = require('gulp');
// CSS
const sass = require('gulp-sass')(require('sass'));
const plumber = require('gulp-plumber');
const autoprefixer = require('autoprefixer');
const cssnano = require('cssnano');
const postcss = require('gulp-postcss');
const sourcemaps = require('gulp-sourcemaps');
@JCervantesB
JCervantesB / AuthController.php
Last active February 2, 2023 15:45
Correo de confirmación Laravel > React
public function olvide(OlvideRequest $request)
{
$data = $request->validated();
$user = User::where('email', $data['email'])->first();
if($user) {
$user->recoveryToken = Str::random(30);
$user->save();
Mail::send('emails.recovery', ['token' => $user->recoveryToken, 'nombre' => $user->name], function ($message) use ($user) {
const productos = [
{
nombre: "Café Caramel con Chocolate",
precio: 59.9,
imagen: "cafe_01",
categoria_id: 1,
id: 1
},
{
nombre: "Café Frio con Chocolate Grande",
@JCervantesB
JCervantesB / Propiedad.php
Last active October 6, 2022 16:06
Bienes Raíces Carmen Bazán
<?php
namespace App;
class Propiedad
{
//Base de datos
protected static $db;
/* protected static $columnasDB = [
Recetas cocteles
https://www.thecocktaildb.com/
Recetas Comidas
https://www.themealdb.com/
https://undraw.co/illustrations?fbclid=IwAR1L5IGumrG6MpeeSdZz7d6iV2wY9LKObizS9qdK21gvwJ5HnbnUAXl8juw
@JCervantesB
JCervantesB / app.js
Last active September 13, 2022 19:20
16-PROYECTO-EnviarEmail
// Variables
const btnEnviar = document.querySelector('#enviar');
const btnReset = document.querySelector('#resetBtn');
const formulario = document.querySelector('#enviar-mail');
// Variables para campos
const email = document.querySelector('#email');
const asunto = document.querySelector('#asunto');
const mensaje = document.querySelector('#mensaje');
const er = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
@JCervantesB
JCervantesB / ActiveRecord.php
Created September 11, 2022 15:10
Método crear
// crea un nuevo registro
public function crear() {
// Sanitizar los datos
$atributos = $this->sanitizarAtributos();
// Insertar en la base de datos
$query = " INSERT INTO " . static::$tabla . " ( ";
$query .= join(', ', array_keys($atributos));
$query .= " ) VALUES ('";
$query .= join("', '", array_values($atributos));