Skip to content

Instantly share code, notes, and snippets.

View donaldallen's full-sized avatar

Donald Allen donaldallen

View GitHub Profile
<?php
defined( 'ABSPATH' ) OR exit;
/**
* Plugin Name: (WCM) PHPMailer Exceptions & SMTP
* Description: WordPress by default returns <code>FALSE</code> instead of an <code>Exception</code>. This plugin fixes that.
*/
add_action( 'phpmailer_init', 'WCMphpmailerException' );
function WCMphpmailerException( $phpmailer )
{
@donaldallen
donaldallen / Performance.Dev.config
Created January 17, 2017 22:01 — forked from kamsar/Performance.Dev.config
SItecore 8.0/8.1 Performance Config
<!--
A set of performance optimizations for development that vastly increase application startup time.
Should not be used in production, as they largely disable forensic diagnostics that you'd want there over fast startup time after a compile.
-->
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<hooks>
<hook type="Sitecore.Diagnostics.HealthMonitorHook, Sitecore.Kernel">
<patch:delete />
@donaldallen
donaldallen / CsvActionResult.cs
Created May 29, 2018 19:09 — forked from simonech/CsvActionResult.cs
ActionResult for ASP.NET MVC that returns a CSV file from any list of objects
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Reflection;
using System.Text;
using System.Web;
using System.Web.Mvc;
namespace webnetconf.website.Helpers
@donaldallen
donaldallen / WordPress.class.php
Created August 7, 2018 14:34 — forked from Jamesking56/WordPress.class.php
Read Wordpress Export XML to PHP
<?php
/**
* WordPress class - Manages the WordPress XML file and gets all data from that.
*/
class Wordpress
{
public static $wpXML;
@donaldallen
donaldallen / pre-commit
Created August 13, 2019 19:02 — forked from ssx/pre-commit
Pre-commit hook for git with phpcs and phpcbf (auto-correct obvious violations)
#!/bin/sh
PHPCS=`which phpcs`
PHPCBF=`which phpcbf`
if [ -z $PHPCS ] || [ -z $PHPCBF ]
then
printf "\n\e[38;5;255,255,255m"
printf "💥 Error: The required tools 'phpcs' and/or 'phpcbf' could not be found in your path.\n\n"
printf "You can install both tools globally by running:\n\n"