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 / 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` >= 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
@brianjking
brianjking / events-conditional-wrappers.php
Last active September 1, 2015 03:14 — forked from jo-snips/events-conditional-wrappers.php
The Events Calendar: Basic Conditional Wrappers
<?php
/*-----------------------------------------------------------------------------------*/
/* Conditional Logic to Detect Various Event Related Views/Pages
/*-----------------------------------------------------------------------------------*/
if( tribe_is_month() && !is_tax() ) { // Month View Page
echo 'were on the month view page';
} elseif( tribe_is_month() && is_tax() ) { // Month View Category Page
@brianjking
brianjking / Responsive Table.md
Last active September 8, 2015 15:56
Responsive Table Example for DockDogs Handler Registration Area
@brianjking
brianjking / responsive-table-example-retina-support.html
Last active September 9, 2015 13:43
Responsive Table Example with Retina Support
<!DOCTYPE html>
<html >
<head>
<meta charset="UTF-8">
<title>Responsive Table Example</title>
<style>
@import 'http://fonts.googleapis.com/css?family=Open+Sans:300,400,700';
* {
@brianjking
brianjking / osx-10.10-setup.md
Last active September 13, 2015 02:15 — forked from kevinelliott/osx-10.10-setup.md
Mac OS X 10.10 Yosemite Setup

Mac OS X 10.10 Yosemite

Custom recipe to get OS X 10.10 Yosemite running from scratch, setup applications and developer environment. I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. On average, I reinstall each computer from scratch every 6 months, and I do not perform upgrades between distros.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

You are encouraged to fork this and modify it to your heart's content to match your own needs.

Install Software