[[!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
var fs = require('fs'); | |
var Connection = require('ssh2'); | |
var chokidar = require('chokidar'); | |
var c = new Connection(); | |
var local_path; | |
var deploy_path; | |
process.argv.forEach(function (val, index, array) { | |
var item_arr = val.split('='); |
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 | |
DEPLOY_PATH="/var/www/site" | |
DEPLOYER_PATH="deploy.js" | |
SOURCE="${BASH_SOURCE[0]}" | |
while [ -h "$SOURCE" ]; do | |
TARGET="$(readlink "$SOURCE")" | |
if [[ $SOURCE == /* ]]; 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
<?php | |
$cmdSource = 'tx set --source -r modx-revolution.core-{:slug} -l {:lang} core/lexicon/{:lang}/{:file} -t PHP_ALT_ARRAY'; | |
$cmdTransl = 'tx set -r modx-revolution.core-{:slug} -l {:lang} core/lexicon/{:lang}/{:file} -t PHP_ALT_ARRAY'; | |
$search = ['{:slug}', '{:file}', '{:lang}']; | |
$langs = [ | |
'ru', | |
'de', | |
'cs', |
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
<?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 |
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
$get = $modx->sanitize($_GET); | |
if (!$get['day']) { | |
$now = time(); | |
$day = date('Y-m-d', $now); | |
} | |
$day = $get['day']; | |
$step = 15; // minutes |
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
<?php | |
// обрабатываем только события OnPageNotFound, на случай, если отметили галкой и другие в настройках плагина | |
if ($modx->event->name != 'OnPageNotFound') { | |
return false; | |
} | |
// на случай, если у нас настройки кто-то менял, получаем значение переменной, через которую передаются ссылки в modx от веб-сервера | |
$alias = $modx->context->getOption('request_param_alias', 'q'); |