Skip to content

Instantly share code, notes, and snippets.

View irwingb1979's full-sized avatar

Irwin Borjas irwingb1979

View GitHub Profile
@irwingb1979
irwingb1979 / script.js
Last active November 14, 2022 20:55
Async Await - Try Catch
const content = document.querySelector('#content');
async function fetchUsers() {
try {
const users = await fetch('https://jsonplaceholder.typicode.com/users');
const usersJson = await users.json();
console.log(usersJson);
showHtml(usersJson);
}
catch(err) {
@irwingb1979
irwingb1979 / function.php
Created September 8, 2022 10:30
Menu item description wordpress
/* Add description item menu */
add_filter('walker_nav_menu_start_el', 'agregar_descripcion', 10, 4);
function agregar_descripcion($item_output, $item, $depth, $args) {
if( !empty( $item->description ) ) {
return str_replace('</a>' , '<span class="description">' . $item->description . '</span></a>', $item_output);
}
return $item_output;
@irwingb1979
irwingb1979 / info.markdown
Last active August 5, 2019 05:00
Plugin Wordpress - The way to show a short description in the shop page
//Se ejecuta cuando hay un archivo
$('#guardar-registro-archivo').on('submit', function(e) {
e.preventDefault();
var datos = new FormData(this);
// console.log(datos);
$.ajax({
type: $(this).attr('method'),
data: datos,
url: $(this).attr('action'),
<?php
include_once 'funciones/sesiones.php';
include_once 'funciones/funciones.php';
include_once 'templates/header.php';
include_once 'templates/barra.php';
include_once 'templates/sidebar.php';
?>
<!-- Content Wrapper. Contains page content -->
<?php
include_once 'funciones/funciones.php';
$nombre = $_POST['nombre_invitado'];
$apellido = $_POST['apellido_invitado'];
$descripcion = $_POST['descripcion'];
if($_POST['registro'] == 'nuevo') {
// $respuesta = array(
// 'post' => $_POST,
<?php
include_once 'funciones/funciones.php';
$nombre = $_POST['nombre_invitado'];
$apellido = $_POST['apellido_invitado'];
$descripcion = $_POST['descripcion'];
if($_POST['registro'] == 'nuevo') {
// $respuesta = array(
// 'post' => $_POST,
'use strict'
//Js Code Here
// Se debe colocar para que entienda Elementos de ES6
@irwingb1979
irwingb1979 / onmouseover javascript
Created May 1, 2019 17:52
onmouseover javascript
<button id="button" onmouseover="sobreBoton();" onmouseout="afueraBoton()">Button</button>
<script>
function sobreBoton() {
document.getElementById("button").innerHTML = "Welcome";
}
function afueraBoton() {
document.getElementById("button").innerHTML = "Thanks";
}