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
| <svg class="icon icon--home"> | |
| <use xlink:href="home.svg#home"></use> | |
| </svg> |
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 | |
| /** @var modx $modx */ | |
| switch ($modx->event->name) { | |
| case 'pdoToolsOnFenomInit': | |
| /** @var Fenom $fenom */ | |
| $fenom->addModifier('modName', function ($input) use ($modx) { | |
| /** @var modx $modx */ | |
| //here your code | |
| 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
| <?php | |
| /** @var modx $modx */ | |
| switch ($modx->event->name) { | |
| case 'pdoToolsOnFenomInit': | |
| $fenom->addBlockFunction('master', function (array $params, $content) use ($modx) { | |
| if ($modx->user->isMember('Administrator')) { | |
| return $content; | |
| } | |
| }); | |
| break; |
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
| 1)В таблицах для картинок лучше указывать width:100% а не max-width:100% | |
| 2)При модели расчёта box-sizing:border-box; лучше картинкам задавать не margin для отступов, а padding, таким образом не произойдёт выпадание контента | |
| 3)Блокировка прокрутки элемента - position:fixed;overflow:hidden; |
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
| mysqldump --all-databases -u User -p Pass > dumpfile.sql | |
| обратно | |
| mysql -u User -p Pass < dumpfile.sql |
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 | |
| for ($i=0; $i<=15; $i++){ | |
| $res = $modx->newObject('modResource'); | |
| $res->set('template', 10); | |
| $res->set('isfolder', 0); | |
| $res->set('published', 1); | |
| $res->set('publishedon', time()); | |
| $res->set('createdon', time()); | |
| $res->set('pagetitle', 'СКУД '.$i); | |
| $res->set('alias', 'skud'.$i); |
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
| //Очистить источники файлов на вкладке файлы. | |
| //1)Создаём в нужном источнике параметр - hideSource (булев) - значение 1 | |
| //2)Создаём плагин на событие - OnMediaSourceGetProperties | |
| <?php | |
| $properties = json_decode($properties, true); | |
| if (!empty($properties['hideSource']) AND !empty($properties['hideSource']['value']) AND $_REQUEST['node'] == '/') { | |
| die('{}'); | |
| } |
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 | |
| class clearGetParams extends Middlewares\Middleware | |
| { | |
| public $contexts = ['web']; | |
| public function onRequest() | |
| { | |
| if ($gets = request()->query()) { | |
| $white_list = array_fill_keys(explode(',', config('get_params')), null); | |
| if ($diff = array_diff_key($gets, $white_list)) { |
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
| in terminal from sudo | |
| sudo defaults delete /Library/Preferences/com.apple.windowserver.plist DisplayResolutionEnabled | |
| rebot system |