Skip to content

Instantly share code, notes, and snippets.

Jeremy Pry JPry

Block or report user

Report or block JPry

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View jpry.php
<?php
/**
* Plugin Name: JPry local tweaks.
* Plugin URI: https://gist.github.com/JPry/623fbbff1d008f783f2406711e4a6813
* Description: Local development tweaks. Place this in the mu-plugins directory.
* Version: 1.0
* Author: Jeremy Pry
* Author URI: http://jeremypry.com/
* License: MIT
*
@JPry
JPry / no_login_order_payment.php
Created Jun 20, 2019
Code snippet to allow customers to pay for an order without logging in.
View no_login_order_payment.php
<?php
/**
* Allow orders created by an admin to be paid without the user logging in.
*
* @param array $allcaps All capabilities of the user.
* @param array $caps Capabilities requested.
* @param array $args Extra Arguments.
*
@JPry
JPry / recurse-sync.sh
Created Mar 21, 2019
Look for any git repos in the current directory, and run `hub sync` in each one.
View recurse-sync.sh
#!/usr/bin/env bash
set -e
# Ensure we have the `hub` command available.
if ! [[ -x "$(command -v hub)" ]]; then
echo "Error: 'hub' is required"
exit 1
fi
@JPry
JPry / wc-send-coupons-by-email.php
Last active Feb 1, 2019 — forked from woogists/wc-send-coupons-by-email.php
Send coupons used in an order by email
View wc-send-coupons-by-email.php
<?php
/**
* Send an email each time an order with coupon(s) is completed
*
* The email contains coupon(s) used during checkout process
*
* @param int $order_id The ID of the order.
*/
function jp_email_order_coupons( $order_id ) {
View Example.php
<?php
namespace JPry;
use JPry\Exception\InvalidField;
class Example {
/**
* Generate the sub-field objects for this field.
@JPry
JPry / limit_retries.php
Last active Jul 2, 2018
Limit WooCommerce Subscriptions to only 3 payment retries
View limit_retries.php
<?php
add_filter( 'wcs_default_retry_rules', 'jpry_limit_3_retries' );
/**
* Limit the WooCommerce Subscriptions retry system to only 3 retries.
*
* This keeps the existing retry rules, but only the first 3. Everything thereafter
* is discarded.
*
View skip_pending_cancellation.php
<?php
add_action( 'woocommerce_customer_changed_subscription_to_cancelled', 'customer_skip_pending_cancellation' );
/**
* Change 'pending-cancel' status directly to 'cancelled'.
*
* @param WC_Subscription $subscription
*/
function customer_skip_pending_cancellation( $subscription ) {
View LocalValetDriver.php
<?php
// PR #237 broke Valet+ custom drivers, this is a workaround.
if ( ! class_exists( 'WordPressValetDriver' ) ) {
$driverPath = realpath( $_SERVER['HOME'] ) . '/.composer/vendor/weprovide/valet-plus/cli/drivers/WordPressValetDriver.php';
if ( ! is_readable( $driverPath ) ) {
throw new Exception( 'Unable to load the WordPress Valet Driver.' );
}
require_once $driverPath;
View tap_and_draw.md

Tap & Draw

Overview

This is an excellent game for a beginner who is opposing a skilled player. The object of the game is to shuffle your Weights up to the farthest (or, in TARGET shuffleboard, the highest) scoring position on the board, without knocking your Weights, or those of your opponent, off the board.

To start a contest, players decide by toss of coin or other means, who shall shuffle first and which color each shall have. In this fame, it is an advantage to shuffle the first Weight.

Weights are shuffled alternately, until all eight have been shuffled, which completes one round of play, just as in the traditional "Knock-Off" tournament shuffleboard game.

View keybase.md

Keybase proof

I hereby claim:

  • I am jpry on github.
  • I am jpry (https://keybase.io/jpry) on keybase.
  • I have a public key ASCYA6ikM2gFT8hU4zG8FBX7MZSSgIWfPri-eHS-zKm3fwo

To claim this, I am signing this object:

You can’t perform that action at this time.