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
var variation = getABTestVariation( 'silverPlan' ); |
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
POPULATION_SIZE = 50 | |
NUM_BITS = 64 | |
GENERATIONS = 1000 | |
SAMPLE_SIZE = 100 | |
CROSSOVER_PROBABILITY = 0.7 | |
MUTATION_RATE = 0.001 | |
class Chromosome | |
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
$.ajax({ | |
url : "http://words.bighugelabs.com/api/2/youapikey/" + word + "/json?callback=?", | |
dataType : 'json', | |
complete : function(jqXHR, textStatus) { | |
if (textStatus == 'parsererror') { | |
// Did not find any synonyms | |
alert("404 error because no synonyms exist for this word"); | |
} | |
}, | |
success : function(data) { |
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
mixpanel.track( 'Visited Homepage', { abtest_name: 'homepage test 3', abtest_variation: 'white' } ); |
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
mixpanel.track( 'Visited Homepage', { abtest_variation: 'white' } ); |
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
analytics.tracks.recordEvent( 'calypso_abtest_start', { abtest_name: this.experimentId, abtest_variation: variation } ); |
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
mixpanel.track( 'Assigned Variation', { abtest_name: 'homepage test 3', abtest_variation: 'white' } ); |
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
ORIGINAL_CONVERSION_RATE = 0.1 | |
VARIATION_OUTCOMES = [-0.2, 0.2] |
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
return "pass" if total_participants >= 10000 | |
if gaussian?(participants_a, conversions_a) && gaussian?(participants_b, conversions_b) | |
if p_value(participants_a, conversions_a, participants_b, conversions_b) >= 0.99 | |
return "yes" | |
end | |
end |
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
// This code assumes that each section of your homepage uses a "section" tag | |
// and each one has an id corresponding to its purpose: "testimonials", "pricing", etc | |
( function() { | |
var viewedSections = []; | |
$( window ).on( 'scroll', function() { | |
$( 'section' ).each( function() { | |
var sectionName = $( this ).attr( 'id' ); | |
var distanceToTopOfViewport = this.getBoundingClientRect().top; | |
if ( sectionName && distanceToTopOfViewport < 600 ) { |