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
from PIL import Image | |
import getopt | |
import os | |
import shutil | |
import sys | |
def process_images(argv): | |
arg_help = "{0} -i <input_folder> -o <output_folder> -a -c -d <delimiter> -f -s".format(argv[0]) | |
# Args |
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_shortcode( 'button', 'wpbs_button', 10, 2 ); | |
if ( ! function_exists( 'wpbs_button' ) ) { | |
/** | |
* Custom Button | |
* | |
* Add an inline button to content, with customizeable CSS classes, and | |
* link to a page by `page-id` or URL. | |
* | |
* [button class="btn-primary"]My Button Text[/button] | |
* |
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
# Location: /mnt/c/windows/system32/drivers/etc/hosts | |
127.0.0.1 virtualhost.local www.virtualhost.local |
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
/** | |
* Set Carousel Item heights | |
* | |
* The following jQuery sets the height of each `.carousel-item` | |
* to the height of the largest carousel item in the set. This | |
* prevents unusual resizing issues for dynamic text lengths. | |
*/ | |
(function($) { | |
function setCarouselHeight($carousel) { | |
var id = $carousel.attr("id"); |
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 the following to your theme's `functions.php` to automatically add `img-fluid` class | |
* to all images inserted using the "Add Media" upload button in WordPress editor. | |
*/ | |
if ( ! function_exists( 'add_bootstrap_class_to_images' ) ) { | |
function add_bootstrap_class_to_images( $html, $attachment_id, $attachment ) { | |
$img_element = "/<img[^>]*>/"; | |
$found = preg_match( $img_element, $html, $image ); | |
// If no image, do nothing |
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: Leadership Team Custom Post Type | |
Plugin URI: https://github.com/monkishtypist | |
Description: This `mu-plugin` class creates a new custom post type for Leadership Team. | |
Version: 1.0 | |
Author: Tim Spinks @monkishtypist | |
Author URI: https://github.com/monkishtypist | |
*/ |
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: Anywhere | |
# Add existing 'ubuntu' user to 'www-data' group | |
sudo usermod -a -G www-data ubuntu; | |
# Set the ownership of the files/directories | |
sudo chown -R www-data:www-data /var/www/html/; | |
# Set group ownership inheritance |
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: FAQs Custom Post Type | |
Plugin URI: https://github.com/monkishtypist | |
Description: This `mu-plugin` class creates a new custom post type for Frequently Asked Questions. | |
Version: 1.0 | |
Author: Tim Spinks @monkishtypist | |
Author URI: https://github.com/monkishtypist | |
*/ |
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
/* Simple Bootstrap jQuery Exit Pop | |
* Trigger an existing Bootstrap modal on mouseleave() | |
*/ | |
/* This first version uses a variable to determine when to trigger pop. */ | |
(function(){ | |
var pop = false; /* it has not pop'd */ | |
jQuery(document).mouseleave(function(){ | |
if(!pop || typeof pop === 'undefined'){ | |
jQuery('#myModal').modal('show'); /* show the modal */ |