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({ | |
"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 |
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
# Reset for user 1 | |
UPDATE `modx_user_attributes` SET `blocked` = '0', `blockeduntil` = '0', `failedlogincount` = '0' WHERE `modx_user_attributes`.`id` = 1; | |
# Warning! Reset for all users | |
#UPDATE `modx_user_attributes` SET `blocked` = '0', `blockeduntil` = '0', `failedlogincount` = '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
#!/bin/sh | |
# git add -r Recursively add files by pattern | |
# https://gist.github.com/MrSwed/fb76fde40c6c16863c87 | |
echo "Shorter for: find . -name \"$1\" | xargs git add ${@:2}" | |
mask=* | |
if [[ $1 ]] | |
then |
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
// -------------------------------------------------- | |
// Flexbox LESS extends | |
// The spec: http://www.w3.org/TR/css3-flexbox | |
// -------------------------------------------------- | |
// example usage as extender .mydiv:extend(.flex) {&:extend(.flex.j-center)} | |
@import "flexbox"; | |
.flex { | |
display: -webkit-box; | |
display: -moz-box; |
OlderNewer