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_filter( 'site_option_active_sitewide_plugins', | |
function( $value ) { | |
// Lookup the current site object global | |
$current_blog; | |
// This would disable the plugins on sites with ID's 2, 3 and 5 | |
if ( in_array( $current_blog->blog_id, [ 2, 3, 5 ] ) ) { |
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
server { | |
server_name apollo; | |
listen 80 default_server; | |
listen 443 ssl default_server; | |
ssl_certificate ssl/selfsigned.crt; | |
ssl_certificate_key ssl/selfsigned.key; | |
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; |
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 | |
/* Obviously, add this to a function that hooks into wp_enqueue_scripts() (or admin_enqueue_scripts()) */ | |
wp_enqueue_style( 'main', get_stylesheet_directory_uri() . '/style.css', false, filemtime( get_stylesheet_directory() . '/style.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
<?php | |
/** | |
* @package Improve WP Signup - redirect to the main network URL with referral parameters | |
* @author James Morrison | |
* | |
* The WP core /wp-signup.php file calls "get_header( 'wp-signup' );" we can hook into this to force a redirect | |
* Add this as a MU Plugin, make sure NOBLOGREDIRECT is *not* defined as it'll override this | |
* | |
* Notes: | |
* Whilst you can set up a redirect from the NOBLOGREDIRECT constant, the advantage of using this |
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 | |
/** | |
* @package Header for WP Signup | |
* @author James Morrison | |
* @link https://gist.github.com/jamesmorrison/5f8a3108b2a773cd07db430b73992e9d/edit | |
* | |
* This file is called by the WP core /wp-signup.php file; we can force a redirect from here | |
* | |
* Whilst you can do this from the NOBLOGREDIRECT constant, the advantage of using this header | |
* file is that you can capture the path that triggered the call to signup; as seen in the example |
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: Admin Bar Site ID | |
* Description: Add the current site ID to the Admin Bar | |
* Version: 1.0.3 | |
* Author: James Morrison | |
* Author URI: https://www.jamesmorrison.me/ | |
**/ | |
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: Rewrite Search URL's | |
* Description: Rewrite search URL's to "pretty" permalinks. A custom permalink structure must be set. | |
* Version: 1.0.1 | |
* Author: James Morrison | |
* Author URI: https://www.jamesmorrison.me/ | |
* | |
**/ |
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
if [ -f ~/.bashrc ]; then | |
source ~/.bashrc | |
fi |
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: Cache Controller | |
* Plugin URI: # | |
* Description: HTTP Cache Control headers for WordPress. | |
* Version: 0.0.1 | |
* Author: James Morrison | |
* Author URI: https://james.morrison.me/ | |
**/ |
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
## CMD PROMPT | |
green=$(tput setaf 2) | |
blue=$(tput setaf 4) | |
white=$(tput setaf 7) | |
bold=$(tput bold) | |
reset=$(tput sgr0) | |
PS1='${debian_chroot:+($debian_chroot)}\[$green\]MAC\[$reset\]:\[$white\]\w\[$reset\]\[$green\]$(parse_git_branch)\[$reset\]\$ ' |