This file contains 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
(function ($) { | |
$.fn.realWidth = function () { | |
var els = $(this); | |
return els.length ? els[0].getBoundingClientRect().width : null; | |
} | |
})(jQuery); |
This file contains 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
function waitForWebfonts(fonts, callback) { | |
var loadedFonts = 0; | |
for(var i = 0, l = fonts.length; i < l; ++i) { | |
(function(font) { | |
var node = document.createElement('span'); | |
// Characters that vary significantly among different fonts | |
node.innerHTML = 'giItT1WQy@!-/#'; | |
// Visible - so we can measure it - but not on the screen | |
node.style.position = 'absolute'; | |
node.style.left = '-10000px'; |
This file contains 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
function slugify($s, $replacement = '-', $locale = null, $lower = false, $trim = true) { | |
$charMap = json_decode('{"$":"dollar","%":"percent","&":"and","<":"less",">":"greater","|":"or","¢":"cent","£":"pound","¤":"currency","¥":"yen","©":"(c)","ª":"a","®":"(r)","º":"o","À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","Æ":"AE","Ç":"C","È":"E","É":"E","Ê":"E","Ë":"E","Ì":"I","Í":"I","Î":"I","Ï":"I","Ð":"D","Ñ":"N","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","Ù":"U","Ú":"U","Û":"U","Ü":"U","Ý":"Y","Þ":"TH","ß":"ss","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","æ":"ae","ç":"c","è":"e","é":"e","ê":"e","ë":"e","ì":"i","í":"i","î":"i","ï":"i","ð":"d","ñ":"n","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","ù":"u","ú":"u","û":"u","ü":"u","ý":"y","þ":"th","ÿ":"y","Ā":"A","ā":"a","Ă":"A","ă":"a","Ą":"A","ą":"a","Ć":"C","ć":"c","Č":"C","č":"c","Ď":"D","ď":"d","Đ":"DJ","đ":"dj","Ē":"E","ē":"e","Ė":"E","ė":"e","Ę":"e","ę":"e","Ě":"E","ě":"e","Ğ":"G","ğ":"g","Ģ":"G","ģ":"g","Ĩ":"I","ĩ":"i","Ī":"i","ī":"i","Į":"I", |
This file contains 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
(function($) { | |
var timer; | |
$(window).bind("scroll", function (e) { | |
clearTimeout(timer); | |
timer = setTimeout(function () { | |
$(window).trigger("scrollstop"); | |
}, 150); | |
}); | |
})(jQuery); |
This file contains 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
#nav { | |
text-align: justify; | |
min-width: 500px; | |
} | |
#nav:after { | |
content: ''; | |
display: inline-block; | |
width: 100%; | |
} | |
#nav li { |
This file contains 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
jQuery.expr[':'].Contains = function(a,i,m) { | |
return (a.textContent || a.innerText || "").toUpperCase().indexOf(m[3].toUpperCase()) >= 0; | |
}; |
This file contains 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
@mixin custom-bullet($bulletText: ">", $indentWidth: 20px) { | |
padding-left: $indentWidth; | |
position: relative; | |
&:before { | |
content: $bulletText; | |
position: absolute; | |
margin-left: -$indentWidth; | |
} | |
} |
This file contains 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
function get_video_embed_url($url) { | |
// Check for YouTube | |
$matchFound = preg_match('/^(https?:\/\/(www\.)?youtube\.com\/watch\?(t=(.+)&)?v=|https?:\/\/youtu\.be\/)([^?]+)(\?(t=(.+))?.*)?$/', $url, $matches); | |
if ($matchFound) { | |
// Video is a Youtube video | |
$url = '//www.youtube.com/embed/' . $matches[5]; | |
if ($matches[4]) { | |
$url = $url . '?start=' . $matches[4]; | |
} else if ($matches[8]) { | |
$url = $url . '?start=' . $matches[8]; |
This file contains 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
(function ($) { | |
$.fn.partition = function(options) { | |
options = $.extend({ | |
count: false, | |
wrapper : '<div>' | |
}, options || {}); | |
var elems = $(this), | |
len = pos = 0; | |
for (var i = 0; i < options.count; i++) { | |
var sel = elems.filter(":nth-child(" + (options.count - i) + "n)"); |