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 / config.yml
Created Dec 15, 2019
Deploying an react app to s3 bucket / cloudfront.
View config.yml
version: 2
jobs:
build:
docker:
- image: circleci/node:10
steps:
- checkout
- run: npm install
- run: sudo apt-get update && sudo apt-get install -y python-dev
- run: sudo curl -O https://bootstrap.pypa.io/get-pip.py
@stephenharris
stephenharris / config.yml
Created Dec 15, 2019
Circle CI config for deploying with serverless
View config.yml
version: 2
jobs:
build:
docker:
- image: circleci/node:10
steps:
- checkout
# Download and cache dependencies
- restore_cache:
@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 Sep 9, 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 {
You can’t perform that action at this time.