Skip to content

Instantly share code, notes, and snippets.

@kurtpayne
kurtpayne / provision.sh
Created May 23, 2018 22:06
Install Netflix Conductor On Centos7
#!/bin/sh
# Install pre-reqs
yum -y update
yum -y install epel-release
curl -sL https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
yum -y install abuild ack autoconf automake binutils build-base bzip2 bzip2-devel curl docker docker-compose gcc gcc-c++ java-1.8.0-openjdk java-1.8.0-openjdk-devel libjpeg-turbo libjpeg-turbo-devel libpng libpng-devel libpng12 libpng12-devel libstdc++ libtool make nasm nodejs npm python strace tar unzip wget yarn yum-utils
# Install gradle
mkdir -p /opt/gradle
@kurtpayne
kurtpayne / keybase.md
Created December 2, 2017 07:17
keybase.md

Keybase proof

I hereby claim:

  • I am kurtpayne on github.
  • I am kpayne (https://keybase.io/kpayne) on keybase.
  • I have a public key ASBQryJbLLHpQoZX3m-GUoMVhZBbYd4YGatkPFU9KyfzmAo

To claim this, I am signing this object:

@kurtpayne
kurtpayne / out
Created May 30, 2014 00:24
wp-cli warnings
$ php behat.phar features/theme.feature
Feature: Manage WordPress themes
Scenario: Installing and deleting theme # features/theme.feature:3
Given a WP install # features/steps/given.php:40
When I run `wp theme install p2` # features/steps/when.php:17
$ wp theme install p2
Installing P2 (1.5.3)
Downloading install package from https://wordpress.org/themes/download/p2.1.5.3.zip...
Unpacking the package...
@kurtpayne
kurtpayne / panic on 01
Last active August 29, 2015 14:00
latest varnish panic
varnish> panic.show
200
Last panic at: Thu, 24 Apr 2014 17:27:48 GMT
Assert error in vmod_ch_sighandler(), vmod_crashhandler.c line 13:
Condition(You asked for it) not true.
errno = 104 (Connection reset by peer)
thread = (cache-worker)
ident = Linux,2.6.32-358.18.1.el6.nfsfixes.x86_64,x86_64,-sfile,-smalloc,-hcritbit,epoll
Backtrace:
0x42f758: /usr/sbin/varnishd() [0x42f758]
<?php
/**
* A very simple php code profiler. No extensions required.
*
* Example usage:
* <code>
* declare(ticks=1);
* require_once('./SimpleProfiler.class.php');
* SimpleProfiler::start_profile();
@kurtpayne
kurtpayne / rarst.php
Created December 3, 2013 15:00
Super subtle troll
<?php
/**
* Plugin Name: Rarst's favorite plugin
* Description: SHUT UP
* Version: INF
* Author: The unholy army of trolls
* License: GPLv2 or MIT (they're equivalent, right?)
*/
add_action( 'all', function() {
global $wp_filter;
{
"offers": [
{
"response": "upgrade",
"download": "https:\/\/wordpress.org\/wordpress-3.7.1.zip",
"locale": "en_US",
"packages": {
"full": "https:\/\/wordpress.org\/wordpress-3.7.1.zip",
"no_content": "https:\/\/wordpress.org\/wordpress-3.7.1-no-content.zip",
"new_bundled": "https:\/\/wordpress.org\/wordpress-3.7.1-new-bundled.zip",
@kurtpayne
kurtpayne / mysql_error_catcher.php
Last active December 20, 2015 15:28
First pass at catching rogue mysql_* calls in themes and plugins.
<?php
set_error_handler( function( $errno, $errstr, $errfile) {
if ( 'wp-db.php' !== basename( $errfile ) ) {
if ( preg_match( '/^(mysql_[a-zA-Z0-9_]+)/', $errstr, $matches ) ) {
_doing_it_wrong( $matches[1], 'Please talk to the database using $wpdb', '3.7' );
return apply_filters( 'wpdb_drivers_raw_mysql_call_trigger_error', true );
}
}
@kurtpayne
kurtpayne / cookies.php
Created February 6, 2013 17:39
WordPress and cURL cookies
<?php
// Create a cookie file
require_once ABSPATH . 'wp-admin/includes/file.php';
$cookie_file = wp_tempnam();
// Create a callback to let curl save cookies there
$cookie_saver = function( $ch ) use ( $cookie_file ) {
curl_setopt( $ch, CURLOPT_COOKIEJAR, $cookie_file );
curl_setopt( $ch, CURLOPT_COOKIEFILE, $cookie_file );
@kurtpayne
kurtpayne / 3.5.1 output
Last active December 11, 2015 16:19
Unit tests for 3.5.1
kpayne@localhost:/cygdrive/c/wamp/www/wordpress-unit-tests$ svn status
X data/plugins/wordpress-importer
X data/wpcom-themes
X wordpress
Performing status on external item at 'data/wpcom-themes':
Performing status on external item at 'data/plugins/wordpress-importer':
Performing status on external item at 'wordpress':