Skip to content

Instantly share code, notes, and snippets.

@neilgee
neilgee / runcloud-beaver-buster.php
Last active Dec 19, 2021
Purge RunCloud Cache On Extra Beaver Hooks
View runcloud-beaver-buster.php
<?php
/**
* Plugin Name: Runcloud BeaverCache Purge Helper
* Plugin URI: https://gist.github.com/neilgee/4a251b24f65a70849ab122afa6dfac0fp
* Description: Adding additional hooks to trigger RunCloud or lscache plugin purges
* Version: 0.1
* Author: Paul Stoute, Jordan Trask, Jeff Cleverly, Neil Gowran
* Author URI: https://github.com/jordantrizz/cache-purge-helper
* Text Domain: runcloud-beaver-cache-purge-helper
@neilgee
neilgee / 2-col-woo-checkout.css
Last active Dec 4, 2021
WooCommerce 2-column checkout page
View 2-col-woo-checkout.css
/* 2-col WooCommerce Checkout - tested in BB Theme, Generate Press, TwentyTwelve, TwentyThirteen, TwentyFourteen TwentyFifteen, TwentySixteen, TwentySeventeen and TwentyNineteen */
/* TwentyTwenty and TwentyTwentyOne already have this CSS or similar */
@media(min-width:768px) {
.woocommerce .col2-set .col-1,
.woocommerce-page .col2-set .col-1 {
width: 90%;
}
@neilgee
neilgee / icon-canvas.css
Last active Oct 23, 2021
Beaver Builder - Icon Canvas enlarge
View icon-canvas.css
.fl-icon-selector .fl-lightbox {
height: 100%;
width: 100%;
margin-top: 0 !important;
}
@neilgee
neilgee / webhook.php
Last active Sep 3, 2021
WooCommerce Webhook Custom Action Hook
View webhook.php
<?php
/**
* Plugin Name: Woo Custom Webhook
* Plugin URI: https://wpbeaches.com/send-full-product-details-over-woocommerce-webhook-action-hook/
* Description: Custom WooCommerce Webhook Action
* Author URI: https://github.com/woocommerce/woocommerce/issues/20336#issuecomment-829510702
* Version: 0.1.0
*/
View simple-newsletter.html
<div id="wrapper" dir="ltr"
style="background-color: #f5f5f5; margin: 0; -webkit-text-size-adjust: none !important; padding: 3%; width: 94%;">
<table class="wrapper-table" style="margin: auto; max-width: 900px; width: 100%;" border="0" cellspacing="0"
cellpadding="0">
<tbody>
<tr>
<td id="template_header"
style="background-color: #ffffff; border: 1px solid #e5e5e5; padding: 15px; color: #ffffff; font-family: Arial;"
align="center" valign="middle">
<div id="template_header_logo" style="width: 100%;">
@neilgee
neilgee / bricks-container-click.js
Last active May 20, 2021
Bricks Container Click
View bricks-container-click.js
<script>
(function ($) {
$(function () {
clickContainer();
});
@neilgee
neilgee / customizer-new-panel.php
Last active Jun 12, 2021
Customizer Add New Panel
View customizer-new-panel.php
<?php
add_action( 'customize_register', 'bt_register_theme_customizer', 20 );
/**
* Add new panel
* Register for the Customizer
* @since 1.0.0
*/
function bt_register_theme_customizer( $wp_customize ) {
@neilgee
neilgee / cloudflare.cnf
Created Mar 31, 2021
Cloudflare Conf - Fail2Ban
View cloudflare.cnf
#
# Author: Mike Rushton
#
# IMPORTANT
#
# Please set jail.local's permission to 640 because it contains your CF API key.
#
# This action depends on curl (and optionally jq).
# Referenced from http://www.normyee.net/blog/2012/02/02/adding-cloudflare-support-to-fail2ban by NORM YEE
#
@neilgee
neilgee / php-mysql-connect.php
Created Mar 28, 2021
Connecting PHP to MySQL and output data stored in rows from a table
View php-mysql-connect.php
<?php
//Step1
$db = mysqli_connect('localhost','root','root','database_name')
or die('Error connecting to MySQL server.');
?>
<html>
<head>
</head>
@neilgee
neilgee / scripts-ahoy.php
Last active Oct 28, 2021
SwiperJS and ACF Image Gallery Thumbnail Carousel
View scripts-ahoy.php
<?php // <~ don't add me in
add_action( 'wp_enqueue_scripts', 'ls_scripts_styles', 20 );
/**
* SwiperJS Scripts
*/
function ls_scripts_styles() {
wp_enqueue_style( 'swipercssbundle', get_stylesheet_directory_uri() . '/css/swiper-bundle.min.css' , array(), '6.4.11', 'all' );
wp_enqueue_script( 'swiperjsbundle', get_stylesheet_directory_uri() . '/js/swiper-bundle.min.js', array(), '6.4.11', true );
wp_enqueue_script( 'swiperinit', get_stylesheet_directory_uri() . '/js/swiper-bundle-init.js', array( 'swiperjsbundle' ), '1.0.0', true );