Skip to content

Instantly share code, notes, and snippets.

View JCervantesB's full-sized avatar

Julio Cervantes JCervantesB

View GitHub Profile
@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));
@JCervantesB
JCervantesB / style.css
Created August 24, 2022 14:44
Style.css de Aitor
:root{
--fuenteHeading: 'PT Sans', sans-serif;
--fuenteParrafos: 'Open Sans', sans-serif
--primario: #784d3c;
--blanco: #ffffff;
--negro: #000000;
}
@JCervantesB
JCervantesB / index.html
Created August 16, 2022 19:23
index.html Proyecto Calculadora de Propinas JS Moderno
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Calculadora de Propinas y Consumos</title>
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/app.css">