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 / 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;
@jasperf
jasperf / element or-gallery-columns-mobile.css
Created November 1, 2023 02:00
Elementor gallery custom column number for mobile
@jasperf
jasperf / elementor-swiper-slider.md
Last active October 27, 2023 07:53
Elementor Slider Pro with Swiper Slider issues using background images using CSS instead of HTML

See Swiper Slider Lazy Loading example. The Elementor Slider Widget Pro uses Swiper and basic setup uses background images with CSS [link]. They do not use HTML tags like <div> or <img> with src, data-src or srcset . To use lazy loading HTML markup has to be changed as shown in example.

With this HTML markup that we could also use Imagify to load webP images when possible using swapping with JavaScript. Unfortunately this is not possible with the current setup of Elementor Slider Pro.

@jasperf
jasperf / gif2mp4.hs
Last active October 26, 2023 01:29
Animated .gif conversion to mp4 that also works on Quicktime . Size chosen here is 500 by 250
ffmpeg -i animated.gif -s 500x250 -pix_fmt yuv420p video-500x250-qt.mp4
@jasperf
jasperf / gist:c01ea8e693f80df21de67cd5b1402bc5
Created September 28, 2023 23:39
Plesk Obsidian Firewall Rules
#!/bin/bash
#ATTENTION!
#
#DO NOT MODIFY THIS FILE BECAUSE IT WAS GENERATED AUTOMATICALLY,
#SO ALL YOUR CHANGES WILL BE LOST THE NEXT TIME THE FILE IS GENERATED.
set -e
([ -f /var/lock/subsys/ipchains ] && /etc/init.d/ipchains stop) >/dev/null 2>&1 || true
(rmmod ipchains) >/dev/null 2>&1 || true
@jasperf
jasperf / mysql-backup-db.sh
Last active September 27, 2023 00:47
Backup your site's files using tar and gzip from the command line. #tar #gzip #backup
# backup database
mysqldump --opt --user=user --password=password --host=host.com database > file-dd-mm-yy.sql
@jasperf
jasperf / bitbucket-pipelines.yml
Created October 19, 2021 05:00
Bitbucket pipeline WordPress Site
image: thenatives/ci-php-yarn:1.0
pipelines:
branches:
develop:
- step:
name: Deploy Development
deployment: test
caches:
@jasperf
jasperf / du.sh
Last active September 19, 2023 01:23
Size of a directory using `du` and `find`, free space on hdd using `df` . Also inodes check for when you deal with inodes limitation in DirectAdmin or Plesk
du -sh site.com/
# https://www.cyberciti.biz/faq/how-do-i-find-the-largest-filesdirectories-on-a-linuxunixbsd-filesystem/
du -a /var | sort -n -r | head -n 10
# check available space
dh -h /
# example
# forge@staging:~/staging.site.com/current$ df -h /
# Filesystem Size Used Avail Use% Mounted on
# /dev/vda1 49G 23G 26G 47% /
@jasperf
jasperf / dynamic-link-with-product-title.php
Last active September 14, 2023 04:43
Create button shortcode with link containing WooCommerce product slug or product title. Slug used by default here
@jasperf
jasperf / append-acf-field-after-product-title.php
Last active September 5, 2023 00:34
Append an ACF field after WooCommerce Product title for specific pages
<?php
/**
* This solutions uses WooCommerce's built in `woocommerce_after_shop_loop_item_title`
* action to load the ACF field after the shop loop item title
*
* Much less memory intense than initial solution than direct title manipulation
*/
function add_custom_text_after_product_title_single() {
if ( ( is_front_page() || is_shop() ) ) {