Skip to content

Instantly share code, notes, and snippets.

@thotbox
thotbox / CSS: Default Media Queries.css
Created April 16, 2015 14:03
CSS: Default Media Queries
/* Non-Small screens */
@media only screen and (min-width: 641px) {
}
/* Large screens */
@media only screen and (min-width: 1025px) {
@thotbox
thotbox / HTML: Foundation Template.html
Last active August 29, 2015 14:20
HTML: Foundation Template
<!doctype html>
{if '{exp:browser_detect:browser}' == 'IE8'}
<html class="no-js lt-ie9" lang="en">
{if:elseif '{exp:browser_detect:browser}' == 'IE9'}
<html class="no-js lt-ie10" lang="en">
{if:else}
<html class="no-js" lang="en">
{/if}
<head>
@thotbox
thotbox / ExpressionEngine: Grid Images (CE).html
Created May 6, 2015 18:54
ExpressionEngine: Grid Images (CE)
<div class="wygwam">
{exp:grid_images}{page_text}{/exp:grid_images}
</div>
{page_images}
{if page_images:image_size == '1/2 Left'}
{exp:ce_img:pair src="{page_images:image}" width="640" allow_scale_larger="no" crop="no" quality="70"}<meta class="grid_images" id="grid_source_{page_images:count}" data-src="{made}" data-float="left" data-width="half">{/exp:ce_img:pair}
{if:elseif page_images:image_size == '1/2 Right'}
{exp:ce_img:pair src="{page_images:image}" width="640" allow_scale_larger="no" crop="no" quality="70"}<meta class="grid_images" id="grid_source_{page_images:count}" data-src="{made}" data-float="right" data-width="half">{/exp:ce_img:pair}
{if:else}
@thotbox
thotbox / ExpressionEngine: Grid Images.html
Created May 6, 2015 18:55
ExpressionEngine: Grid Images
<div class="wygwam">
{exp:grid_images}{page_text}{/exp:grid_images}
</div>
{page_images}
{if page_images:image_size == '1/2 Left'}
<meta class="grid_images" id="grid_source_{page_images:count}" data-src="{page_images:image}" data-float="left" data-width="half">
{if:elseif page_images:image_size == '1/2 Right'}
<meta class="grid_images" id="grid_source_{page_images:count}" data-src="{page_images:image}" data-float="right" data-width="half">
{if:else}
@thotbox
thotbox / JavaScript: Grid Images.js
Last active August 29, 2015 14:20
JavaScript: Grid Images
// Grid Images
$(document).ready(function() {
if($('.grid_images').length && $('.grid_image').length) {
$('.grid_image').each(function() {
var gridID = $(this).attr('id');
gridID = gridID.replace('grid_image_', '');
var gridImage = $('#grid_source_' + gridID).attr('data-src');
var gridFloat = $('#grid_source_' + gridID).attr('data-float');
var gridWidth = $('#grid_source_' + gridID).attr('data-width');
@thotbox
thotbox / CSS: Grid Images.css
Last active August 29, 2015 14:20
CSS: Grid Images
.grid_image_left { float: left; padding-right: 30px; }
.grid_image_right { float: right; padding-left: 30px; }
.grid_image_half { width: 50%; }
.grid_image_full { width: 100%; }
.grid_image img { margin-bottom: 30px; }
@thotbox
thotbox / JavaScript: Font Awesome IE8 Fix.js
Last active August 29, 2015 14:21
JavaScript: Font Awesome IE8 Fix
// IE8 Font Awesome Fix
if ($('html').hasClass('lt-ie9')) {
$(document).ready(function() {
setTimeout(function() {
$('.fa').each(function() {
$(this).parent().trigger('focus');
});
$('html, body').animate({ scrollTop: 0 }, 0);
}, 500);
@thotbox
thotbox / JavaScript: Parallax with Scale and Blur.js
Created June 17, 2015 13:25
JavaScript: Parallax with Scale and Blur
// Parallax
$(document).ready(function(){
parallax();
$window = $(window);
$window.scroll(function() {
parallax();
});
@thotbox
thotbox / JavaScript: Export CSV From Table (cross platform).js
Last active August 29, 2015 14:25
JavaScript: Export CSV From Table (cross platform)
function saCSV($table, filename) {
var $rows = $table.find('tr:has(td)');
var column_delimiter_temp = String.fromCharCode(11);
var row_delimiter_temp = String.fromCharCode(0);
var column_delimiter = '","';
var row_delimiter = '"\r\n"';
var csv = '"'+ $rows.map(function (i, row) {
var $row = $(row);
var $col = $row.find('td');
return $col.map(function (j, col) {
@thotbox
thotbox / PHP: Wordpress URL Segments.php
Created October 13, 2015 18:45
PHP: Wordpress URL Segments
Add to header or function file:
<?php
// URL Segments and Master ID
//
// Segment Variables: $GLOBALS['segment']['1'], $GLOBALS['segment']['2'], etc.
// Master ID Variable: $GLOBALS['master_id']
global $segment;
global $master_id;