Skip to content

Instantly share code, notes, and snippets.

@iaindooley
iaindooley / gist:3385952
Created August 18, 2012 10:31
Wufoo Default Values Example
'defaultValues':'field5=wufoo&field6=today',
@iaindooley
iaindooley / wufoo_default_values_keyword.txt
Created August 18, 2012 10:46
Wufoo Default Values for Adwords Keyword
'defaultValues':'field7='+window.location.href.replace(/.*kw=(.+)$/,"$1"),
@iaindooley
iaindooley / optimizely_version_html.txt
Created August 18, 2012 11:01
Optimizely Version HTML
<div id="optimizelyVersion" style="display:none;">Default Version</div>
@iaindooley
iaindooley / optimizely_version_wufoo.txt
Created August 18, 2012 11:06
Optimizely Version Tracking with Wufoo
'defaultValues':'field7='+window.location.href.replace(/.*kw=(.+)$/,"$1")+'&field7='+document.getElementById("optimizelyVersion").firstChild.nodeValue,
@iaindooley
iaindooley / optimizely_api_initialisation.js
Created October 12, 2012 06:44
Optimizely API initialisation
<script type="text/javascript">window.optimizely = window.optimizely || [];</script>
@iaindooley
iaindooley / wufoo_optimizely.js
Created October 12, 2012 06:46
Wufoo defaultValues with the Optimizely API
'defaultValues':'field21='+window.optimizely.variationNamesMap['EXPERIMENT_ID'],
@iaindooley
iaindooley / x_business_days_ago.php
Created November 26, 2012 02:33
Function for returning the timestamp from X number of business days ago
<?php
function xBusinessDaysAgo($x)
{
$current = time();
while($x)
{
$current = strtotime('1 day ago',$current);
$num = (int)date('w',$current);
<html>
<head>
<title>My Page</title>
<link rel="stylesheet" type="text/css" href="styles.css" />
</head>
<body>
<div area="Main content" editable="true" id="mainContent">
<h1>Sample content is instructional</h1>
<h2>This is what the user sees when they create a new page</h2>
<p>You can also include images if you like:</p>
<html>
<head>
<title>My Page</title>
<link rel="stylesheet" type="text/css" href="styles.css" />
</head>
<body>
<div area="Main content" id="mainContent">
<h1 editable="true" tags="none">This is where you type your content</h1>
<p editable="true" tags="inline">This allows inline formatting only</p>
</div>
<html>
<head>
<title>My Page</title>
<link rel="stylesheet" type="text/css" href="styles.css" />
</head>
<body>
<div id="mainContent">
<div area="Heading content" id="headingContent">
<div component="Title content" id="whatever">
<h1 editable="true">This is a fixed component because it has an id attribute</h1>