Skip to content

Instantly share code, notes, and snippets.

Stephen Harris stephenharris

Block or report user

Report or block stephenharris

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
@stephenharris
stephenharris / currencyField.js
Last active Jul 17, 2018
Formats currency input and provides a method from extracting the amount (in fractional currency units - i.e. in cents/pennies) http://jsfiddle.net/7g26x0uL/155/
View currencyField.js
$.widget( "nmk.currencyField", {
// Default options.
options: {
decimalPlaces: 2,
decimalSeperator: ".",
thousandSeperator: ",",
},
_create: function() {
@stephenharris
stephenharris / import-venues.php
Created Mar 21, 2017
A WP-CLI command to import a CSV of venues
View import-venues.php
<?php
/*
Plugin Name: Import Venues WP CLI command
Plugin URI: http://wordpress.org/plugins/hello-dolly/
Description: Adds `wp eo venue import <path-to-file>` command.
Author: Stephen Harris
Version: 0.1
*/
// Exit if accessed directly
View oauth-single-access-token.php
<?php
/**
* Plugin Name: OAuth 1.0a Single Access Token
* Description: Create Single Access Tokens
* Version: 0.1.0
*
*/
/**
* Allows you to create a 'single access token' for each consumer.
View vvv-wordpress-behat-extension-recipe.md

Running Behat on VVV

TODO:

  • How to copy plugins into place
  1. Configure Behat.yml

    Here I've used the details for http://local.wordpress-trunk.dev/:

    • Database: wordpress_trunk
@stephenharris
stephenharris / install-firefox-linux.md
Last active Apr 24, 2019
Installing a particular version of firefox on Linux.
View install-firefox-linux.md

Installing a particular version of FireFox on Linux

  1. Does an existing version of firefox exist?

    firefox --version
    

    If not, skip to (3).

@stephenharris
stephenharris / flush-permalink.sh
Last active Jul 20, 2016
Can be used to flush the rewrite rules of all sites in a multisite network.
View flush-permalink.sh
@stephenharris
stephenharris / rest-api.md
Last active Jul 5, 2016
Event Organiser Rest API - Draft specification
View rest-api.md

Event Organiser Rest API - Draft specification

Version: 0.3.0

Endpoints

The endpoints listed below assume a base of <yoursite>/wp-json/wp/v2


@stephenharris
stephenharris / wp-benchmark.php
Created Apr 19, 2016
Simple wp-cli based benchmark command
View wp-benchmark.php
<?php
if ( ! defined( 'WP_CLI' ) || ! WP_CLI ) {
return;
}
/**
* Implements example command.
*/
class Benchmark_Command extends WP_CLI_Command {
@stephenharris
stephenharris / copy-pre.css
Last active Jul 15, 2019
Adding a 'copy' button to <pre> content
View copy-pre.css
.pre-wrapper{
position:relative;
}
.pre-wrapper pre{
padding-top: 25px;
}
.pre-wrapper .copy-snippet {
border-radius: 0;
min-width:55px;
background: none repeat scroll 0 0 transparent;
@stephenharris
stephenharris / jenkins-ec2-continous-integration.md
Last active Jul 5, 2018
How to set up CI with Jenkins on AWS EC2 (and some notes)
View jenkins-ec2-continous-integration.md
You can’t perform that action at this time.