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
#!/bin/sh -e | |
#git-cache-meta -- simple file meta data caching and applying. | |
#Simpler than etckeeper, metastore, setgitperms, etc. | |
#from http://www.kerneltrap.org/mailarchive/git/2009/1/9/4654694 | |
#modified by n1k | |
# - save all files metadata not only from other users | |
# - save numeric uid and gid | |
# 2012-03-05 - added filetime, andris9 |
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.extend({ | |
"fullHeight" : function(p) { | |
var s; | |
with($(this)) { | |
var bs = css("box-sizing"); | |
s = height() + (bs!="border-box"? | |
parseInt(css("border-top-width")) + | |
parseInt(css("border-bottom-width")) + | |
(bs!="padding-box"? | |
parseInt(css("padding-top")) + |
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.extend({ | |
"modal": function(cm, p){ | |
/* Modal windows jQuery extender | |
* Source https://gist.github.com/MrSwed/2e64367959a60866cf30 | |
* Demo http://jsfiddle.net/2wg2p6km | |
*/ | |
if (!cm) cm = "init"; | |
var o = $(this); | |
p = $.extend({}, {debug: false, "afterOpen": false, "afterClose": false}, p); | |
if (cm != "init" && !o.data("inited")) o.modal("init", p); |
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.extend({ | |
"tabs": function(p){ | |
// Simple jQuery tabs extender. https://gist.github.com/MrSwed/4246691aa788058a9934 | |
// actItem, deActItem extenders required (below) | |
// last update 2017/09/14 | |
return $(this).each(function(){ | |
var _t = this; | |
_t.p = $.extend({ | |
"headers": $(".headers", _t), | |
"contents": $(".contents", _t), |
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.extend({ | |
"class": function() { | |
return $(this).attr("class") || $(this).selector.toString().replace(/^.*[\s]+([^\s])/,"$1").replace(/(^[^\.]+\.|[:][^\s]+)/,"").split(".").join(" ").trim(); | |
} | |
}); |
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 number_format( num, decimals, dec_point, thousands_sep, hide_null ) { | |
if (num && typeof num == "string") num = num.replace(/ /g,""); | |
if (hide_null && !parseInt(num)) return ""; | |
var i, j, kw, kd, km, minus = ""; | |
if(num < 0){ | |
minus = "-"; | |
num = num*-1; | |
} | |
if( isNaN(decimals = Math.abs(decimals)) ){ | |
decimals = 2; |
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
@EVAL | |
function getItems($p, $l=0){ | |
global $modx; | |
$c=array(); | |
foreach($modx->getDocumentChildren($p,1,0,"id,pagetitle,isfolder") as $k) { | |
$c[] = str_pad("",$l*2,"-",STR_PAD_RIGHT)." ".$k['pagetitle']." (".$k['id'].")==".$k['id']; | |
$c = array_merge($c,getItems($k['id'],$l+1)); | |
} | |
return $c; | |
} |
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
// it getted from https://forum.jquery.com/topic/should-chk-prop-checked-true-trigger-change-event | |
$.attrHooks.checked = { | |
set: function(elem, value, name) { | |
var ret = (elem[ name ] = value); | |
$(elem).trigger("change"); | |
return ret; | |
} | |
}; |
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 | |
/** | |
* is_mobile | |
* | |
* Определение мобильного браузера | |
* | |
* @category snippet | |
* @version 1.0 | |
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License (GPL) | |
* @internal @properties |
OlderNewer