Skip to content

Instantly share code, notes, and snippets.

View cdsaenz's full-sized avatar

charly cdsaenz

View GitHub Profile
@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 = "[email protected]"
$Password = "mysmtp-sender-password"
$EmailTo = "[email protected]"
$EmailFrom = "[email protected]"
$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
@cdsaenz
cdsaenz / home-slides.php
Created March 28, 2023 18:59
Home Sliders for WordPress, work in progress
<?php
/**
* Home Slides
* CSDev
*/
namespace CSDev;
?>