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) |
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
Show hidden characters
[ | |
{ "keys": ["super+ctrl+w"], "command": "close_all", "args": {} } | |
] |
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.fitText = function(options) { | |
var els = $(this), | |
options = $.extend({ | |
ellipsis : "..." | |
}, options || {}); | |
els.each(function () { | |
var el = $(this), | |
h = el.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
// From http://forum.jquery.com/topic/jquery-jquery-way-for-filtering-self-all-children | |
$.fn.findAndSelf = function(selector) { | |
return this.find(selector).andSelf().filter(selector); | |
} |
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 listify($delimiter) { | |
return implode($delimiter, array_filter(array_slice(func_get_args(), 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
// Grabbed from http://de3.php.net/manual/de/function.file-get-contents.php | |
function curl_file_get_contents($URL) { | |
$c = curl_init(); | |
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1); | |
curl_setopt($c, CURLOPT_URL, str_replace(' ', '%20', $URL)); | |
$contents = curl_exec($c); | |
curl_close($c); | |
if ($contents) return $contents; | |
else return FALSE; |
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
@media screen and (min-width: ...) { | |
// Adjust the breakpoint identifier so that jQuery knows about it | |
#bp { | |
color: rgb(1, 1, 1); | |
} | |
} | |
@media screen and (min-width: ...) { | |
// Adjust the breakpoint identifier so that jQuery knows about it | |
#bp { |
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.reduce = function(fnReduce, initialValue) { | |
var values = this, | |
previousValue = initialValue; | |
values.each(function(index, currentValue) { | |
previousValue = fnReduce.call(currentValue, previousValue, currentValue, index, values); | |
}); | |
return previousValue; | |
}; |
OlderNewer