This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* SQL query using $wpdb->prepare to protect it from sql injection | |
*/ | |
private function get_users_pending( $user_id ) { | |
global $wpdb; | |
$the_post_type = 'post'; | |
$status = 'pending'; | |
return $wpdb->get_results( $wpdb->prepare( "SELECT ID, post_title FROM $wpdb->posts WHERE post_type = %s AND post_status = %s AND post_author = %s ORDER BY post_modified DESC", $the_post_type, $status, $user_id ) ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Clean the dashes from a UUID to a create | |
a resonably acceptable API Token | |
""" | |
import uuid | |
uuidtoken = str(uuid.uuid4()) | |
token = filter(lambda x: x != '-', uuidtoken) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Global Unique ID for Gravity Perks | |
Plugin URI: http://www.prontomarketing.com | |
Description: Adds the ability to set a starting ID for sequential Unique IDs. | |
Version: 0.1 | |
Author: Pronto Marketing | |
Author URI: http://www.prontomarketing.com | |
*/ | |
if (class_exists("GFForms")) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Add this to your theme or wherever you feel comfortable. | |
* It will return the user to the form on the page when | |
* validation fails. | |
**/ | |
if ( is_plugin_active( 'gravityforms/gravityforms.php') ){ | |
add_filter( 'gform_confirmation_anchor', '__return_true' ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PIL import Image | |
from django.db import models | |
from django.conf import settings | |
from imagekit import ImageSpec, register | |
from imagekit.models import ImageSpecField | |
from imagekit.processors import ResizeToFit | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.conf import settings | |
from django.core.mail import EmailMessage,EmailMultiAlternatives | |
from django.template import Context, Template | |
from django.utils.html import strip_tags | |
from django.template.loader import get_template | |
from premailer import Premailer | |
from drip.drips import DripMessage | |
class DefaultDripEmail(DripMessage): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.vm.box = "ubuntu/trusty64" | |
config.vm.network :private_network, ip: "192.168.22.100" | |
config.vm.provider :virtualbox do |vb| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'premailer' | |
module Jekyll | |
class Site | |
#declare plugin properties | |
#safe true | |
#priority :low | |
# create an alias for the overriden site::write method | |
alias orig_write write |
NewerOlder