Skip to content

Instantly share code, notes, and snippets.

View keybase.md

Keybase proof

I hereby claim:

  • I am adolfoabegg on github.
  • I am adol (https://keybase.io/adol) on keybase.
  • I have a public key ASCsAt4GlwwQn2MaV9LWrqTS-M0_IH5qnAJ7YuFys1lIyAo

To claim this, I am signing this object:

View VendoSignature.php
<?php
/*
USAGE:
$urlToSign = 'https://secure.vend-o.com/v/signup?site=123123&affiliate_id=0';//this is just an example
$vendoSigner = new VendoSignature('YOUR-SHARED-SECRET');
$signedUrl = $vendoSigner->sign($urlToSign);
//Output example: https://secure.vend-o.com/v/signup?site=123123&affiliate_id=0&signature=scKxBO5UlS1vQHxORr3xuBL4Fb8
*/
@adolfoabegg
adolfoabegg / apache-vendo-ab-test.conf
Created Feb 11, 2016
Vendo A/B Test - Apache configuration.
View apache-vendo-ab-test.conf
# We need to add these lines to NATS' virtual host configuration
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{QUERY_STRING} ^$
RewriteCond %{REQUEST_URI} track/(.*)(/.*)?$
RewriteRule ^track/(.+)(/(.+))?$ ab/vendo-ab-test.php?nats=$1 [L,NC]
@adolfoabegg
adolfoabegg / vendo-ab-test.php
Created Feb 11, 2016
Vendo A/B Test script for NATS
View vendo-ab-test.php
<?php
//NATS' tracker url (with a trailing slash)
$natsTrackUrl = 'http://natsv4.staging.vend-o.com/track/';
//NATS' signup url
$natsSignupUrl = 'http://natsv4.staging.vend-o.com/signup/signup.php';
$configuration = array(
//maps all current tours of SiteID 11 to the new tour (88) configured for the Vendo A/B test
'11.*' => '88', //assumes the current tours' traffic is being processed by the other biller. The new tour 88 sends the traffic to Vendo.
//The A/B split will occur between all the current tours (A) and the new one configured for Vendo (B)