This file contains hidden or 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
$( "form" ).on( "submit", function(e) { | |
e.preventDefault(); | |
var formdata = $(this).serializeArray(); | |
// do something cool here | |
}); |
This file contains hidden or 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 | |
define('FBAUTH_FB_OAUTH_URL', 'https://www.facebook.com/dialog/oauth'); | |
define('FBAUTH_FB_OAUTH_TOKEN_URL', 'https://graph.facebook.com/oauth/access_token'); | |
define('FBAUTH_FB_GRAPH_DEBUG_TOKEN_URL', 'https://graph.facebook.com/debug_token'); | |
define('FBAUTH_FB_GRAPH_PROFILE_URL', 'https://graph.facebook.com/me'); | |
define('FBAUTH_FB_APP_ID', 'xxxx'); | |
define('FBAUTH_FB_APP_SECRET', 'xxxx'); | |
function fbauth_get_fb_token($code) { | |
global $post; |
This file contains hidden or 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
# Maze Generating Tweet? Gah | |
#|--| Top=even/Left=odd | |
#|-----------| Row %(w+1) | |
#1,1,1,1,1,1,1,1 | |
#w=6;h=3;m=(w+1)*3;n=(h+1)*3;g=[];s=m*n;s.times{|i|g<<(((i%m==(m-2))or(i%3==2)or(i>(s-m)))? 0: 1)} | |
#c=(s-3);(w*h).times({ s[(c+2)]=1; x=[(c>m)? (c-m): nil,(c%m==(m-3))? c+3: nil,c<(s-m)? c+m : nil,(c%m>0)? c-3: nil].compact.map{|j|j if(j[2]==0)}.sample;(x>(c+3))? g[x]=0: (x>c)? g[x+1]=0: (x<(c-3))? g[c]=0: g[c+1]=0;c=x}) | |
#(w*h*2).times(|i|((i%2)==0)? print '+'+((g[(i/2)*3]==0)? " ": "-"): print ((g[((i/2)*3)+1]==0)? " ": "|")+' ') | |
w=80;h=40;g=[];v=[] | |
(h+1).times{|y|g[y]=[];(w+1).times{|x|g[y]<<[x==w ? 0 : 1,y==h ? 0 : 1]}} |
This file contains hidden or 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(MeprUtils::is_user_logged_in()) | |
{ | |
$user = MeprUtils::get_currentuserinfo(); | |
$products = $user->active_product_subscriptions('products'); | |
foreach($products as $product) { | |
if( !empty( $product->access_url ) ) { | |
?> | |
<a href="<?php echo $product->access_url; ?>"><?php echo $product->post_title; ?></a><br/> |
This file contains hidden or 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('mepr-txn-status-complete', 'mapsn_notification'); | |
function mapsn_notification($txn) { | |
global $wpdb; | |
$mepr_db = new MeprDb(); | |
$usr = $txn->user(); | |
$usr_id = $usr->ID; |
This file contains hidden or 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 | |
$user = MeprUtils::get_currentuserinfo(); | |
$subscriptions = $user->active_product_subscriptions(); |
This file contains hidden or 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( 'mepr-limit-payment-cycles-reached', 'cool_limit_payment_cycles_lifetime' ); | |
function cool_limit_payment_cycles_lifetime( $mepr_subscription = null ) { | |
if( !is_a( $mepr_subscription, 'MeprSubscription' ) | |
return false; | |
$txn = $mepr_subscription->latest_txn(); | |
$txn->expires_at = 0; // Zero for lifetime expiration | |
$txn->store(); |
This file contains hidden or 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
<script type="text/javascript"> | |
$(document).ready(function() { | |
var redirect_url = 'http://example.com/cool'; | |
var delay_seconds = 3; | |
setTimeout( function() { | |
window.location=redirect_url; | |
}, (delay_seconds * 1000) ); | |
}); | |
</script> |
This file contains hidden or 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 send_stripe_request( $endpoint, | |
$args=array(), | |
$method='post', | |
$domain='https://api.stripe.com/v1/', | |
$blocking=true ) { | |
$uri = "{$domain}{$endpoint}"; | |
$arg_array = array( 'method' => strtoupper($method), | |
'body' => $args, |