Default Classes for WP-Gistpen

<?php
namespace WP_Gistpen;

/**
 * This is the class description.
 *
 * @package    WP_Gistpen
 * @author     James DiGioia <jamesorodig@gmail.com>
 * @link       https://jamesdigioia.com/wp-gistpen/
 * @since      [current version]
 */
class Boilerplate {

	/**
	 * The ID of this plugin.
	 *
	 * @since    [current version]
	 * @access   private
	 * @var      string    $plugin_name    The ID of this plugin.
	 */
	private $plugin_name;

	/**
	 * The version of this plugin.
	 *
	 * @since    [current version]
	 * @access   private
	 * @var      string    $version    The current version of this plugin.
	 */
	private $version;

	/**
	 * Initialize the class and set its properties.
	 *
	 * @since    [current version]
	 * @var      string    $plugin_name       The name of this plugin.
	 * @var      string    $version    The version of this plugin.
	 */
	public function __construct( $plugin_name, $version ) {

		$this->plugin_name = $plugin_name;
		$this->version = $version;

	}
}
<?php

class WP_Gistpen_Sample_Test extends WP_Gistpen_UnitTestCase {

	function setUp() {
		parent::setUp();
	}

	function test_sample() {
		// replace this with some actual testing code
		$this->markTestIncomplete( "This test is incomplete." );
	}

	function tearDown() {
		parent::tearDown();
	}
}

Sync additional paths in Bedrock-Ansible’s Vagrantfile

# Sync additional paths
extra_paths = [
  ['../../../plugins/wp-gistpen', File.join(bedrock_path_server, 'web/app/plugins/wp-gistpen')]
]

extra_paths.each do |paths|
  extra_path = paths[0]
  extra_path_server = paths[1]
  initial_mount = File.join('/wptmp', File.basename(extra_path))

  if Vagrant::Util::Platform.windows?
    config.vm.synced_folder extra_path, extra_path_server, owner: 'vagrant', group: 'www-data', mount_options: ['dmode=776', 'fmode=775']
  else
    if !Vagrant.has_plugin? 'vagrant-bindfs'
      raise Vagrant::Errors::VagrantError.new,
        "vagrant-bindfs missing, please install the plugin:\nvagrant plugin install vagrant-bindfs"
    else
      config.vm.synced_folder extra_path, initial_mount, type: 'nfs'
      config.bindfs.bind_folder initial_mount, extra_path_server, u: 'vagrant', g: 'www-data'
    end
  end
end

Git-to-SVN Plugin Deploy by Scribu

#!/usr/bin/env bash

# args
MSG=${1-'deploy from git'}
BRANCH=${2-'trunk'}

# paths
SRC_DIR=$(git rev-parse --show-toplevel)
DIR_NAME=$(basename $SRC_DIR)
DEST_DIR=~/svn/$DIR_NAME/$BRANCH

# build first
if [ -f "$SRC_DIR/bin/build" ]; then
	$SRC_DIR/bin/build
fi

# make sure we're deploying from the right dir
if [ ! -d "$SRC_DIR/.git" ]; then
	echo "$SRC_DIR doesn't seem to be a git repository"
	exit
fi

# make sure the destination dir exists
mkdir -p $DEST_DIR
svn add $DEST_DIR 2> /dev/null

# delete everything except .svn dirs
for file in $(find $DEST_DIR/* -type -f -and -not -path "*.svn*")
do
	rm $file
done

# copy everything over from git
rsync --recursive --exclude='*.git*' $SRC_DIR/* $DEST_DIR

cd $DEST_DIR

# check .svnignore
for file in $(cat "$SRC_DIR/.svnignore" 2> /dev/null)
do
	rm -rf $DEST_DIR/$file
done

# Transform the readme
if [ -f README.md ]; then
	mv README.md readme.txt
	sed -i '' -e 's/^# (.*)$/=== 1 ===/' -e 's/ #* ===$/ ===/' -e 's/^## (.*)$/== 1 ==/' -e 's/ #* ==$/ ==/' -e 's/^### (.*)$/= 1 =/' -e 's/ #* =$/ =/' readme.txt
fi

# svn addremove
svn stat | awk '/^?/ {print $2}' | xargs svn add > /dev/null 2>&1
svn stat | awk '/^!/ {print $2}' | xargs svn rm --force

svn stat

svn ci -m "$MSG"
#!/bin/bash

if [ $# -lt 1 ]; then
	echo 'usage: plugin-tag 1.2.3'
	exit
fi

TAG_NAME=$1

git tag $TAG_NAME
git push
git push --tags

plugin-deploy "tagging version $TAG_NAME" tags/$TAG_NAME

Upgrade npm to latest/bleeding

#!/bin/sh

set -e
set -x

for package in $(npm -g outdated --parseable --depth=0 | cut -d: -f3)
do
    npm -g install "$package"
done
#!/bin/sh

set -e
set -x

for package in $(npm -g outdated --parseable --depth=0 | cut -d: -f2)
do
    npm -g install "$package"
done
source <(curl -fsSL https://gist.githubusercontent.com/mAAdhaTTah/49c2e59eda85f37b325f/raw/4ead4c8989c66104a22240819131b99295bc4e37/npm-upgrade.sh)