Skip to content

Instantly share code, notes, and snippets.

View macbookandrew's full-sized avatar

Andrew Minion macbookandrew

View GitHub Profile
@macbookandrew
macbookandrew / readme.md
Last active January 11, 2017 16:32
Kindle Notes to HTML/Evernote

Copy/paste all the notes from kindle.amazon.com into a text file.

  • Find/replace regex \n with </p>\n<p>
    • Add a <p> at the top line of the file and a </p> at the end
  • Find/replace regex Read more at location ([0-9]+) with <br/>\n<a href="kindle://book?action=open&asin=***&location=$1">Read more at location $1</a></p> where *** is the book’s ASIN number
  • Find/replace regex • Delete this highlight</p>\n<p>Add a note</p> with nothing
  • Add <html><meta charset="UTF-8"/><body> at the top of the file and </body></html> at the bottom of the file, deleting anything extra at the top and bottom
    • If desired, add some simple styling, such as the following: <style>body {font-family: 'Helvetica Neue'; font-size: 14px;}</style>
  • Save the file with the .html extension
@macbookandrew
macbookandrew / functions.php
Created June 21, 2016 19:13
Prevent YouTube embedded videos from showing related videos at the end
/* Prevent YouTube Related Content on oEmbed-ed videos */
add_filter( 'oembed_result', 'prevent_featured_youtube_videos' );
function prevent_featured_youtube_videos( $embed ) {
return str_replace( '?feature=oembed', '?feature=oembed&rel=0', $embed );
}
@macbookandrew
macbookandrew / slack-epoch-comments.php
Last active May 11, 2017 20:01
Add Slack notifications for comments posted via the Epoch comment system
<?php
/*
Plugin Name: Slack Epoch Comments
Plugin URI: https://gist.github.com/macbookandrew/7f41ff7d4b28300f19bd
Description: Adds Slack notifications for comments posted via the Epoch comment system
Version: 1.1.2
Author: AndrewRMinion Design
Author URI: https://andrewrminion.com
*/
@macbookandrew
macbookandrew / merge-minify-refresh-async.php
Last active May 11, 2017 20:20
Force merged scripts created by “Merge + Minify + Refresh” to load asynchronously to improve site performance
<?php
/*
* Plugin Name: Merge + Minify + Refresh: Force Async Scripts
* Plugin URL: https://gist.github.com/macbookandrew/0bb0c29b2321c166845cea0b7cdb5d15
* Description: Forces merged scripts created by “Merge + Minify + Refresh” to load asynchronously to improve site performance
* Version: 1.0.0
* Author: AndrewRMinion Design
* Author URI: https://andrewrminion.com
*/
@macbookandrew
macbookandrew / wpforms-recaptcha-async.php
Created May 11, 2017 20:52
Force the WPForms Google Recaptcha script to load asynchronously to improve site performance
<?php
/*
* Plugin Name: WPForms: Force Async Scripts
* Plugin URL: https://gist.github.com/macbookandrew/30eb660833192066e5ea7691fc735e9f
* Description: Force the WPForms Google Recaptcha script to load asynchronously to improve site performance
* Version: 1.0.0
* Author: AndrewRMinion Design
* Author URI: https://andrewrminion.com
*/
@macbookandrew
macbookandrew / tribe-events-the_grid.php
Last active June 1, 2017 19:16
Adds dates to [the_grid] shortcode output for Modern Tribe’s The Events Calendar
<?php
/*
* Plugin Name: The Events Calendar + The Grid
* Version: 1.0
* Description: Adds dates to [the_grid] shortcode output for Tribe Events
* Author: AndrewRMinion Design
* Author URI: https://andrewrminion.com
* Plugin URI: https://gist.github.com/macbookandrew/8aedd7809ddf89fabb6fc66a19bd0318
* License: GPL2
*/
@macbookandrew
macbookandrew / sermon-manager-tax-archives.php
Last active August 16, 2017 19:17
WP plugin: shortcodes to create faux archive pages for all custom Sermon Manager taxonomies
<?php
/**
* Plugin Name: Sermon Manager Taxonomy Archives
* Plugin URI: https://gist.github.com/macbookandrew/62733a780899bb61773188641f4813de
* Description: Shortcode to create faux custom taxonomy archives; example: [sermon_tax_archive taxonomy="wpfc_preacher"]
* Version: 1.0.0
* Author: AndrewRMinion Design
* Author URI: https://andrewrminion.com
* Copyright: 2017 AndrewRMinion Design
@macbookandrew
macbookandrew / wp-amplify-ga-tracking.php
Last active September 11, 2017 16:29
Basic Google Analytics tracking for mailto: links
<?php
/**
* Plugin Name: WPAmplify GA Tracking
* Plugin URI: https://gist.github.com/macbookandrew/84ce54d73713d82b390fc9dc29b19e12/
* Description: Basic Google Analytics tracking for mailto: links
* Version: 1.0.0
* Author: AndrewRMinion Design
* Author URI: https://andrewrminion.com
* Copyright: 2017 AndrewRMinion Design
@macbookandrew
macbookandrew / 0 - readme.md
Last active December 26, 2017 19:00
WooCommerce Downloadable Files: Grant Access for New Files to Previous Customers
@macbookandrew
macbookandrew / WooCommerce Redirects.md
Last active March 13, 2018 11:15
WooCommerce conditionally redirect before checkout page

Purpose

These tweaks build on these directions to allow for full-page customizable Smart Offers.

How to Use

  1. Disable “Enable guest checkout” on the WooCommerce > Settings > Checkout tab
  2. Enable “Automatically generate customer password” on the WooCommerce > Settings > Accounts tab
  3. Set up Smart Offers as normal, choosing the “Any other page where shortcode is added” checkbox for “Show this Offer on:”.
  4. Create a new page to be used for showing the Smart Offers and customize as desired with theme templates, etc. Include the shortcode [so_show_offers] in the page content and make note of the page URL as you’ll need it in the WooCommerce plugin modification.