Skip to content

Instantly share code, notes, and snippets.

View gregrickaby's full-sized avatar
:octocat:

Greg Rickaby gregrickaby

:octocat:
View GitHub Profile
@luetkemj
luetkemj / style.css
Created March 9, 2012 16:32
WP-CSS: Wordpress classes
/* =============================================================================
WordPress WYSIWYG Editor Styles
========================================================================== */
.entry-content img {
margin: 0 0 1.5em 0;
max-width: 100%;
height: auto;
}
.alignleft, img.alignleft {
@nickdavis
nickdavis / gist:10525079
Created April 12, 2014 08:41
.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)
#301 Redirect Local Images to Live
RedirectMatch 301 ^/wp-content/uploads/(.*) http://livewebsite.com/wp-content/uploads/$1
@aubreypwd
aubreypwd / jsClass.jQuery.js
Last active December 1, 2016 16:11
How to create a Js application as a jQuery plugin
( function( $ ) {
// Create a jQuery Object.
$.fn.myObject = function() {
var $target = this; // Store the target element in this variable (jQuery stuff).
// Our stuff.
var application = {
/**
@colorful-tones
colorful-tones / element-in-viewport.js
Last active September 4, 2016 13:23
Simple wayfinder js to see if element is in viewport, and add classes or remove based on if it is.
// check if element is in viewport
// if so, then add/remove class
// http://stackoverflow.com/questions/123999/how-to-tell-if-a-dom-element-is-visible-in-the-current-viewport/7557433#7557433
(function($) {
// function to check if element is in viewport
function inViewport(element) {
if (typeof jQuery === "function" && element instanceof jQuery) {
element = element[0];
@jazzsequence
jazzsequence / cmb2_add_field.sublime-snippet
Last active July 11, 2016 21:21
Sublime Text snippets
<snippet>
<content><![CDATA[
->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}',}
@JayWood
JayWood / fix_msword.php
Last active August 29, 2015 14:25
Fixes MS Word data
/**
* 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
@jtsternberg
jtsternberg / wds-include-tlc-transients.php
Last active August 29, 2015 14:07
tlc-transients helper functions
<?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