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(function($) { | |
(function(st){ | |
st = $(st); | |
if (st.size()) { | |
if ($("p",st).size()>1 ){ | |
$("p:first",st).append(" <span class='hidetext_swith'>Далее >></span>"); | |
var str = st.html(); | |
var lens = str.indexOf("hidetext_swith")+ $(".hidetext_swith").html().length + 27 ; | |
$(st).html(str.replace(str.substr(lens), |
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 | |
/* | |
* More functional and correct ajax api for MODx EVO | |
* Propose: http://modx.im/blog/triks/2103.html | |
* Author: Agel_Nash (http://modx.im/profile/Agel_Nash/) | |
* Author: Swed (http://modx.im/profile/swed/) | |
* | |
* Version: 0.2 | |
* https://gist.github.com/MrSwed/710656f4ba6ad0d4272d4515d9e95f63 | |
* |
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
.toTopAnchor { | |
background: #e8e8e8; | |
cursor: pointer; | |
display: none; | |
height: 100%; | |
left: 0; | |
position: fixed; | |
top: 0; | |
width: 40px; | |
z-index: 20; |
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
#Set Tab size - 1 | |
javascript:(function(){var style=document.createElement('style'),css=document.createTextNode('*{-moz-tab-size:1;tab-size:1;}');style.appendChild(css);document.getElementsByTagName('head')[0].appendChild(style);})(); Raw | |
@set Tab size -2 | |
javascript:(function(){var style=document.createElement('style'),css=document.createTextNode('*{-moz-tab-size:2;tab-size:2;}');style.appendChild(css);document.getElementsByTagName('head')[0].appendChild(style);})(); Raw | |
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 | |
$id = isset($id)?$id:$modx->documentIdentifier; //берем id текущей страницы | |
$out = isset($out)?$out:"%s"; | |
//формируем запрос к базе | |
$res = $modx->db->select("count(`content_id`)",$modx->getFullTableName('portfolio_galleries'),"content_id='{$id}'"); | |
$row = $modx->db->getRow($res,'both'); | |
return (1 * $row[0] ? sprintf($out,$row[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
order deny,allow | |
allow from all | |
<FilesMatch "\.(php*|phtml)$"> | |
Order Deny,Allow | |
Deny from all | |
</FilesMatch> |
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
-- usable for convert maxygallery gallery to mm_ddMultipleFields tv use: | |
-- mm_ddMultipleFields('gallery', '', '', 'image,text,text', 'Image,Name,...'); | |
-- also you need to move /assets/galleries to /assets/images/galleries | |
insert into modx_site_tmplvar_contentvalues | |
SELECT null, 13, gal_id, | |
GROUP_CONCAT(DISTINCT concat('assets/images/galleries/',gal_id,'/',filename,'::',title) separator '||') | |
as tline | |
FROM `modx_maxigallery` |
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
#!/usr/bin/env bash | |
# Enable or disable git hooks | |
#find .git/hooks/ -type f ! -name "*.*" | |
gitHooks=.git/hooks/ | |
echo "git Hooks $gitHooks" | |
option="${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(){ | |
$.fn.extend({ | |
/* A kit of jQuery extensions for an forms manipulation via Ajax | |
* https://gist.github.com/MrSwed/2d86f2f0fd96fdc1e81aa414f0d53881 | |
*/ | |
"class": function(){ | |
/* jQuery-class-extender: Get className even is empty jQuery object https://gist.github.com/MrSwed/0a837b3acbfbf8cfb19e */ | |
return $(this).attr("class") || | |
$(this).selector.toString().replace(/^.*[\s]+([^\s])/, "$1").replace(/(^[^\.]+\.|[:][^\s]+)/, "").split(".") | |
.join(" ").trim(); |