Skip to content

Instantly share code, notes, and snippets.

View cdsaenz's full-sized avatar

charly cdsaenz

View GitHub Profile
@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 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 / 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
*/
@cdsaenz
cdsaenz / blog-infinity.php
Last active May 15, 2023 17:10
WordPress Template for JavaScript Blog Articles Load with Infinity Scroll
<?php
/**
* Template Name: Blog Infinity
* CSDev
* Assign to a page called "Blog" or something
* Requires Bootstrap 5 but can be easily refactored to your Stylesheet
*/
add_action('wp_head', function () {
@cdsaenz
cdsaenz / card.php
Created May 13, 2023 21:31 — forked from Niq1982/card.php
Load more to WordPress blog archive using AlpineJS and Axios
<div class="card">
<?php if ($args['link']) : ?>
<a href="<?php echo esc_url($args['link']); ?>" class="global-link">
</a>
<?php endif; ?>
<div class="card-image">
<?php wp_get_attachment_image($args['image']); ?>
</div>
@cdsaenz
cdsaenz / functions.php
Last active April 22, 2023 16:47
WP Mail using authenticated SMTP without a plugin
<?php
use PHPMailer\PHPMailer\PHPMailer;
// Set up SMTP settings
add_action( 'phpmailer_init', 'wpse_phpmailer_init' );
function wpse_phpmailer_init( PHPMailer $mailer ) {
$mailer->isSMTP();
$mailer->Host = ''; // replace with your SMTP server hostname