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
//Generic Goal, such as User Registration, to be placed on a "thank you" page | |
p9.goal("TEST-TOKEN"); | |
//User Registration with custom parameters, to be placed on a "thank you" page | |
p9.goal("TEST-TOKEN", { account_type: "premium" }) | |
//Checkout via shopping cart with custom parameters, to be placed after the order is confirmed or on a "thank you" page | |
p9.goal("TEST-TOKEN", { num_items: 5, total_cost: 43.44, coupon_used: false}); | |
//Page view with custom parameters |
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
//Custom javascript must be self-executing. | |
// Valid Example: | |
document.body.getElementById("feature_box").innerHTML = "Treatment Text"; | |
document.body.getElementById("feature_sub_box").innerHTML = "Split Test"; | |
//Valid Example: | |
function change(str) { | |
document.body.getElementById("feature_box").innerHTML = str; | |
} | |
change("Treatment Text"); |
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
server { | |
listen yourdomain.com:8000; | |
server_name yourdomain.com www.yourdomain.com; | |
location / { | |
auth_basic "Restricted"; | |
auth_basic_user_file /opt/access_list; | |
proxy_pass http://127.0.0.1:5984; | |
proxy_redirect off; | |
proxy_set_header Host $host:8000; | |
proxy_set_header X-Real-IP $remote_addr; |
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
<!-- Remember to replace the group and test tokens --> | |
<script type="text/javascript"> | |
document.write(unescape("%3Cscript src='http://press9formoreoptions.com/static/p9.js' type='text/javascript'%3E%3C/script%3E")); | |
</script> | |
<script type="text/javascript"> | |
try { | |
var p9 = P9fmo("your_group_token"); | |
var visit_id = "p9_visits"; | |
var visit_goal = 3; | |
var visits = p9.getCookie(visit_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
class UsingAbingoController < ApplicationController | |
def index | |
#Everything in ABingo stays the same, except we can just add the :press9_tracking variables | |
@result = ab_test("testing_images", ["control.jpg", "treatment.jpg"] , :press9_tracking => {:test_token => "3CXbb"}) | |
render :index | |
end | |
def convert | |
#Again - use bingo! as you normally would, just add the :press9_tracking option. | |
bingo!("testing_images", :press9_tracking => {:group_token => 'TB35Z8pH', :test_token => "3CXbb", :properties => {:money => 99.9, :type => "yellow"} }) |
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.write(unescape("%3Cscript src='http://press9formoreoptions.com/static/p9.js' type='text/javascript'%3E%3C/script%3E")); | |
</script> | |
<script type="text/javascript"> | |
try { | |
var p9 = P9fmo("TB35Z8pH"); | |
} catch(err) {} | |
p9.goal("w8ayr", {}, {'delay': 3 }); | |
</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
window.console = window.console || {log: function(m) {}, info: function(m) {}}; |
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
//In Javascript, a Regex object can be called like a function | |
//like: /test/("is test in here") | |
searchText = "padding 1234 rocket str austin TX 78704 more padding" | |
/\d+.+\n{0,2}.+\s+[A-Z]{2}\s+\d{5}/m(searchText) | |
//returns: ["1234 rocket str austin TX 78704"] | |
//As opposed to the more verbose(but sometimes more appropriate in cases that you are reusing the Regex): |
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
$(function() { | |
var tocWrapper = $("#toc .wrapper"); | |
$("#mainContainer h1").each(function(i,item) { | |
$("<a />") | |
.text( $(item).text() ) | |
.attr("href","#") | |
.data("scrollTo",item) |
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
{ | |
"name": "watch.js", | |
"description": "A script and stylesheet reloader. Less browser refreshing.", | |
"version": "0.0.5", | |
"author": "Mark DiMarco (@markmarkoh)", | |
"engines": { | |
"node": ">= 0.4.0" | |
}, | |
"dependencies": { | |
"socket.io": "0.7.7" |