This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Swapping page titles on blur | |
var originalPageTitle = document.title; | |
window.addEventListener('blur', function(){ | |
document.title = 'Don\'t forget to read this...'; | |
}); | |
window.addEventListener('focus', function(){ | |
document.title = originalPageTitle; | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$year = 2014; | |
$month = 10; | |
$day = 21; | |
$hour = 14; | |
$min = 00; | |
$sec = 00; | |
$target = mktime($hour, $min, $sec, $month, $day, $year); | |
$current = time(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var tileTeamMemberHeight = 0; | |
$('.tile-teamMember').each(function(){ | |
if($(this).height() > tileTeamMemberHeight ) { | |
tileTeamMemberHeight = $(this).height(); | |
} | |
}); | |
$('.tile-teamMember').height(tileTeamMemberHeight); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create a class name based upon the value passed through the function | |
// For example: if $string = "Lorem Ipsum" this will output "lorem-ipsum" as the class name | |
function createClass($string) { | |
// 1. convert to lowercase | |
// 2. remove special characters | |
// 3. Strip out multiple spaces & dashes | |
// 4. Convert single spaces and underscores to dashes | |
$className = strtolower($string); // 1 | |
$className = preg_replace("/[^a-z0-9_\s-]/", "", $className); // 2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function(){ | |
function get_time_zone_offset() { | |
var current_date = new Date(); | |
return -current_date.getTimezoneOffset() / 60; | |
} | |
$('body').append('The local time zone is: GMT ' + get_time_zone_offset()); | |
}); |