Skip to content

Instantly share code, notes, and snippets.

View MikeiLL's full-sized avatar

Mike iLL Kilmer MikeiLL

View GitHub Profile
@MikeiLL
MikeiLL / taxonomy-breadcrumbs.php
Last active September 11, 2017 15:07
WordPress custom taxonomy breadcrumbs based on deepest term.
<?php
if( !function_exists( 'inspiry_get_breadcrumbs_items' ) ) :
/**
* Returns a array of breadcrumbs items
*
* @param $post_id int Post id
* @param $breadcrumbs_taxonomy string Taxonomy name
* @return mixed|void
*/
function inspiry_get_breadcrumbs_items( $post_id, $breadcrumbs_taxonomy ) {
function dumpdb()
{
# source https://stackoverflow.com/a/46042938/2223106
# source https://gist.github.com/spalladino/6d981f7b33f6e0afe6bb
local wkdir=`basename $PWD`
local container='echo ${wkdir}_my-wpdb_1'
docker exec ${container} mysqldump -uroot --password=password wordpress > backup.sql
}
function restoredb()
#/usr/bin/bash
# Loop through jpg images and apply sips, mkbitmap and potrace
# http://potrace.sourceforge.net/
if [ $1 == '--help' ]; then
echo "Two optional parameters: filename and threshold. Otherwise vectorizes as .jpg in current dir.";
exit 1;
fi
/**
* Generate single crumb html
*
* @since 3.6.0
*/
public static function get_crumb_html( $label, $link, $class = '', $rel = '' ) {
$scope = self::get_scope();
$class = $class ? ' class="'. esc_attr( $class ) .'"': '';
$rel = $rel ? ' rel="'. esc_attr( $rel ) .'"': '';
return '<span '. $scope . $class . $rel .'><a href="'. esc_url( $link ) .'" title="'. esc_attr( $label ) .'" itemprop="url" content="'. esc_url( $link ) .'"><span itemprop="title">'. esc_html( $label ) .'</span></a></span>';
/**
* Add & remove image sizes from the "Image Sizes" panel
*
* @since 1.0.0
* source: https://wpexplorer-themes.com/total/snippets/addremove-image-sizes/
*/
public static function cpt_image_sizes( $sizes ) {
// Remove "blog_post_full" image size
unset( $sizes['blog_post_full'] );
#!/bin/bash
# Read more: https://medium.com/@tatemz/using-wp-cli-with-docker-21b0ab9fab79#.bzqhqfa6a
# Also see https://github.com/chriszarate/docker-wordpress
if [ $# -eq 0 ] ; then
echo usage: directory_name
else
WPDIR="$1"
mkdir "$WPDIR" && cd "$WPDIR"
cat >> docker-compose.yml <<EOL
@MikeiLL
MikeiLL / Contract Killer 3.md
Last active March 23, 2017 23:15
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web professionals by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: March 15th 2016
  • Original post

#!/bin/bash
# Read more: https://medium.com/@tatemz/using-wp-cli-with-docker-21b0ab9fab79#.bzqhqfa6a
# Also see https://github.com/chriszarate/docker-wordpress
if [ $# -eq 0 ] ; then
echo usage: directory_name
else
WPDIR="$1"
mkdir "$WPDIR" && cd "$WPDIR"
cat >> docker-compose.yml <<EOL
<?php
require_once('../lists/admin/PHPMailer/PHPMailerAutoload.php');
//include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded
$mail = new PHPMailer();
$body = file_get_contents('contents.html');
$body = eregi_replace("[\]",'',$body);
$mail->IsSMTP(); // telling the class to use SMTP
blockquote, blockquote p {
font-family: Hoefler Text,Baskerville Old Face,Garamond,Times New Roman,serif !important;
font-style: normal;
font-variant: normal;
font-weight: 500;
display: block;
margin-left: auto;
margin-right: auto;
}
blockquote p cite {