Skip to content

Instantly share code, notes, and snippets.

@ryanjbonnell
ryanjbonnell / org.postfix.master.plist
Created Oct 12, 2016
macOS 10.12 "Sierra" Postfix Launch Daemon Property List
View org.postfix.master.plist
<?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 Feb 23, 2016
Install Drush and Terminus for Drupal at Pantheon using Homebrew
View drupal.sh
## 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 Oct 8, 2014
Install SassC + LibSass for Mac OS X 10.9 "Mavericks"
View setup.sh
# 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
View mysql-reset-root-password.sh
$ 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 Aug 30, 2019
Install PHP_CodeSniffer on Mac OS X for Drupal Coding Standards
View gist:c0f04ded19c35333f004
# 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 Jun 4, 2014
WordPress - MySQL Update Admin Email Address
View gist:b78002efbe6662703fa6
UPDATE
wp_options
SET
option_value = 'username@example.com'
WHERE
option_name = 'admin_email';
@ryanjbonnell
ryanjbonnell / facebook-like-box.html
Created May 30, 2014
Load the Facebook JavaScript SDK Asynchronously
View facebook-like-box.html
<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 Mar 12, 2014
WordPress Config: Use X-Forwarded-For HTTP Header to Get Visitor's Real IP Address
View wp-config.php
// 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 Nov 7, 2013
Disable WordPress Plugins in Local Environment
View disable-local-plugins.php
<?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 Nov 7, 2013
WordPress Configuration for Multiple Environments
View wp-config.php
<?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 ) );
You can’t perform that action at this time.