Skip to content

Instantly share code, notes, and snippets.

<code />

Greg Rickaby gregrickaby

<code />
Block or report user

Report or block gregrickaby

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View cmb2_add_field.sublime-snippet
->add_field( array(
'name' => __( '${1:Field Name}', '${2:textdomain}' ),
'id' => \$prefix . '${3:field_id}',
'type' => '${4:cmb2_field_type}',
'desc' => __( '${5:Description of the field.}', '${2:textdomain}' ),
${6:'options' =>} ${7:${8:array of options or callback function},}
${9:'attributes' =>} ${10:${11:array of attributes},}
${12:'default' =>} ${13:'${14:default_value}',}
aubreypwd / jsClass.jQuery.js
Last active Dec 1, 2016
How to create a Js application as a jQuery plugin
View jsClass.jQuery.js
( function( $ ) {
// Create a jQuery Object.
$.fn.myObject = function() {
var $target = this; // Store the target element in this variable (jQuery stuff).
// Our stuff.
var application = {
JayWood / fix_msword.php
Last active Aug 29, 2015
Fixes MS Word data
View fix_msword.php
* fixMSWord
* Replace ascii chars with utf8. Note there are ascii characters that don't
* correctly map and will be replaced by spaces.
* Updated 7-15-2015 by Jay Wood to encode lower end items into HTML entity counterparts.
* @author Robin Cafolla,Jay Wood
* @date 2013-03-22
ericandrewlewis / gist:95239573dc97c0e86714
Last active Oct 8, 2019
Setting up a WordPress site on AWS
View gist:95239573dc97c0e86714

Setting up a WordPress site on AWS

This tutorial walks through setting up AWS infrastructure for WordPress, starting at creating an AWS account. We'll manually provision a single EC2 instance (i.e an AWS virtual machine) to run WordPress using Nginx, PHP-FPM, and MySQL.

This tutorial assumes you're relatively comfortable on the command line and editing system configuration files. It is intended for folks who want a high-level of control and understanding of their infrastructure. It will take about half an hour if you don't Google away at some point.

If you experience any difficulties or have any feedback, leave a comment. 🐬

Coming soon: I'll write another tutorial on a high availability setup for WordPress on AWS, including load-balancing multiple application servers in an auto-scaling group and utilizing RDS.

colorful-tones / element-in-viewport.js
Last active Sep 4, 2016
Simple wayfinder js to see if element is in viewport, and add classes or remove based on if it is.
View element-in-viewport.js
// check if element is in viewport
// if so, then add/remove class
(function($) {
// function to check if element is in viewport
function inViewport(element) {
if (typeof jQuery === "function" && element instanceof jQuery) {
element = element[0];
bradp /
Last active Oct 16, 2019
New Mac Setup Script
echo "Creating an SSH key for you..."
ssh-keygen -t rsa
echo "Please add this public key to Github \n"
echo " \n"
read -p "Press [Enter] key after this..."
echo "Installing xcode-stuff"
xcode-select --install
jtsternberg / wds-include-tlc-transients.php
Last active Aug 29, 2015
tlc-transients helper functions
View wds-include-tlc-transients.php
// Include tlc lib
require_once WPMU_PLUGIN_DIR . '/wp-tlc-transients/tlc-transients.php';
* Use in place of `get_posts`
* @param array $args Array of get_posts arguments
* @param integer $time Amount of time before cache expires
jtsternberg / $-cache.js
Last active Sep 13, 2018
jQuery selector cache with reset (original: If commenting, please ping me on Twitter, same username.
View $-cache.js
function Selector_Cache() {
var collection = {};
function get_from_cache( selector, reset ) {
if ( undefined === collection[ selector ] || true === reset ) {
collection[ selector ] = jQuery( selector );
return collection[ selector ];
nickdavis / gist:10525079
Created Apr 12, 2014
.htaccess 301 redirect local WordPress dev site images folder to live website images folder (to save fllling up local drive with 1000's of unnecessary images)
View gist:10525079
#301 Redirect Local Images to Live
RedirectMatch 301 ^/wp-content/uploads/(.*)$1
You can’t perform that action at this time.