Skip to content

Instantly share code, notes, and snippets.

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.

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:

@JPry
JPry / plugin-gulpfile.mustache
Last active September 28, 2017 22:04
Sample mustache files for Gulp scaffolding
// Require dependencies
const del = require( 'del' );
const gulp = require( 'gulp' );
const gutil = require( 'gulp-util' );
const notify = require( 'gulp-notify' );
const plumber = require( 'gulp-plumber' );
const sort = require( 'gulp-sort' );
const textdomain = require( 'gulp-checktextdomain' );
const wpPot = require( 'gulp-wp-pot' );
<?php
/**
* This is a sample function to illustrate your loop.
*/
function your_function() {
$displayed_full_content = false;
$posts = new WP_Query( /* your query args here*/ );
while ( $posts->have_posts() ) {
@JPry
JPry / cmb2_sample.js
Last active February 21, 2019 13:31
A Sample CMB2 metabox with fields that show/hide based on other fields. In action: http://screencast.com/t/sXJ9rpOS
// Either create a new empty object, or work with the existing one.
window.JPry_CMB2 = window.JPry_CMB2 || {};
(function( window, document, $, app, undefined ) {
'use strict';
// Cache specific objects from the DOM so we don't look them up repeatedly.
app.cache = function() {
app.$ = {};
app.$.select = $( document.getElementById( 'jpry_sample_selection' ) );
<?php
global $wpdb;
$results = get_transient( 'laurens_random_posts' );
if ( false === $results ) {
$results = $wpdb->get_results( "SELECT * FROM {$wpdb->posts} ORDER BY RAND()" );
set_transient( 'laurens_random_posts', $results, WEEK_IN_SECONDS );
}
@JPry
JPry / rmbom.php
Last active December 31, 2015 18:10
Remove BOM from a given file. Includes error checking.
<?php
/**
* A simple script to remove BOM from a given file.
*
* @author Jeremy Pry
*/
if ( $argc < 2 ) {
echo "Please include a file to operate on!" . PHP_EOL;
die( 1 );
<?php
/**
* Plugin Name: wp_insert_post_data example
* Plugin URI: https://gist.github.com/JPry/2e4b074a81d7c8234eb4
* Description: Example of prevnting the modified date from changing.
* Version: 1.0
* Author: Jeremy Pry
* Author URI: http://jeremypry.com/
* License: GPL2
*/
<?php
/**
* File for the Front End Editor class.
*
* @package JPry_Front_End_Editor
*/
/**
* Front End Editor class.
*
@JPry
JPry / explanation.md
Last active September 23, 2015 21:10

get_file_data() Plugin example

Problem

You need to know the version of your plugin in your code. How do you do that? Maybe a constant, maybe a hard-coded string somewhere. Whichever way you go, you have at least 2 places where the plugin version lives: your hard-coded string/constant/whatever, and the plugin header used by WordPress. Updating things in more than one place is a pain.

Solution

Use the get_file_data() function to retrieve information about your plugin. Then use that in your code instead of hard-coding the value. BAM, only one place to update the version.