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 / jquery-plugin-template.js
Created November 19, 2021 08:47 — forked from publicJorn/jquery-plugin-template.js
jQuery plugin template
/**
* jQuery plugin template by https://github.com/publicJorn
* Features:
* - dynamic plugin name (only supply once) so it's easy to change later
* - plugin factory to make it work in the browser, or with AMD / COMMONJS modules
* - Plugin instance is saved on the selector element
* - Default options are saved to the instance in case you need to figure out a difference between passed options
*/
(function(global, factory) {
'use strict';
@jasperf
jasperf / functions.php
Created February 12, 2021 08:40 — forked from mikejolley/functions.php
woocommerce_flat_rate_shipping_add_rate example for theme functions.php
<?php
add_action( 'woocommerce_flat_rate_shipping_add_rate', 'add_another_custom_flat_rate', 10, 2 );
function add_another_custom_flat_rate( $method, $rate ) {
$new_rate = $rate;
$new_rate['id'] .= ':' . 'next_day'; // Append a custom ID
$new_rate['label'] = 'Next Day'; // Rename to 'Rushed Shipping'
$new_rate['cost'] += 2; // Add $2 to the cost
@jasperf
jasperf / pod.yaml
Created January 10, 2021 23:38 — forked from matthewpalmer/pod.yaml
kubernetes nginx php-fpm pod
# Create a pod containing the PHP-FPM application (my-php-app)
# and nginx, each mounting the `shared-files` volume to their
# respective /var/www/html directories.
kind: Pod
apiVersion: v1
metadata:
name: phpfpm-nginx-example
spec:
volumes:
@jasperf
jasperf / htaccess: Boilerplate
Created October 1, 2020 01:07 — forked from landru247/htaccess: Boilerplate
htaccess: Boilerplate
# BEGIN HTML5 Boilerplate
###
### This contains the HTML5 Boilerplate .htaccess that can be found at:
### https://github.com/h5bp/server-configs/blob/master/apache/.htaccess
###
### Added:
### Block access to WordPress files that reveal version information.
###
### Removed:
@jasperf
jasperf / tabs.php
Created September 18, 2020 02:34 — forked from johnmccole/tabs.php
Add the below file to yourtheme/woocommerce/single-product/tabs/tabs.php. This will update the tabs to be an accordion. Update as required.
<?php
/**
* Single Product tabs
*
* This template can be overridden by copying it to yourtheme/woocommerce/single-product/tabs/tabs.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
@jasperf
jasperf / class-walker-nav-menu.php
Created September 14, 2020 08:27 — forked from ezetojo/class-walker-nav-menu.php
Tailwind Navigation Implementation for Wordpress
<?php
/**
* Nav Menu API: Walker_Nav_Menu class
*
* @package WordPress
* @subpackage Nav_Menus
* @since 4.6.0
*/
/**
@jasperf
jasperf / delete_git_submodule.md
Last active May 31, 2020 06:44 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule <name>"
  • Delete the now untracked submodule files rm -rf path_to_submodule
@jasperf
jasperf / rcWidget.js
Created May 19, 2020 04:34 — forked from milesw/rcWidget.js
rcWidget.js
import 'core-js/es6/array';
import 'core-js/es6/object';
import 'core-js/es6/string';
// Global options
import defaults from './_config';
// general helper functions
import Helper from './_helpers';
// general pricing and currency functions
import Pricing from './_pricing';
// throttle and debounce manager
@jasperf
jasperf / Configurations for Laravel app on Kubernetes - Dockerfile Deploying laravel on kubernetes cluster - Ready to use configuration Files
FROM php:7.2-fpm
COPY app /var/www/
EXPOSE 9000
@jasperf
jasperf / wp-config-debug.php
Created February 19, 2020 06:27 — forked from jrfnl/wp-config-debug.php
Code to add to wp-config.php to enhance information available for debugging.
<?php
/**
* == About this Gist ==
*
* Code to add to wp-config.php to enhance information available for debugging.
*
* You would typically add this code below the database, language and salt settings
*
* Oh.. and *do* make sure you change the path to the log file to a proper file path on your server (make sure it exists).
*