Skip to content

Instantly share code, notes, and snippets.

View morganestes's full-sized avatar

Morgan Estes morganestes

View GitHub Profile
@morganestes
morganestes / openpgp.txt
Created January 13, 2016 13:25
OpenKeychain Linked Identity
This Gist confirms the Linked Identity in my OpenPGP key, and links it to this GitHub account.
Token for proof:
[Verifying my OpenPGP key: openpgp4fpr:fec64e0b77737647fa0c5b34bb579336dd3efab9]
@morganestes
morganestes / add_current_path_to_phpcs.sh
Created January 30, 2016 05:56
Add the current directory to the list of PHP_CodeSniffer standards
phpcs_ipath=$(phpcs --config-show installed_paths); oldpath=${phpcs_ipath##*:}; phpcs --config-set installed_paths ${oldpath},$(pwd)
@morganestes
morganestes / aria-general-template.php
Last active February 9, 2016 16:40
WP ARIA checked helpers
<?php
/**
* Outputs the html aria-checked attribute.
*
* Compares the first two arguments and if identical marks as checked
*
* @since 2016-02-08
* @see checked()
*
* @param mixed $checked One of the values to compare.
@morganestes
morganestes / wpcs
Last active July 1, 2016 20:19
Creates a shortcut to use the WordPress Coding Standards with PHP Code Sniffer
#!/usr/bin/env bash
COMPOSER_GLOBAL_VENDOR=$(composer global config -n --absolute --ansi -- vendor-dir)
"$COMPOSER_GLOBAL_VENDOR/wp-coding-standards/wpcs/vendor/bin/phpcs" --standard=WordPress --colors "$@"
@morganestes
morganestes / geoip
Last active July 28, 2016 21:09
Geolocation for an IP or URL.
#!/bin/sh
geoip(){
ip=$1 || curl https://icanhazip.com
curl "https://freegeoip.net/json/${ip}"
}
geoip "$@"
@morganestes
morganestes / foo.sh
Created September 15, 2016 02:54
Update a directory full of Subversion repos
find . -type d -depth 1 -exec svn up {} \;
@morganestes
morganestes / jquery.foundation-media-query-classes.js
Last active February 27, 2017 20:22
Add HTML classes to body element when window resizes
/**
* Add classes to the DOM based on the current media query size defined by Foundation breakpoints.
*/
(function fdnMQClasses( window, document, $, undefined ) {
var foundationPrefix = 'fdn-size-';
// Add the class on page load.
$( document ).ready( function () {
$( 'body' ).addClass( foundationPrefix + Foundation.MediaQuery.current );
} );
hosts:
- wpdev.local
apt_mirror: true
php: 5.6
extensions:
- Chassis/Tester
- Chassis/memcache
- Chassis/MailHog
- Chassis/Cavalcade
- Chassis/Xdebug
@morganestes
morganestes / add-dev-cert.sh
Created March 15, 2017 18:32
Add a locally-generated SSL cert to the macOS keychain
sudo security add-trusted-cert -d -r trustRoot -p ssl -k /Library/Keychains/System.keychain /path/to/local.cert