Skip to content

Instantly share code, notes, and snippets.

View brianjking's full-sized avatar
💭
Doin' cool stuff at BrandMuscle AI

Brian J King brianjking

💭
Doin' cool stuff at BrandMuscle AI
View GitHub Profile
@brianjking
brianjking / nginx-apache-reverse-proxy-wordpress-mu-vhost.conf
Last active August 29, 2015 14:26 — forked from jakebellacera/nginx-apache-reverse-proxy-wordpress-mu-vhost.conf
Useful nginx virtual host configuration for reverse proxy (proxy_pass) with Apache
# useful nginx configuration for reverse proxy with Apache
# edit lines 8, 11, and 30
# taken from: http://syslog.tv/2010/01/11/debian-apache-2-nginx-wordpress-mu/
# edits by jakebellacera (http://github.com/jakebellacera && http://jakebellacera.com)
server {
listen 80;
server_name domain.com *.domain.com; # edit this to your domain
@brianjking
brianjking / .gitignore
Last active August 29, 2015 14:26 — forked from jjeaton/.gitignore
WordPress root .gitignore. Ignore everything and then opt-in (exclude from the ignore) for your custom code.
# This is a template .gitignore file for git-managed WordPress projects.
#
# Fact: you don't want WordPress core files, or your server-specific
# configuration files etc., in your project's repository. You just don't.
#
# Solution: stick this file up your repository root (which it assumes is
# also the WordPress root directory) and add exceptions for any plugins,
# themes, and other directories that should be under version control.
#
# See the comments below for more info on how to add exceptions for your
@brianjking
brianjking / awesome-wp-config-file.php
Last active August 29, 2015 14:26 — forked from ashfame/awesome-wp-config-file.php
awesome-wp-config-file
<?php
/**
* Define type of server
*
* Depending on the type other stuff can be configured
* Note: Define them all, don't skip one if other is already defined
*/
define( 'DB_CREDENTIALS_PATH', dirname( ABSPATH ) ); // cache it for multiple use
@brianjking
brianjking / site_sync.sh
Last active August 29, 2015 14:26 — forked from jjeaton/site_sync.sh
Bash script to push/pull a WordPress site's files and MySQL DB between production and a local environment
#!/bin/sh
# Just an abbreviation for creating filenames
SHORT_NAME=je
# hostname as configred in ~/.ssh/config
SERVER_NAME=je
# Database name in production
DB_NAME=XXXX
# Database user in production
DB_USER=XXXX
@brianjking
brianjking / gist:47d1516c92038b75781a
Last active August 29, 2015 14:26 — forked from jjeaton/wp-config.php
WP_DEBUG in wp-config.php using debug.log
<?php
// Debug Settings
define( 'WP_DEBUG', true );
if ( WP_DEBUG ) {
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
define( 'SAVEQUERIES', true );
define( 'SCRIPT_DEBUG', true );
@ini_set( 'display_errors',0 );
@brianjking
brianjking / helpful_queries.md
Last active August 29, 2015 14:27 — forked from joseluisq/helpful_queries.md
Some helpful MySQL queries

MySQL helpful queries

Select records from one day ago

In this case registered field is DATETIME type.

SELECT * 
FROM users
WHERE
 `registered` &gt;= CONCAT(SUBDATE(CURDATE(), 1), ' 00:00:00') AND 
@brianjking
brianjking / user_prefs
Last active August 29, 2015 14:27 — forked from inetbiz/user_prefs
User SpamAssassin Custom Settings
# SACONFIGSTART
# Make sure we get the required score header.
rewrite_header subject [SPAM] (_SCORE_)
# SACONFIGEND
# SA RULES GO HERE
add_header all Score _SCORE_
bayes_auto_learn 1
bayes_auto_learn_threshold_nonspam -5.0
@brianjking
brianjking / tec-yoast-title-rewrite.php
Last active August 29, 2015 14:27 — forked from jesseeproductions/tec-yoast-title-rewrite.php
The Events Calendar - Yoast SEO - Prevent Yoast from changing Event Title Tags for Event Views (Month, List, Etc,)
/*
* The Events Calendar - Yoast SEO - Prevent Yoast from changing Event Title Tags for Event Views (Month, List, Etc,)
* @TEC - 3.11
* @Yoast - 2.3.4
*/
add_action( 'pre_get_posts', 'tribe_remove_wpseo_title_rewrite', 20 );
function tribe_remove_wpseo_title_rewrite() {
if ( class_exists( 'Tribe__Events__Main' ) && class_exists( 'Tribe__Events__Pro__Main' ) ) {
if( tribe_is_month() || tribe_is_upcoming() || tribe_is_past() || tribe_is_day() || tribe_is_map() || tribe_is_photo() || tribe_is_week() ) {
$wpseo_front = WPSEO_Frontend::get_instance();
@brianjking
brianjking / tec-genesis-author-box
Last active August 29, 2015 14:27 — forked from jesseeproductions/tec-genesis-author-box
Genesis Remove Author Box from Single Templates for the The Events Calendar
/*
* Genesis Remove Author Box from Single Templates for the The Events Calendar
* The Events Calendar @3.10
* Genesis @2.1.2
* this adds the filter for testing add_filter( 'get_the_author_genesis_author_box_single', '__return_true' );
* To Do Fixed Trying to get property of non-object notice
*/
add_action( 'pre_get_posts', 'tribe_genesis_hide_author_single_events' );
function tribe_genesis_hide_author_single_events( $query ) {
@brianjking
brianjking / add_ftp_users.sh
Last active August 29, 2015 14:27 — forked from janxb/ajenti_additional_ftp_users.sh
A Shell Script for adding additional FTP-Users to Ajenti
#!/bin/bash
SET_USERS="usernameone:password:/path/to/web/folder usernametwo:password:/path/to/second/folder"
IFS=' ' read -a USERS <<< "${SET_USERS}"
for SET_USER in ${USERS[@]}; do
IFS=':' read -a USER <<< "${SET_USER}"
NAME=${USER[0]};
PASS=${USER[1]};
DIR=${USER[2]};
(echo $PASS; echo $PASS) | pure-pw useradd $NAME -u www-data -g www-data -d $DIR