Skip to content

Instantly share code, notes, and snippets.

View cdsaenz's full-sized avatar

charly cdsaenz

View GitHub Profile
@cdsaenz
cdsaenz / bs5-navwalker.php
Last active April 7, 2024 23:42
Wordpress Bootstrap 5 Nav Walker With Multiple Levels
<?php
/**
* CSDev - Bootstrap 5 wp_nav_menu walker
* Supports WP MultiLevel menus
* Based on https://github.com/AlexWebLab/bootstrap-5-wordpress-navbar-walker
* Requires additional CSS fixes
* CSS at https://gist.github.com/cdsaenz/d401330ba9705cfe7c18b19634c83004
* CHANGE: removed custom display_element. Just call the menu with a $depth of 3 or more.
*/
class bs5_Walker extends Walker_Nav_menu
@cdsaenz
cdsaenz / README.md
Created March 20, 2024 21:04 — forked from AmmarCodes/README.md
WordPress: link to specific elementor tab on a specific page

It's a quick ad-hoc solution to allow you to link to your page to a specific tab from elementor tabs widget.

Here's the catch, you need to replace the id of the specific tab you want to use to not contain the title- part.

Use https://your-website/#elementor-tab-1515

instead of: https://your-website/#elementor-tab-title-1515

@cdsaenz
cdsaenz / index.html
Created August 19, 2022 14:11
Demo Alpine JS and Fetch from Remote API
<!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>Alpine Ajax test</title>
</head>
<body>
<h1>Users API Retrieval Test</h1>
@cdsaenz
cdsaenz / index.html
Created March 6, 2024 12:14 — forked from iosifnicolae2/index.html
Whatsapp Floating Button
<a href="https://wa.me/40123456789?text=hi" style="
position: fixed;
width: 60px;
height: 60px;
bottom: 32px;
right: 33px;
background-color: #25d366;
color: #FFF;
border-radius: 50px;
text-align: center;
@cdsaenz
cdsaenz / bs5-navwalker.css
Last active February 13, 2024 16:37
CSS for bs5-navwalker.php - Wordpress Bootstrap 5 Nav Walker With Multiple Levels
/*PHP Code at https://gist.github.com/cdsaenz/d6d65294d79a0b71b95c55a4bbd47f7d*/
/*version 2: revised for responsive on mobile, dropdown menu will open on hover for now (avoids js) */
.navbar.navbar-expand-lg .dropdown .dropdown-menu .dropdown-submenu {
/* dropdown sub menu positioning */
margin: 0;
left: 100%;
}
.dropdown-menu {
padding: 0;
@cdsaenz
cdsaenz / uploader.js
Created November 3, 2023 23:27
Uploader Handler
/* generic alert on error requires jquery.confirm */
function alert_error(errorMsg) {
$.confirm({
icon: 'fas fa-exclamation-triangle',
type: 'red',
title: 'Error!',
buttons: {'Close': function(){}},
content: errorMsg,
});
@cdsaenz
cdsaenz / sendsmtp.ps1
Created October 24, 2023 22:33
Send SMTP mail via 587 port and a hosting smtp server in Windows (Powershell)
$Username = "mysmtp-sender@mysmtpserver.com"
$Password = "mysmtp-sender-password"
$EmailTo = "willgetthetest@test.com"
$EmailFrom = "mysmtp-sender@mysmtpserver.com"
$Subject = "Test Email Powershell"
$Body = "Test Email content powershell"
$SMTPServer = "mail.mysmtpserver.com"
$SMTPClient = New-Object Net.Mail.SmtpClient
$SMTPClient.Host = $SMTPServer
@cdsaenz
cdsaenz / class-jwt.php
Created September 26, 2023 00:25 — forked from davisshaver/class-jwt.php
WordPress/Coral Project Talk JWT integration
<?php
use \Firebase\JWT\JWT as JWT_Wrapper;
/**
* Class wrapper for JWT tokens.
*/
class JWT {
use Singleton;
@cdsaenz
cdsaenz / endpoint.php
Created September 16, 2023 19:01
My base AlpineJS example with fetch and bootstrap 5
<?php
/**
* Dummy Endpoint
*/
$post = JSONPost();
$quantity = isset($post['quantity']) ? intval($post['quantity']) : 10;
$strings = generateRandomStrings($quantity);
// Set the content type to JSON
@cdsaenz
cdsaenz / mailchimp-curl.php
Created June 16, 2023 16:42 — forked from iloveitaly/mailchimp-curl.php
MailChimp PHP API using CURL
<?php
class Mailchimp_Core {
var $version = "1.3";
var $errorMessage;
var $errorCode;
/**
* Cache the information on the API location on the server
*/