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 / 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 / error.log
Last active August 29, 2023 02:00
WooCommerce & Elementor Warnings on post count and stdClass
Attempt to read property "post_count" on null in wp-content/plugins/woocommerce/includes/widgets/class-wc-widget-price-filter.php on line 80\n 
#stage
Client error on sending request(POST /wp-admin/admin-ajax.php HTTP/2.0); uri(/wp-admin/admin-ajax.php) content-length(219): user_get_body(tmpstackbuf, 16384):
read from client failed, referer: https://stage.domain.com/wp-admin/post.php?post=30578&action=edit
PHP Warning: Undefined array key "data" in /wp-content/plugins/elementor/core/common/modules/ajax/module.php on line 175\n,
referer: https://stage.domain.com/wp-admin/admin.php?page=elementor-app&ver=3.15.3
PHP Warning: Undefined property: stdClass::$status_id in /wp-content/plugins/sitepress-multilingual-cms/classes/ATE/class-wpml-tm-ate.php on line 57\n,
referer: https://stage.domain.com/wp-admin/edit.php?s&post_status=all&post_type=product&action=-1&lang=en&product_cat=marble&product_type&stock_status&filter_action=Filter&paged=1&action2=-1
PHP Warning: Undefined property: stdClass::$status_id in /
@jasperf
jasperf / custom-wp-registration-url.php
Last active August 28, 2023 01:51
Change WordPress regisration url with a url to a page of your choosing. Useful when you have a custom registration form
<?php
/*
* Custom registration url using WordPress register url filter
* See https://wordpress.stackexchange.com/questions/127636/change-register-url-on-wp-login-page
*/
add_filter( 'register_url', 'custom_register_url' );
function custom_register_url( $register_url )
{
$register_url = get_permalink( $register_page_id = [REPLACE WITH YOUR PAGE ID HERE] );
return $register_url;
@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() ) ) {
@jasperf
jasperf / gist:8b0ff27e858eecf5c323c082dc3b3f9e
Created April 25, 2023 04:30
run WP CLI via older / other PHP version
php7.4 /usr/local/bin/wp search-replace 'site.com' 'site.io' --skip-columns=guid --dry-run
@jasperf
jasperf / docker-laravel-w-redis-mysql-traefik-horizon.md
Last active March 18, 2023 04:01
Laravel App in Docker with Traefik, Redis, Horizon and MySQL

docker-composer.yml:

version: '3'

services:
  app:
    build:
      context: .
      dockerfile: Dockerfile
@jasperf
jasperf / vue-tinymce-inertia-edit-save.md
Last active March 18, 2023 03:41
Vue TinyMCE Component using Inertia to store and load data firing Laravel Controller / Laravel route

npm install tinymce @tinymce/tinymce-vue

Vue component

<template>
  <div>
    <editor v-model="content" :init="tinymceConfig" />
  </div>
</template>
<script setup>
import AppLayout from '@/Layouts/AppLayout.vue';
import Editor from '@tinymce/tinymce-vue';
import { reactive,onMounted } from 'vue';
import { router } from '@inertiajs/vue3';
import PrimaryButton from '@/Components/PrimaryButton.vue';
// Import TinyMCE
import tinymce from 'tinymce/tinymce';