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 | |
// This is where the magic happens! | |
function track_link($slug,$values) | |
{ | |
global $wpdb, $prli_click, $prli_options, $prli_link, $prli_update; | |
$query = "SELECT * FROM ".$prli_link->table_name." WHERE slug='$slug' LIMIT 1"; | |
$pretty_link = $wpdb->get_row($query); | |
$pretty_link_target = apply_filters('prli_target_url',array('url' => $pretty_link->url, 'link_id' => $pretty_link->id)); | |
$pretty_link_url = $pretty_link_target['url']; |
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 | |
function is_robot(&$click,&$browsecap,$header='') | |
{ | |
global $prli_utils, $prli_click, $prli_options; | |
$ua_string = trim(urldecode($click->browser)); | |
$btype = trim($click->btype); | |
// Yah, if the whole user agent string is missing -- wtf? | |
if(empty($ua_string)) | |
return 1; |
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
vagrant box add caseproof-lamp https://s3.amazonaws.com/caseproof/caseproof-lamp.box | |
vagrant init caseproof-lamp | |
vagrant up |
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
# Uses a depth first traversal algorithm to generate a maze | |
# You can change the width & height by altering the w & h variables | |
w=24;h=12;g=[];v=[] | |
# Setup the grid | |
(h+1).times{|y|g[y]=[];(w+1).times{|x|g[y]<<[x==w ? 0 : 1,y==h ? 0 : 1]}} | |
# Opening for the start and end & set the end cell | |
g[h][w-1][0]=g[0][0][0]=0;c=[w-1,h-1] | |
# Where the magic happens | |
def t(c,v,w,h,g) | |
# add cell to visited & get list of neighbors |
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 | |
add_action('init', 'fpm_start_output'); | |
add_action('shutdown', 'fpm_end_output'); | |
function fpm_start_output() { | |
ob_start('fpm_mod_buffer'); | |
} | |
function fpm_mod_buffer($buffer) { | |
// Modification ... regexp, etc |
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: MemberPress Lifetime Trial | |
Plugin URI: http://memberpress.com | |
Description: Creates a lifetime subscription from a 1 year subscription + a *free* trial. This basically cancels the subscription after the first real payment | |
Version: 1.0.0 | |
Author: Caseproof, LLC | |
Author URI: http://caseproof.com | |
Text Domain: memberpress | |
Copyright: 2004-2013, Caseproof, LLC |
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 | |
// TRIM PARAMS FROM REQUEST_URI | |
$request_uri = preg_replace('#\?.*#','',$_SERVER['REQUEST_URI']); | |
preg_match('#^https?://[^/]+(/.*)?#', home_url(), $matches); | |
$pre_slug = isset($matches[1])?$matches[1]:''; | |
if( !empty($plugin) and $plugin == 'wafp' and | |
!empty($controller) and !empty($action) ) | |
{ | |
self::standalone_route($controller, $action); |
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: MemberPress Custom Membership Signup | |
Plugin URI: http://memberpress.com | |
Description: Adds some custom fields to the MemberPress signup process | |
Version: 1.0.0 | |
Author: MemberPress | |
Author URI: http://memberpress.com | |
Text Domain: memberpress | |
*/ |
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 | |
if(!defined('ABSPATH')) {die('You are not allowed to call this page directly.');} | |
/** This is a controller that handles all of the DigLabs Stripe Payment | |
* specific public static functions for Affiliate Royale. | |
*/ | |
class WafpDigLabsStripePaymentsController { | |
public static function load_hooks() { | |
if(function_exists( 'stripe_register_payment_end_callback' )) |
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
# Requires the HTTParty, Stripe & Sinatra gems | |
require 'httparty' | |
require 'stripe' | |
require 'time' | |
require 'csv' | |
require 'sinatra' | |
# NOTE: This script also requires tht you set a ENV['LIVE_STRIPE_SECRET'] | |
# environment variable with your Live Secret Key from your Stripe Dashboard |
OlderNewer