Skip to content

Instantly share code, notes, and snippets.

Jonathan Brinley jbrinley

Block or report user

Report or block jbrinley

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
@jbrinley
jbrinley / disable-plugin-delete.php
Last active Aug 20, 2019
WordPress plugin to disable the deletion of plugin files when running the uninstaller. Drop this in your mu-plugins directory before running the uninstaller.
View disable-plugin-delete.php
<?php
/**
* Plugin Name: Disable Plugin Deletion
* Description: Disables the deletion of plugin files when running the uninstaller
* Author: Jonathan Brinley
* Version: 1.0.0
* Author URI: https://xplus3.net/
* License: GPLv2 or later
*/
@jbrinley
jbrinley / bc_cats_to_wp_cats.php
Last active Aug 19, 2019
Convert BigCommerce category IDs to WordPress category IDs
View bc_cats_to_wp_cats.php
<?php
function bc_cats_to_wp_cats( $category_ids ) {
$query = new \WP_Term_Query();
return $query->query( [
'taxonomy' => \BigCommerce\Taxonomies\Product_Category\Product_Category::NAME,
'meta_query' => [
[
'key' => 'bigcommerce_id',
@jbrinley
jbrinley / Image_Importer.php
Last active Aug 10, 2018
A utility class for importing images from an external URL into WordPress.
View Image_Importer.php
<?php
/**
* Class Image_Importer
*
* Imports an image from a URL and attaches it to a post
*/
class Image_Importer {
private $image_url;
private $attach_to_post_id;
View .gitconfig
[alias]
ci = commit
# View abbreviated SHA, description, and history graph of the latest 20 commits
l = log --pretty=oneline -n 20 --graph --abbrev-commit
lol = log --graph --decorate --pretty=format:\"%h %ad | %s%d [%an]\" --date=short --abbrev-commit
# View the current working tree status using the short format
View .docker-functions
#!/usr/bin/env bash
docker_project_alias()
{
if [[ $1 == "core" ]]; then
echo "global";
elif [[ $1 == "dw" ]]; then
echo "dealerweb";
elif [[ $1 == "s1" ]] || [[ $1 == "sq" ]]; then
echo "square";
View jbrinley_rsa
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA8pZP+un2jGZnEpY3cbbAcAq3X8ZwIkvMlf7gzweb1EVp4e/wjRD5V4bct3U/xucAO9j5OjgmKHegNyIigUUbloxnmE2ArLH95d5fkXybN9WebnLxpDZtavqHftO17oosKaA+3TMKpAMt1rfgBRFMmY0pHyyYWSXzIgD1LWHEfeli+ALRwgLD5+kCOqqB73zwE5tQC4OWqIcAIcTSzPS9JhSdLjLwaUCdybTfPE6LvouXMEHoX4baK4E4WP1ZHT5kLUocJkA2g7iwUyk46OVck5O6VwflJRe0hmMNnzkQ3QCtKLSjXyz3JcqVyepkj4eZpt+1AYlBi/TQVVV/UcznSw== jbrinley@flightless.us
@jbrinley
jbrinley / Dockerfile
Last active Sep 10, 2019
Install php7 memcached on alpine linux - dockerfile snippet
View Dockerfile
RUN
apk add --update \
autoconf \
file \
g++ \
gcc \
libc-dev \
make \
pkgconf \
re2c \
View wp.sql
# ************************************************************
# Sequel Pro SQL dump
# Version 4541
#
# http://www.sequelpro.com/
# https://github.com/sequelpro/sequelpro
#
# Host: docker (MySQL 5.5.52)
# Database: wordpress
# Generation Time: 2016-09-19 02:06:44 +0000
@jbrinley
jbrinley / install.md
Created Aug 20, 2016
Install Docker for Mac
View install.md

Mac

Prerequisites

  • 2010 or newer Mac
  • OS X 10.10.3 or later
  • Uninstall VirtualBox if you have version 4.3.30 or earlier

Install Docker for Mac

@jbrinley
jbrinley / Dockerfile
Last active Aug 3, 2016
PHP7 FPM dockerfile
View Dockerfile
# Use Alpine Linux
FROM alpine:latest
# Environments
ENV TIMEZONE Etc/UTC
ENV PHP_MEMORY_LIMIT 512M
ENV MAX_UPLOAD 50M
ENV PHP_MAX_FILE_UPLOAD 200
ENV PHP_MAX_POST 100M
You can’t perform that action at this time.