Skip to content

Instantly share code, notes, and snippets.

@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" />
<widget href="http://decal-tour.apps53.decalcms.com/" />
</head>
<body>
<div id="mainContent">
<h2 area="Page Heading" editable="true" tags="none">This is a page heading</h2>
<div area="Body content" id="bodyContent" editable="true">
<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>
<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" editable="true">
<h2>This is the home page</h2>
<p>You can type a bunch of content here, and it will only update on one page.</p>
<html>
<head>
<title>My Page</title>
<link rel="stylesheet" type="text/css" href="styles.css" />
<style type="text/css">
p.specialParagraph /* decal: Red text */
{
color:red;
background:blue;
}