Skip to content

Instantly share code, notes, and snippets.

View macbookandrew's full-sized avatar

Andrew Minion macbookandrew

View GitHub Profile
@macbookandrew
macbookandrew / church-pack.css
Last active August 29, 2015 14:05
WP for Church - Church Pack Pro Events - show six months at a time
/* add this below line 146 */
#church-pack .calentries {
margin-bottom: 60px;
}
@macbookandrew
macbookandrew / functions.php
Last active August 29, 2015 14:06
WordPress—deregister built-in webfonts
// deregister Bitter and Open Sans webfonts only
function deregister_default_fonts() {
wp_deregister_style( 'twentythirteen-fonts' );
}
add_action( 'wp_enqueue_scripts', 'deregister_default_fonts', 100 );
// remove default fonts, add custom fonts, and use a custom minified stylesheet and register but don’t enqueue style.css with all the theme information
function add_custom_css() {
wp_enqueue_style( 'theme-style', get_stylesheet_directory_uri() . '/style.min.css' );
wp_dequeue_style( 'twentythirteen-style' );
@macbookandrew
macbookandrew / functions.php
Created October 2, 2014 20:48
point search engines from dev to live WordPress site via rel="canonical"
/*
* Dev site: point search engines at live site
*/
// set subdomain
$subdomain = 'dev';
// test whether or not this is a dev site
if ( strpos( get_site_url(), $subdomain . '.' ) !== false ) {
remove_action( 'wp_head', 'rel_canonical' );
@macbookandrew
macbookandrew / deploy.sh
Last active August 29, 2015 14:07 — forked from kloon/deploy.sh
WordPress Plugin deploy script - fixes for hard drives with a space in the name
#! /bin/bash
# A modification of Dean Clatworthy's deploy script as found here: https://github.com/deanc/wordpress-plugin-git-svn
# The difference is that this script lives in the plugin's git repo & doesn't require an existing SVN repo.
# main config
PLUGINSLUG="plugin-slug"
CURRENTDIR=`pwd`
MAINFILE="main-file.php" # this should be the name of your main php file in the wordpress plugin
# git config
@macbookandrew
macbookandrew / backup-to-Glacier.sh
Last active March 3, 2024 13:36
Ubuntu incremental encrypted backups to S3/Glacier
#!/bin/bash
#
# Note, to pull a file from s3 use "s3cmd get s://bucket/file destinationfile"
# You must have the proper .s3cfg file in place to decrypt the file.
# You may also use "gpg encryptedfile" and supply the encryption code if you download
# from the web interface. Good luck.
# The bucket should be set to transfer to Glacier. To retreive, you need to initiate a
@macbookandrew
macbookandrew / style.scss
Created April 3, 2015 18:25
amr calendar events list - responsive
.largecalendar caption {
font-size: 28px;
text-align: center;
}
#calprop0 {
display: none;
}
.calendar_navigation input {
@macbookandrew
macbookandrew / readme.md
Last active March 8, 2020 19:31
PHP cURL proxy for Ajax—Infusionsoft

Introduction

This is a PHP proxy to submit Ajax requests to Infusionsoft.

Usage

  1. Set your Infusionsoft app id, thank-you message, and path to the cacert.pem bundle in infusionsoft-proxy-settings.php.
  2. Add the Infusionsoft form IDs in infusionsoft-proxy.php, creating new lines as necessary
  3. Include the functions.js in your javascript, making sure to replace the $form variable with the selector(s) you need.
@macbookandrew
macbookandrew / functions.php
Last active November 19, 2015 16:05
Remove all custom header output from 2013 WordPress theme
function remove_custom_header() {
remove_theme_support( 'custom-header' );
}
// the number 12 is key here - the custom header is added with priority 11, so this has to fire after that function in order to remove it
add_action( 'after_setup_theme', 'remove_custom_header', 12 );
@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 / disable-password-autocomplete.php
Created June 19, 2015 13:24
Wordpress - disable login password autocomplete (PCI compliance)
<?php
/**
* Plugin Name: Disable login autocomplete
* Description: Disable login password autocomplete
* Version: 1.0
* Author: Benjamin Uzelac
* Author URI: https://buzelac.com
* License: WTFPL
*/