Skip to content

Instantly share code, notes, and snippets.

@benvisser
benvisser / Wordpress Rewrite Rules Example
Created October 11, 2012 02:13
Sample Wordpress rewrite rule filters
///////////////////////////////////
// Rewrite Rules
///////////////////////////////////
//rewrite rules
add_filter('rewrite_rules_array','wp_insertMyRewriteRules');
add_filter('query_vars','wp_insertMyRewriteQueryVars');
add_filter('init','flushRules');
// Remember to flush_rules() when adding rules
@benvisser
benvisser / gist:7144492
Last active December 26, 2015 11:29
Advanced Custom Field State Dropdown with abbreviated values
AL : Alabama
AK : Alaska
AZ : Arizona
AR : Arkansas
CA : California
CO : Colorado
CT : Connecticut
DE : Delaware
DC : Dist of Columbia
FL : Florida
@benvisser
benvisser / gist:7338546
Created November 6, 2013 15:54
Add inline Droplr previews to Propane for mac. Go to the propane application, command click and choose show package contents. Click Contents > Resources > enhancer.js. Add the code to the bottom of this file inside of window.propane. Just know that when you update propane this file will get overwritten and you'll have to do this again.
/*
Display Droplr images inline.
This responder illustrates using Propane's requestJSON service to request
JSON from remote (non-authenticated) servers and have the results passed
to a callback of your choosing.
*/
var displayDroplrImages = true;
//section padding mixin
//you'll need breakpoint and to set your breakpoint variables as well
//usage @include pad(60, 60);
@mixin pad($topValue: 140, $bottomValue: 140) {
padding-top: $topValue / 2 + px;
padding-bottom: $bottomValue / 2 + px;
@include breakpoint($small) {
//font size mixin for using rems with px fallback
//usage: @include font-size(1.2);
@mixin font-size($sizeValue: 1.6) {
font-size: ($sizeValue * 10) + px;
font-size: $sizeValue + rem;
}