View remove-all-from-docker.sh
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
# Stop all containers | |
docker stop `docker ps -qa` | |
# Remove all containers | |
docker rm `docker ps -qa` | |
# Remove all images | |
docker rmi -f `docker images -qa ` | |
# Remove all volumes |
View load stack js libs
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 $_(element) { return document.querySelector(element) } | |
let stack = [ | |
'/js/autocomplete/jquery-1.12.4.js', | |
'/js/autocomplete/jquery-ui.js', | |
'/js/autocomplete/loadcss.js', | |
] | |
View load stack of js
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 loadFancy() { | |
let stack = [ | |
'/vendor/jquery.min.js', | |
'/vendor/jquery.fancybox.min.js', | |
'/vendor/loadcss.js' | |
] | |
loadIt() |
View gist:9c7867b4f20b065fc21194c7913dad02
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. Устанавливаем плагин HitsPage; | |
# 2. Создаем дополнительное поле HitsPage с типом — число. | |
# 3. В шаблоне, где надо выводить просмотры пишем [[!HitsPage? &saveTv=`true`]] | |
[[!pdoResources? | |
&parents=`4,5,6,7` | |
&tpl=`pop_tpl` | |
&limit=`3` |
View поиск по тегам modx
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
//- вставляется в шаблоне "поиск по тегам" | |
//- https://youtu.be/5INOkXHP6xQ?t=2389 | |
[[!pdoPage? | |
&tvFilters=`tags==%[[!#GET.tag]]%` | |
&parents=`3` | |
&tpl=`blog-item` | |
&sortby=`{ "pagetitle":"ASC" }` | |
]] |
View gist:c5578bb1bfafd836ba916ffda3bc4394
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
[[#[[*parent]].pagetitle]] |
View mdx_ajax
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 | |
/*$page = $modx->getObject('modResource', 13); | |
$chars = json_decode($page->getTVValue('chars')); | |
echo '<pre>'; | |
foreach($chars as $k => $v) | |
{ | |
echo $v->key0.'-'.$v->value0; | |
} |
View gist:f2155feaca8591fedabac58f52280ceb
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
$where = array( | |
'parent' => 6 | |
); | |
$resources = $modx->getCollection('modResource',$where); | |
$output = '<p>Всего ресурсов: '.count($resources).'</p>'; | |
foreach ($resources as $k => $res) { | |
$output .= '<p>['.$k.'] => '.$res->get('pagetitle').'</p>'; | |
} | |
print $output; |
View Gruntfile.js
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
module.exports = function(grunt){ | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
pug: | |
{ | |
compile: { | |
options: { |
View package.json
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
{ | |
"name": "ct.fzn.by-jqm", | |
"version": "0.0.1", | |
"devDependencies": { | |
"grunt": "latest", | |
"grunt-browser-sync": "latest", | |
"grunt-contrib-concat": "latest", | |
"grunt-contrib-pug": "latest", | |
"grunt-contrib-watch": "latest", | |
"grunt-critical": "latest", |