Skip to content

Instantly share code, notes, and snippets.

@thotbox
thotbox / JavaScript: Parallax Background.js
Last active August 29, 2015 14:03
JavaScript: Parallax Background
// Parallax
$(document).ready(function(){
$window = $(window);
var width = $window.width();
$(window).scroll(function() {
// #header
var offset = 0;
var speed = 3;
var calc = ($window.scrollTop() / speed) + offset;
@thotbox
thotbox / JavaScript: Foundation Init.js
Last active August 29, 2015 14:03
JavaScript: Foundation Init
// Foundation Init
if (!$('html').hasClass('lt-ie9')) {
$(document).foundation();
}
@thotbox
thotbox / ExpressionEngine: Switchee Template.html
Last active August 29, 2015 14:03
ExpressionEngine: Switchee Template
{exp:switchee variable="{segment_2}" parse="inward"}
{case value="#^P(\d+)$#|''"}
{/case}
{case default="yes"}
{/case}
@thotbox
thotbox / ExpressionEngine: Query Count.html
Last active August 29, 2015 14:02
ExpressionEngine: Query Count
{exp:query sql="SELECT COUNT(*) FROM exp_freeform_form_entries_2"}
<p><strong>Total Entries</strong> - {COUNT(*)}</p>
{/exp:query}
{exp:query sql="SELECT COUNT(*) FROM exp_freeform_form_entries_2 WHERE form_field_10 = 'Yes' OR form_field_11 = 'Yes' "}
<p><strong>Bonus Entries</strong>* - {COUNT(*)}</p>
{/exp:query}
{exp:query sql="SELECT COUNT(*) FROM exp_freeform_form_entries_2 WHERE form_field_10 = 'Yes' "}
<p><strong>Facebook Shares</strong>** - {COUNT(*)}</p>