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
speedtestssh() { | |
# Verify we have a host to check agains | |
[[ -z "$1" ]] && { | |
echo "You must provide an ssh host" ; | |
return; | |
} | |
RED='\033[0;31m' | |
NC='\033[0m' # No Color | |
echo -e "\n${RED}Press CTRL-C to exit test${NC}\n"; |
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
#!/bin/bash | |
# Database credentials | |
user="USERNAME" | |
password="PASSWORD" | |
host="HOST" | |
db_name="DATABASE" | |
# General config | |
backup_path="/WHERE/TO/PUT/BACKUP/FILE" |
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
#!/bin/bash | |
# Location of log file is passed in as the first parameter | |
# Get a list of all the dates in the file | |
DATES="$(grep "2016" $1 | cut -d ' ' -f 1 | sort | uniq)" | |
for i in ${DATES}; do | |
# $i contains the string of the date we are looking at | |
# Remove the leading [ to prevent grep regex errors |
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
#!/usr/bin/perl | |
use DBI; | |
use 5.010; | |
use Getopt::Long; | |
# Set defaults | |
my $host = 'localhost'; | |
my $db = 'information_schema'; | |
my $user = ''; |
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: Serve from WordPress.com | |
Plugin URI: http://github.com/blobaugh/serve-from-wordpress-com | |
Description: Switches the URL on built-in WordPress javascript files to serve from WordPress.com rather than locally | |
Author: Ben Lobaugh | |
Version: 0.6 | |
Author URI: http://ben.lobaugh.net | |
*/ |
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
function tweakjp_custom_is_support() { | |
$supported = current_theme_supports( 'infinite-scroll' ) && ( is_home() || is_archive() || is_search() ); | |
return $supported; | |
} | |
add_filter( 'infinite_scroll_archive_supported', 'tweakjp_custom_is_support' ); |
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
function tweakjp_allow_cpt( $allowed_post_types ) { | |
// my_cpt is the name of your <span class="hilite">Custom</span> <span class="hilite">Post</span> <span class="hilite">Type</span> | |
$allowed_post_types[] = 'my_cpt'; | |
return $allowed_post_types; | |
} | |
add_filter( 'rest_api_allowed_post_types', 'tweakjp_allow_cpt' ); |
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
add_filter( 'site_transient_update_plugins', 'wds_wp_seo_no_update' ); | |
function wds_wp_seo_no_update( $value ) { | |
if ( empty( $value ) || empty( $value->response['wordpress-seo/wp-seo.php'] ) ) { | |
return $value; | |
} | |
unset( $value->response['wordpress-seo/wp-seo.php'] ); | |
return $value; | |
} |
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 | |
/** | |
* A unique identifier is defined to store the options in the database and reference them from the theme. | |
* By default it uses the theme name, in lowercase and without spaces, but this can be changed if needed. | |
* If the identifier changes, it'll appear as if the options have been reset. | |
* | |
*/ | |
function optionsframework_option_name() { |
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 | |
// Grab the original options.php file | |
require_once( WOT_PLUGIN_DIR . '3rd-party/options.php' ); | |
add_filter( 'wot_options_page', 'wot_theme_add_options' ); | |
/** | |
* Add any custom fields that are required to the options framework |