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 | |
# | |
# Check for diffs, and only open the merge tool if diffs are found. | |
# | |
dir=$FIRSTDIRECTORY | |
dir2=$SECONDDIRECTORY | |
cd "$dir" |
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 | |
# Install PHP Code Sniffer and related modules | |
TMP_PATH=/tmp/ | |
BIN_PATH=/usr/local/bin/ | |
cd $TMP_PATH | |
# PHPCS | |
# PHP Code Sniffer |
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
// ==UserScript== | |
// @name SCP Foundation: Add names to details pages | |
// @namespace https://gist.github.com/ksemel/3e189fef865a02ee9956 | |
// @description Adds the descriptive names from the SCP series index page to the individual detail pages, and provides previous and next buttons to navigate through SCPs. | |
// @author Katherine Semel | |
// @date 2011-09-02 | |
// @revision 2021-03-07 | |
// @version 3.0 | |
// @include /(?:scp-wiki\.wikidot\.com)\/(?:adult:)?(scp-[0-9]+)/ | |
// @grant GM_xmlhttpRequest |
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 admin_footer(){ | |
$screen = get_current_screen(); | |
if ( isset( $screen->base ) && $screen->base == 'profile' ) { | |
echo "<script type='text/javascript'> | |
if( jQuery('#GA_enabled').is(':checked') === false ) { | |
ShowOrHideQRCode(); | |
} | |
</script>"; | |
} | |
} |
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 | |
function Init_My_Theme() { | |
// Declare all your add_action and add_filter here so they all run when you call the init function | |
// Add the custom taxonomies | |
add_action( 'init', 'My_Theme_register_custom_taxonomy', 1 ); | |
// On the posts page, add a column | |
add_filter( 'manage_posts_columns', 'My_Theme_add_taxonomy_column', 10, 1 ); |
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
# Check Query Cache Status | |
# is query cache available | |
SHOW VARIABLES LIKE 'have_query_cache'; | |
# What is the cache set for? | |
SHOW VARIABLES LIKE 'query%'; | |
# How much is actually used? | |
SHOW STATUS LIKE 'Qc%'; |
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 | |
add_action( 'init', 'woocommerce_overrides', 99 ); | |
function woocommerce_overrides() { | |
add_filter( 'woocommerce_enqueue_styles', 'switch_to_theme_css', 10, 1 ); | |
} | |
function switch_to_theme_css( $styles ) { | |
$styles[ 'woocommerce-layout' ][ 'src' ] = get_template_directory_uri()."/assets/css/woocommerce-layout.css"; |
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
# Delete Orphaned Post Meta | |
# Selects all postmeta where the post_id does not exist | |
SELECT * FROM wp_postmeta WHERE post_id NOT IN (SELECT DISTINCT ID FROM wp_posts) AND meta_id BETWEEN 1 AND 500000; | |
# Use an offset to avoid super massive queries! | |
# Make sure to offset the META_ID ( not the post_ID ) or you'll delete good data | |
# Set 1 | |
DELETE FROM wp_postmeta WHERE post_id NOT IN (SELECT DISTINCT ID FROM wp_posts) AND meta_id BETWEEN 1 AND 500000; |
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
# Find Table Sizes | |
SELECT CONCAT(table_schema, '.', table_name), | |
CONCAT(ROUND(table_rows / 1000000, 2), 'M') rows, | |
CONCAT(ROUND(data_length / ( 1024 * 1024 * 1024 ), 2), 'G') DATA, | |
CONCAT(ROUND(index_length / ( 1024 * 1024 * 1024 ), 2), 'G') idx, | |
CONCAT(ROUND(( data_length + index_length ) / ( 1024 * 1024 * 1024 ), 2), 'G') total_size, | |
ROUND(index_length / data_length, 2) idxfrac | |
FROM information_schema.TABLES | |
ORDER BY data_length + index_length DESC | |
LIMIT 10; |
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
# BEGIN WordPress | |
<IfModule mod_rewrite.c> | |
# Single site Rules (with image pass-back) | |
################################################### | |
RewriteEngine On | |
RewriteBase / | |
RewriteRule ^index\.php$ - [L] | |
# if it is an image that doesn't exist, try prod |
NewerOlder