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 / wget
Created June 29, 2016 01:55 — forked from bueckl/wget
Wget examples
#Spider Websites with Wget – 20 Practical Examples
Wget is extremely powerful, but like with most other command line programs, the plethora of options it supports can be intimidating to new users. Thus what we have here are a collection of wget commands that you can use to accomplish common tasks from downloading single files to mirroring entire websites. It will help if you can read through the wget manual but for the busy souls, these commands are ready to execute.
1. Download a single file from the Internet
wget http://example.com/file.iso
2. Download a file but save it locally under a different name
wget ‐‐output-document=filename.html example.com
@jasperf
jasperf / deploy.sh
Created February 27, 2022 06:33 — forked from cagartner/deploy.sh
Laravel Push deploy Github actions example
#!/bin/sh
set -e
vendor/bin/phpunit
(git push) || true
git checkout production
git merge master
@jasperf
jasperf / memberpress-use-coupon-once-per-user.php
Created February 2, 2022 09:34 — forked from cartpauj/memberpress-use-coupon-once-per-user.php
User cannot use coupon more than once with MemberPress
<?php
function custom_validate_coupon($errors) {
global $wpdb;
//If user is not logged in, then they've never used a coupon before
if(!MeprUtils::is_user_logged_in()) { return $errors; }
$coupon_code = (isset($_POST['mepr_coupon_code']) && !empty($_POST['mepr_coupon_code']))?stripslashes($_POST['mepr_coupon_code']):'';
if(($coupon = MeprCoupon::get_one_from_code($coupon_code)) && isset($coupon->ID) && $coupon->ID) {
@jasperf
jasperf / font-awesome-overwrite.scss
Created December 31, 2021 08:28 — forked from alvesoaj/font-awesome-overwrite.scss
Font Awesome overwrite to set the correct font path in Ruby On Rails and work in Production
/*!
* Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome
* License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)
*/
@import "font-awesome/scss/variables";
/* FONT PATH VARIABLE
* -------------------------- */
$fa-font-path: "font-awesome/fonts/";
/* -------------------------- */
@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 / woocommerce-featured-products.php
Created February 15, 2017 06:39 — forked from Jeff2Ma/woocommerce-featured-products.php
woocommerce featured products
@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