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 | |
Class Increment extends CodeBench | |
{ | |
public $description = 'Comparision of $i++ to ++$i'; | |
public $loops = 10000; | |
public $subjects = array( | |
// Kinda sporadic jumps, but show a noticeable gap as value increases |
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 | |
echo 'Yay 2.0'; | |
?> |
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
Whoops, 404! |
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 'oauth2' | |
client = OAuth2::Client.new( | |
'client_id', | |
'client_secret', | |
:site => 'https://workshop.memberful.com', | |
:authorize_url => '/oauth' | |
) | |
redirect_to client.auth_code.authorize_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
SELECT "posts".*, "authors".* | |
FROM "posts" | |
LEFT JOIN "authors" ON ("posts"."author_id" = "authors"."author_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
<?php | |
add_filter('memberful_wp_after_sign_in_url', 'my_after_sign_in_url'); | |
function my_after_sign_in_url() { | |
return 'http://gohere.com'; | |
} |
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 will dump information about all plans the currently signed in member has access to | |
var_dump(memberful_wp_user_plans_subscribed_to(wp_get_current_user()->ID)); | |
// This will print all downloads the currently signed in member has access to, including those granted by a subscription | |
var_dump(memberful_wp_user_downloads( wp_get_current_user()->ID )); | |
// You can also pass the id of a specific user to get the plans for that specific user. E.g |
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
#!/usr/bin/env ruby | |
require "openssl" | |
require 'digest/sha2' | |
require 'base64' | |
# We use the AES 256 bit cipher-block chaining symetric encryption | |
alg = "AES-256-CBC" | |
# We want a 256 bit key symetric key based on some passphrase | |
digest = Digest::SHA256.new |
NewerOlder