[[!pdoResources?
&tpl=@INLINE {{+id}} {{+pagetitle}}
&select={"modResource":"id,pagetitle"}
&parents=0
&leftJoin={ "modResourceGroupResource": {"on":"modResourceGroupResource.document = modResource.id"}, "modResourceGroup": {"on":"modResourceGroup.id = modResourceGroupResource.document_group"} }
&where={"modResourceGroup.name":"test"}
]]
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 | |
$modx->addPackage('sendex', MODX_CORE_PATH . 'components/sendex/model/'); | |
$subscribers = array( | |
array('Фамилия Имя Отчество' , 'email@mail.ru'), | |
); | |
foreach ($subscribers as $s) { | |
if (!$u = $modx->getObject('modUserProfile', array('email' => $s[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
'use strict'; | |
console.time('Loading plugins'); | |
var gulp = require('gulp'), | |
watch = require('gulp-watch'), | |
shell = require('gulp-shell'), | |
tap = require('gulp-tap'); | |
console.timeEnd('Loading plugins'); |
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
[[!weather? | |
&cityId=`26850` | |
&tpl=`weather.tpl` | |
&cacheTime=`7200` | |
]] |
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
1 | |
00:00:00,000 --> 00:00:23,042 | |
alright everyone I do it so it's ok so | |
she asked me to talk at Larkin goes to | |
2 | |
00:00:23,042 --> 00:00:28,064 | |
the last year was obliged i enjoy to | |
throw out hope some of you that reappear |
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 | |
switch ($modx->event->name) { | |
case 'OnDocFormSave': | |
if ($resource->get('template') === 5) { // event | |
$start = $resource->getTVValue('event.start'); | |
$finish = $resource->getTVValue('event.finish'); | |
if ($start && $finish) { // o both empty or both filled, that means OK | |
return; | |
} |
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 | |
// обрабатываем только события OnPageNotFound, на случай, если отметили галкой и другие в настройках плагина | |
if ($modx->event->name != 'OnPageNotFound') { | |
return false; | |
} | |
// на случай, если у нас настройки кто-то менял, получаем значение переменной, через которую передаются ссылки в modx от веб-сервера | |
$alias = $modx->context->getOption('request_param_alias', 'q'); |
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 | |
$str = 'fD3_'; | |
$chars = array_merge(range('a', 'z'), range('A', 'Z'), range('0', '9'), ['_']); | |
$total = 0; | |
$brut = ''; | |
$len = strlen($str); | |
/** | |
* @see: https://www.programmingalgorithms.com/algorithm/brute-force?lang=PHP | |
*/ |
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/bash | |
flag=5 | |
if [ ! $1 ]; then | |
echo "Set user name for connect to mysql" | |
let flag=flag-1 | |
fi | |
if [ ! $2 ]; then |