This file contains hidden or 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 | |
/* | |
пересчет цены в зависимости откурса | |
из системной настройки current_rate | |
плагин на событие минишопа msOnGetProductPrice | |
*/ | |
switch ($modx->event->name) { | |
case 'msOnGetProductPrice': | |
$values = & $modx->event->returnedValues; |
This file contains hidden or 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
/* | |
http://htaccess.mwl.be/ | |
htaccess tester | |
*/ | |
RewriteRule ^old/$ /new/ [L,NE,R=301] |
This file contains hidden or 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 | |
/* | |
Плагин добавляет редактор к указанным полям ресурса | |
событие OnDocFormPrerender | |
*/ | |
switch ($modx->event->name) { | |
case 'OnDocFormPrerender': | |
if (!$modx->controller->resourceArray) { | |
return; | |
} |
This file contains hidden or 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
# Своя конфигурация | |
index index.php; | |
rewrite_log on; | |
location /core/ { | |
deny all; | |
} | |
# location / { | |
# try_files $uri $uri/ @rewrite; |
This file contains hidden or 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 | |
/* Включает скрытые в дееве ресурсы*/ | |
$q = $modx->newQuery('modResource', array('show_in_tree' => 0)); | |
$q->orCondition(array('hide_children_in_tree' => 1)); | |
$res = $modx->getCollection('modResource', $q); | |
foreach ($res as $v) { | |
$v->set('show_in_tree', 1); | |
$v->set('hide_children_in_tree', 0); | |
$v->save(); |
This file contains hidden or 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
# Устанавливаем кодировку | |
AddDefaultCharset utf-8 | |
Options +FollowSymLinks | |
# Запрет выдачи листинга пустого каталога | |
Options -Indexes | |
# Активируем mod_rewrite | |
RewriteEngine On |
This file contains hidden or 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 | |
/** | |
* SUMMARY: | |
* This script runs a series of tests to ensure that your MODX Revolution website is configured | |
* correctly. It was developed to test for the most common errors (mostly typos) that crop up | |
* when installing or moving a site. | |
* | |
* USAGE: | |
* 1. Upload this script to the Revo website, e.g. to the web root. |
This file contains hidden or 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 only screen | |
and (min-device-width : 320px) | |
and (max-device-width : 480px) { | |
/* Сюда добавляем стили*/ | |
} | |
/* Смартфоны (альбомный режим) ----------- */ | |
@media only screen | |
and (min-width : 321px) { |
This file contains hidden or 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
/* == Scroll top page == */ | |
$(window).scroll(function (){ | |
if ($(this).scrollTop() > 100){ | |
$("#up").fadeIn(); | |
} else{ | |
$("#up").fadeOut(); | |
} | |
}); | |
$('#up').click(function() { |
This file contains hidden or 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
# NPM CheatSheet. | |
# Super easy intall: npm comes with node now. | |
# To create your own npm package: https://www.npmjs.org/doc/misc/npm-developers.html | |
# More: https://www.npmjs.org/doc/ | |
# 1. NPM Command Lines. | |
# Local mode is the default. | |
# Use --global or -g on any command to operate in global mode instead. |