Skip to content

Instantly share code, notes, and snippets.

View jasperf's full-sized avatar
🏠
Working from home

Jasper Frumau jasperf

🏠
Working from home
View GitHub Profile
@jasperf
jasperf / functions-v2.php
Last active January 4, 2024 03:53
Short description display count filter for Restaurant for WooCommerce Plugin (v2 is new version)
<?php
add_filter('wc_rms_change_short_desc_disp_count', 'wc_rms_change_short_desc_disp_count_updated', 100, 2);
/**
* Filter callback function for modifying the short description displayed count.
*
* This function is hooked to the 'wc_rms_change_short_desc_disp_count' filter
* and is designed to modify the short description of a WooCommerce product.
*
* @param string $desc The original short description of the product.
* @param object $prod The WooCommerce product object.
@jasperf
jasperf / rm-nm-from-git-versioning.sh
Created December 27, 2023 03:21
Remove node modules from GIt version control
# add node_modules line to .gitignore file
# run this command
git rm -r --cached node_modules
# Now you can commit your repository without node_modules:
git commit -m "Removed node_modules"
# And push your changes:
git push origin master
@jasperf
jasperf / .php-cs-fixer.dist.php
Last active December 16, 2023 03:40
PHP CS Fixer Rules Laravel
<?php
/* https://gist.github.com/laravel-shift/cab527923ed2a109dda047b97d53c200 */
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
'array_syntax' => ['syntax' => 'short'],
@jasperf
jasperf / cors.conf
Created December 7, 2023 08:15
Deal with CORS on Laravel Valet based of off https://rias.be/blog/adding-cors-headers-to-laravel-valet
# You can solve this by creating a file at ~/.config/valet/Nginx/cors.conf that contains the following:
# CORS Rules
add_header Access-Control-Allow-Origin *;
# END of CORS Rules #
@jasperf
jasperf / thinktific-mollie.md
Last active November 27, 2023 03:00
Thinktific Payments via native checkout and Mollie Integration via API or Zapier
awk '($9 ~ /200/) { i++;sum+=$10;max=$10>max?$10:max; } END { printf("Maximum: %d\nAverage: %d\n",max,i?sum/i:0); }' /var/www/vhosts/site.nl/logs/access_ssl_log
// results example:
// Maximum: 1675502
// Average: 12756
@jasperf
jasperf / exclude.js
Created November 15, 2023 04:47
Fancy Product Designer scripts exclusion WP Rocket
// JS Execution Deferral exceptions
/jquery-?[0-9.](.*)(.min|.slim|.slim.min)?.js
/wp-content/plugins/fancy-product-designer/assets/js/fabric.min.js
/wp-content/plugins/fancy-product-designer/assets/js/FancyProductDesigner-all.min.js
/wp-content/plugins/fancy-product-designer/assets/js/frontend.js
/wp-content/plugins/fancy-product-designer/assets/js/frontend-shortcode.js
/wp-content/plugins/fancy-product-designer/assets/js/frontend-woo.js
/wp-content/plugins/fancy-product-designer/assets/js/frontend-woo-variations.js
// Delay exclusion
@jasperf
jasperf / woocommerce_defer_transactional_emails.php
Created November 15, 2023 03:55 — forked from jessepearson/woocommerce_defer_transactional_emails.php
This will turn on deferred transactional emails in WooCommerce. This may help if you are experiencing slow checkouts or checkout timeouts.
<?php // Do not copy this line
/**
* This will turn on deferred transactional emails in WooCommerce. This may help if you
* are experiencing slow checkouts or checkout timeouts.
*/
add_filter( 'woocommerce_defer_transactional_emails', '__return_true' );
@jasperf
jasperf / wp-config.php
Last active November 15, 2023 02:35 — forked from JRyven/wp-config.php
WordPress Debugging Options
// general PHP and WordPress warnings, error messages and status information
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
define( 'WPS_DEBUG', true );
// script and style
define( 'WPS_DEBUG_SCRIPTS', true );
@jasperf
jasperf / andrea-egli-1.css
Last active November 10, 2023 09:34
Elementor Vertical Carousel by Template Monster - https://www.youtube.com/watch?v=MBWP1bRDYN4 and Andrea Egli - https://www.youtube.com/watch?v=i13Az30Kwa8 using CSS Animation . Andrea uses Elementor containers or Flexbox
// 1st Vertical Carousel (left-hand side)
.carouselverticalone {
animation: looping 10s linear 0s infinite none;
}
.verticalcolumnone {
max-height: 750px;
height: 750px;