Skip to content

Instantly share code, notes, and snippets.

@ryanjbonnell
ryanjbonnell / org.postfix.master.plist
Created October 12, 2016 16:21
macOS 10.12 "Sierra" Postfix Launch Daemon Property List
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.postfix.master</string>
<key>Program</key>
<string>/usr/libexec/postfix/master</string>
<key>ProgramArguments</key>
<array>
@ryanjbonnell
ryanjbonnell / drupal.sh
Created February 23, 2016 21:49
Install Drush and Terminus for Drupal at Pantheon using Homebrew
## Update Homebrew Formula(s)
$ brew update
$ brew tap homebrew/dupes
$ brew tap homebrew/versions
$ brew tap homebrew/php
## Install Drush
$ brew install drush
@ryanjbonnell
ryanjbonnell / setup.sh
Created October 8, 2014 22:17
Install SassC + LibSass for Mac OS X 10.9 "Mavericks"
# Install SassC Interpreter
$ cd /usr/local/src
$ curl -kL https://github.com/hcatlin/libsass/archive/master.zip > libsass.zip
$ unzip libsass.zip
# Install LibSass Library
$ cd /usr/local/src
$ curl -kL https://github.com/sass/sassc/archive/master.zip > sassc.zip
$ unzip sassc.zip
@ryanjbonnell
ryanjbonnell / mysql-reset-root-password.sh
Created August 5, 2014 05:55
MySQL - Reset Root Password
$ sudo /usr/local/mysql/support-files/mysql.server stop
$ sudo /usr/local/mysql/bin/mysqld_safe --skip-grant-tables --skip-networking &
mysql> UPDATE mysql.user SET Password=PASSWORD('') WHERE User='root';
mysql> FLUSH PRIVILEGES;
mysql> exit
$ mysql -h localhost -u root
mysql> set password=password('');
mysql> exit
@ryanjbonnell
ryanjbonnell / gist:c0f04ded19c35333f004
Last active February 8, 2021 00:23
Install PHP_CodeSniffer on Mac OS X for Drupal Coding Standards
# Install PEAR (PHP Extension and Application Repository)
$ sudo php /usr/lib/php/install-pear-nozlib.phar
$ sudo pear upgrade-all
$ sudo pear install --alldeps PHP_CodeSniffer
# Add PEAR to `php.ini` Include Path
$ nano /etc/php.ini
;include_path = ".:/php/includes"
include_path = ".:/php/includes:/usr/lib/php/pear"
@ryanjbonnell
ryanjbonnell / gist:b78002efbe6662703fa6
Created June 4, 2014 16:19
WordPress - MySQL Update Admin Email Address
UPDATE
wp_options
SET
option_value = '[email protected]'
WHERE
option_name = 'admin_email';
@ryanjbonnell
ryanjbonnell / facebook-like-box.html
Created May 30, 2014 20:42
Load the Facebook JavaScript SDK Asynchronously
<div class="fb-like-box"
data-href="https://www.facebook.com/FacebookDevelopers"
data-colorscheme="light"
data-show-faces="true"
data-header="true"
data-stream="false"
data-show-border="true"
data-height="212">
</div>
@ryanjbonnell
ryanjbonnell / wp-config.php
Created March 12, 2014 15:51
WordPress Config: Use X-Forwarded-For HTTP Header to Get Visitor's Real IP Address
// Use X-Forwarded-For HTTP Header to Get Visitor's Real IP Address
if ( isset( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) {
$http_x_headers = explode( ',', $_SERVER['HTTP_X_FORWARDED_FOR'] );
$_SERVER['REMOTE_ADDR'] = $http_x_headers[0];
}
@ryanjbonnell
ryanjbonnell / disable-local-plugins.php
Created November 7, 2013 16:48
Disable WordPress Plugins in Local Environment
<?php
/**
* Plugin Name: Disable Plugins in Local Environment
* Plugin URI:
* Description: Blacklist of Plugins to Disable When Working Locally
* Version: 0.1
* Author: Ryan J. Bonnell
* Author URI: https://gist.github.com/ryanjbonnell/
* License: WTFPL
@ryanjbonnell
ryanjbonnell / wp-config.php
Created November 7, 2013 16:43
WordPress Configuration for Multiple Environments
<?php
// Define Environment Variables
$environment = new stdClass();
$environment->local = '/wp-config-local.php';
$environment->staging = '/wp-config-staging.php';
$environment->testing = '/wp-config-testing.php';
// Dynamically Set Environment Constants
define( 'WP_ENV_LOCAL', file_exists( ABSPATH . $environment->local ) );
define( 'WP_ENV_STAGING', file_exists( ABSPATH . $environment->staging ) );