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)"); |
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 getMediaInfo($mediaUrl) { | |
$mediaUrl = trim($mediaUrl); | |
// Check for YouTube | |
$matchFound = preg_match('|^\s*https?://www.youtube.com/watch\?v=([a-zA-Z0-9\.-]+)(#.*)?\s*$|', $mediaUrl, $matches); | |
if ($matchFound) { | |
return (object)array( | |
'mediaUrl' => $mediaUrl, | |
'mediaSource' => 'youtube', | |
'mediaID' => $matches[1], |
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 first($arr) { | |
$first = array_slice($arr, 0, 1); | |
return $first[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
function extend($object1, $object2) { | |
return (object)array_merge((array)$object1, (array)$object2); | |
} |
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 flushDOM() { | |
$('body').height(); | |
} |
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
<?php | |
$countries = array( | |
'en' => array( | |
'Afghanistan', | |
'Albania', | |
'Algeria', | |
'American Samoa', | |
'Andorra', | |
'Angola', |
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
// Regexps courtesy of 1st class media | |
// http://www.1stclassmedia.co.uk/developers/clean-ms-word-formatting.php | |
function tidy_office_html($str) { | |
$replacements = array( | |
'/<!--.*?-->/s' => '', | |
'/<o:p>\s*<\/o:p>/s' => '', | |
'/<o:p>.*?<\/o:p>/s' => " ", | |
'/\s*mso-[^:]+:[^;"]+;?/i' => '', | |
'/\s*MARGIN: 0cm 0cm 0pt\s*;/i' => '', | |
'/\s*MARGIN: 0cm 0cm 0pt\s*"/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 ($) { | |
// From http://forloop.co.uk/blog/wrap-child-elements-in-groups-in-jquery | |
// Modified to work much simpler | |
$.fn.wrapGroups = function(options) { | |
options = $.extend({ | |
groupSize : false, | |
groupCount: false, | |
wrapper : '<div>' | |
}, options || {}); | |
var elems = $(this), |
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
$.fn.flash = function (options) { | |
options = $.extend({ | |
animation: 200, | |
off: 0, | |
on: 1000 | |
}, options || {}); | |
var elems = $(this), | |
f = function () { | |
elems | |
.animate({opacity: 0}, options.animation) |
OlderNewer