Skip to content

Instantly share code, notes, and snippets.

View mitchellkrogza's full-sized avatar
🤓
Busy ... Always busy

Mitchell Krog mitchellkrogza

🤓
Busy ... Always busy
View GitHub Profile
@mitchellkrogza
mitchellkrogza / flatsome-accordion-icon
Last active April 25, 2024 03:58
Flatsome Change Accordion Arrow to + sign
/*ACCORDIAN*/
/* Change the Flatsome default accordion Arrow Icon to a + symbol*/
.accordion-title.active{background-color:#006587!important;color:white!important}
.accordion-inner{background-color:#eeeeee!important}
.accordion-title{font-size:100%}
.accordion-inner{padding:10px;font-size:.85em}
.accordion .toggle{top:3px!important;transform-origin: 50% 50%!important;}
.accordion .active .toggle{top:3px!important;}
.accordion-item {margin-bottom: 8px;}
.accordion .icon-angle-down:before{content:"+";}
@mitchellkrogza
mitchellkrogza / get_bot_ip_addresses.py
Created March 24, 2024 12:14 — forked from eliasdabbas/get_bot_ip_addresses.py
Get the most up-to-date list of IP addresses for crawler bots, belonging to Google and Bing.
import ipaddress
import requests
import pandas as pd
def bot_ip_addresses():
bots_urls = {
'google': 'https://developers.google.com/search/apis/ipranges/googlebot.json',
'bing': 'https://www.bing.com/toolbox/bingbot.json'
}
@mitchellkrogza
mitchellkrogza / flatsome-change-sale-button
Created May 15, 2022 11:45
Flatsome theme Change Sale Button Text
add_filter( 'flatsome_product_labels', function ( $text, $post, $product, $badge_style ) {
if ( $product->is_on_sale() ) {
$text = '<div class="badgeonsale callout badge-label"><div class="badge-inneronsale callout-onsale-bg is-small onsale-bubble">ON SALE</div></div>' . $text;
}
return $text;
}, 10, 4 );
@mitchellkrogza
mitchellkrogza / google-recaptcha.php
Created December 6, 2023 05:53 — forked from joshcanhelp/google-recaptcha.php
Add a Google RECAPTCHA and honeypot to a WordPress registration form
<?php
/**
* Adds first and last name to the registration field
*/
function proper_add_user_reg_fields () {
?>
<p class="reg-email-validation">
<label for="confirm_email_address">
@mitchellkrogza
mitchellkrogza / woocommerce-remove-nofollow
Created September 14, 2021 11:31
Woocommerce remove rel="nofollow" from add to cart and select options buttons
/**
* Remove "nofollow" from add to cart / Select options buttons
* What possessed Woocommerce to inplement this we shall never know ?
*/
add_filter( 'woocommerce_loop_add_to_cart_args', 'add_to_cart_args_remove_nofollow' );
function add_to_cart_args_remove_nofollow( $args ) {
unset($args['attributes']['rel']);
return $args;
@mitchellkrogza
mitchellkrogza / maketimelapse.bat
Created May 25, 2023 08:06
Windows Timelapse Making Script
This requires
- ffmpeg.exe binary on your desktop
- video input file named input.mp4
- audio file for timelapse called timelapsemusic.mp3
- your finished timelapse will be called MYTIMELAPSE.mp4
- change the username in cd C:\Users\Username\Desktop to your real username on windows
- Speed up or slow down the timelapse by changing the setpts=PTS/80 to a higher or lower value
- Example setpts=PTS/200 = very fast timelapse
- Example setpts=PTS/50 = slower timelapse
DO NOT COPY ANY OF THE ABOVE LINES INTO YOUR .bat file
@mitchellkrogza
mitchellkrogza / generate-webp-images
Created August 16, 2021 12:07
Generate webp images from png and jpg files recursively in any web folder (uses webp command line tool)
#!/bin/bash
# ---------------------------------------------------------------------------
# Generate WebP Images - Uses cwebp command line tool for Linux
# This will generate / re-generate all webp images for all JPG and PNG files
# Being command line based it is incredibly fast
# If you don't want to re-generate existing files set generateall=0
# If you want to re-generate everything set generateall=1
# USE this script at your own risk and Only if you know what you are doing
# Written by Mitchell Krog - mitchellkrog@gmail.com
@mitchellkrogza
mitchellkrogza / fail2ban-reset-log-db.sh
Last active June 25, 2022 13:36
Bash script to reset Fail2Ban - clears / truncates log file and deletes the sqlite database - stops and restarts service during this process.
#!/bin/bash
# Bash Script by https://gist.github.com/mitchellkrogza
# ************************************************************
# This script clears the log file and database of Fail2Ban
# This resets Fail2Ban to a completely clean state
# Useful to use after you have finished testing all your jails
# and completed your initial setup of Fail2Ban and are now
# putting the server into LIVE mode
# ************************************************************
@mitchellkrogza
mitchellkrogza / woocommerce-change-add-to-cart-button-text
Created March 21, 2022 13:44
Woocommerce Change "Add to Cart" button text
// To change add to cart text on single product page
add_filter( 'woocommerce_product_single_add_to_cart_text', 'woocommerce_custom_single_add_to_cart_text' );
function woocommerce_custom_single_add_to_cart_text() {
return __( 'Buy Now', 'woocommerce' );
}
// To change add to cart text on product archives(Collection) page
add_filter( 'woocommerce_product_add_to_cart_text', 'woocommerce_custom_product_add_to_cart_text' );
function woocommerce_custom_product_add_to_cart_text() {
return __( 'Buy Now', 'woocommerce' );
@mitchellkrogza
mitchellkrogza / woocommerce-wcfm-marketplace-notify-user-product-deletion
Created March 5, 2022 09:31
Woocommerce WCFM Marketplace Notify User of Product Deletion
// ======================================================================================
// Notify user of product deletion
// Applies to any Woocommerce product but was written specifically for WCFM Marketplace
// Copyright Bjorn Patje & Mitchell Krog (thank you Bjorn)
// ======================================================================================
// This sends an email to the owner (user) of a product when it is deleted / trashed
// The email uses simple html formatting and php variables
// Modify the contents of the $body varaible and $subject variable to your liking
// ======================================================================================
add_action( 'delete_post', 'notification_for_product', 99 );