Skip to content

Instantly share code, notes, and snippets.

View derick-montague's full-sized avatar
🕉️
Om is a living phenomenon and it has its own mood

Derick Montague derick-montague

🕉️
Om is a living phenomenon and it has its own mood
View GitHub Profile
@derick-montague
derick-montague / index.html
Created March 2, 2014 16:09
HTML 5 Skeleton Template
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
// http://www.robertmullaney.com/2010/11/12/safe-email-mailto-links-using-jquery/
generateMail : (function() {
$('a[href*="[at]"][href*="[dot]"]').each(function() {
var email = $(this).attr('href').split('[at]').join('@').split('[dot]').join('.');
$(this).attr('href', 'mailto:' + email.toLowerCase());
$(this).text(email);
});
}),
@derick-montague
derick-montague / show_sidebar.php
Created August 11, 2012 03:13
Function for wordpress to determine whether to show sidebar based on page id
// Need to reset the wordpress query before running
wp_reset_query();
$i = true;
switch($i) {
case (is_front_page()):
$i = false;
break;
case (is_page('contact-us')):
$i = false;
break;
@derick-montague
derick-montague / is_middle_column.php
Created August 11, 2012 02:32
WordPress scripts for 3 column layout that checks to see if the element is the middle in a three column layout or a new row. Use it to clear floats and add styles such as left and right margins for the middle column.
// Custom function to check if column is middle column
// of a three column layout based on the index
function is_middle_column($index)
{
$isMiddleColumn = false;
$postIndex = $index;
if (($postIndex - 1) % 3 == 0)
{
$isMiddleColumn = true;
@derick-montague
derick-montague / jplayer-fallback-settings.js
Created August 9, 2012 17:18
jPlayer - detect browser and set fallback when html 5 video not supported
<script>
/****************************************************************************************************
Checking for old IE and Firefox versions and defaulting to flash with html 5 fallback
Not serving .ogg file so Firefox requires Flash
Flash does not like dimensions set to auto, so set these to 100% when using flash for playback
****************************************************************************************************/
$(document).ready(function(){
var ua = $.browser;
var uaVersion = ua.version.slice(0,3);
@derick-montague
derick-montague / text-shadows.css
Created August 9, 2012 15:23
CSS Text Shadows for Beveled/Indented Effect
/* Some tweaks needed to accommodate different background and foreground colors colors */
text-shadow-dark {
text-shadow: 0 1px 1px rgba(255, 255, 255, .5), 0 -1px 1px rgba(0, 0, 0, .5)
}
text-shadow-light {
text-shadow: 0 1px 1px rgba(255, 255, 255, .9), 0 -1px 1px rgba(0, 0, 0, .1);
}