Skip to content

Instantly share code, notes, and snippets.

View burbridgeconsulting's full-sized avatar

Chris Burbridge burbridgeconsulting

View GitHub Profile
@burbridgeconsulting
burbridgeconsulting / bb_raw_data_search_replace_url.pl
Last active April 22, 2019 02:30
Replace a URL in exported Beaver Builder template XML file
#!/usr/bin/perl
use strict;
my $search = 'http://old-url.com/';
my $replace = 'https://new-url.org/';
my $length_difference = length($search) - length($replace);
my $filename = "exported_bb_template.xml";
# my $filename = "/Users/christopherburbridge/Downloads/test.xml";
open(my $fh, $filename) or die "Could not open file '$filename' $!";
@burbridgeconsulting
burbridgeconsulting / gist:746c92c1c85fb09b3a28
Created May 2, 2015 04:50
Local file commands for WP setup
find . -type d -exec chmod 755 {} \;
chmod -R a+X *
find . -type f -exec chmod 644 {} \;
find . -type f -name '*.php' -exec chmod 644 {} \;
chown christopherburbridge .
chown -R christopherburbridge *
@burbridgeconsulting
burbridgeconsulting / WP Debug Setup
Created July 3, 2013 18:57
WP Debug Setup for wp-config.php, with notes for useful plugins. Several settings derived from: http://wp.smashingmagazine.com/2013/05/29/tips-tricks-testing-wordpress-themes/ My own server conditional switching, derived from a previous client. Allows you to include wp-config.php in repo, if you like. Also adds recommended plugins.
// ** Recommended plugins: Debug Bar, and related plugins (do search on "debug bar")
// ** Define environments for different machines.
$user = $_ENV['LOGNAME'];
$host = $_SERVER['HTTP_HOST'];
$environment = $user . ' / ' . $host;
// echo "\$environment='{$environment}'";
switch ($environment) {
case 'chrisburbridge / mysite.dev':
@burbridgeconsulting
burbridgeconsulting / Apache LoadModule Settings for WP Dev
Created March 4, 2013 19:53
Apache (e.g., XAMPP) WordPress settings optimized for speedy dev. See notes.
# LoadModule authn_file_module modules/mod_authn_file.so
# LoadModule authn_dbm_module modules/mod_authn_dbm.so
# LoadModule authn_anon_module modules/mod_authn_anon.so
# LoadModule authn_dbd_module modules/mod_authn_dbd.so
# LoadModule authn_default_module modules/mod_authn_default.so
LoadModule authz_host_module modules/mod_authz_host.so
# LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
# LoadModule authz_user_module modules/mod_authz_user.so
# LoadModule authz_dbm_module modules/mod_authz_dbm.so
# LoadModule authz_owner_module modules/mod_authz_owner.so
@burbridgeconsulting
burbridgeconsulting / wp-config Environment Conditionals
Last active December 14, 2015 12:18
WordPress config environment conditionals. See comments for instructions.
// ** Define environments for different machines.
$user = $_ENV['LOGNAME'];
$host = $_SERVER['HTTP_HOST'];
$environment = $user . ' / ' . $host;
switch ($environment) {
case 'chrisburbridge / mysite.dev':
define('DB_NAME', 'xxxxxxxxx');
define('DB_USER', 'aaaaaaa');
define('DB_PASSWORD', 'mmmmmmmm');