Skip to content

Instantly share code, notes, and snippets.

@thotbox
thotbox / block hover stuff.css
Last active March 17, 2016 19:18
block hover stuff
.demo-block {
position: relative;
overflow: hidden;
}
.demo-block img {
transform: scale(1.02);
transition: transform .2s;
}
@thotbox
thotbox / screen.css
Last active March 1, 2016 15:48
Exercise
/* --- Reset --- */
.row {
max-width: 1920px;
}
/* --- End Reset --- */
@thotbox
thotbox / index.html
Last active March 1, 2016 15:48
Exercise
<!doctype html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- Page Meta -->
<title>Exercise</title>
<meta name="description" content="">
@thotbox
thotbox / PHP: Error Reporting.php
Created December 17, 2015 20:25
PHP: Error Reporting
error_reporting(E_ALL);
ini_set('display_errors', 1);
@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;
@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 / 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: 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 / 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: 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');