This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ xcode-select --install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ls -al /tmp/mysql.sock; ls -al /var/mysql/mysql.sock | |
lrwxr-xr-x 1 root wheel 21 Oct 12 13:45 /tmp/mysql.sock -> /var/mysql/mysql.sock | |
srwxrwxrwx 1 _mysql wheel 0 Oct 12 13:51 /var/mysql/mysql.sock | |
ls: /tmp/mysql.sock: No such file or directory | |
srwxrwxrwx 1 _mysql wheel 0 Oct 12 13:51 /var/mysql/mysql.sock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Dynamically Set Environment Variables | |
$server[] = $_SERVER['HTTP_HOST']; | |
$server[] = $_SERVER['LOCAL_NAME']; | |
$environment->local[] = 'example.dev'; | |
$environment->staging[] = 'staging.example.com'; | |
if ( array_intersect( $environment->local, $server ) ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 ) ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UPDATE | |
wp_options | |
SET | |
option_value = 'username@example.com' | |
WHERE | |
option_name = 'admin_email'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ 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 |