Skip to content

Instantly share code, notes, and snippets.

View cdsaenz's full-sized avatar

charly cdsaenz

View GitHub Profile
@Crocoblock
Crocoblock / js.md
Last active July 1, 2025 08:01
JetSmartFilters API

Init event

document.addEventListener( 'jet-smart-filters/inited', function( initEvent ) {      
	console.log( 'filters init' );
} );

JetSmartFilters

@MrPunyapal
MrPunyapal / ExportCSV.php
Last active December 31, 2023 07:29
PHP Function to Export Products as CSV (without saving it in server)
<?php
function exportCSV()
{
header('Content-type: text/csv');
header('Content-Disposition: attachment; filename=products.csv');
header('Pragma: no-cache');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Expires: 0');
@ParthaDhar
ParthaDhar / changephp.sh
Last active April 25, 2024 17:37 — forked from qadirpervez/changephp.sh
change php version in cli and for apache
## Switch php version php-cli and in apache
echo
echo -e "\033[1;31m PHP Version changer Switcher\e[0m"
echo
echo -e "\033[0;33m PHP version currently active in your '/cli': \033[0;35m`sudo php -v | head -n 1 | cut -c 1-10` \e[0m" # Checking running php version
sudo sudo service apache2 stop &>- # Stopping lampp stack if running
echo
echo -e "\033[0;31m versions that you have installed:\e[0m"
ls -ldt /etc/php/* | awk '{print $9}'
echo
@dannanelli
dannanelli / Multiple-Service-Schema.jsonld
Last active February 29, 2024 14:33
Multiple Service Schema Example Template for Local SEO
<script type="application/ld+json">
{
"@context": "https://schema.org/",
"@type": "Service",
"serviceType": "{{SERVICE TYPE}}",
"provider": {
"@type": "LocalBusiness",
"name": "{{BUSINESS NAME}}"
},
"areaServed": {
@robertainslie
robertainslie / submit-to-hubspot-forms-api-with-javascript.md
Last active June 20, 2025 08:31
Submitting to the HubSpot Forms API with JavaScript

Overview

This tutorial will walk you through how to submit to the HubSpot Forms API using Javascript. Check out the documentation for submitting to the Forms API.

  • It will use vanilla JS (i.e. no libraries or frameworks) and will provide example code.
  • It will assume that you are familiar with HubSpot, HubSpot Forms, and that the HubSpot Tracking Code is on the page.

A note on the HubSpot cookie: hubspotutk

The HubSpot tracking code is a javascript snippet that is placed on websites. It anonymously collects website visit data, similar to Google Analytics. This anonymous visit data can be associated to HubSpot Contact record through a few means, including sending a usertoken value when submitting data to the Forms API. The tracking code generates a cookie containing a unique usertoken called hubspotutk. The value of hubspotutk will be submitted in our form submission as hutk. HubSpot uses this cookie value to connect visito

@charafmrah
charafmrah / loading-spinner.css
Last active February 12, 2023 03:24
Animated loading spinner
.spinner {
border: 4px solid #f3f3f3;
border-top: 4px solid #3498db;
border-radius: 50%;
width: 50px;
height: 50px;
animation: spin 0.8s linear infinite;
}
@keyframes spin {
@michaelbeil
michaelbeil / my-pmpro-change-admin-email.php
Created November 1, 2022 19:18 — forked from andrewlimaza/my-pmpro-change-admin-email.php
Change the admin email for all Paid Memberships Pro admin emails.
<?php
/**
* Change the email address for all admin related emails in Paid Memberships Pro.
* Follow this guide to add custom code to your WordPress site - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmpro_change_admin_to_email( $user_email, $email ){
if( strpos( $email->template, "_admin" ) !== false ) {
$user_email = '[email protected]';
}
@Niq1982
Niq1982 / card.php
Last active June 15, 2025 01:18
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>
<?php
/**
* Proptotype
*/
namespace DoggieRescue\Notices;
class AdminNotice {
public static function process_messages() {
$notice = self::get_admin_message();
if ( ! empty( $notice ) && is_array( $notice ) ) {
@iosifnicolae2
iosifnicolae2 / index.html
Last active April 15, 2024 02:26
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;