Skip to content

Instantly share code, notes, and snippets.

@aisteron
aisteron / remove-all-from-docker.sh
Last active September 26, 2023 06:26 — forked from beeman/remove-all-from-docker.sh
Remove all from Docker
# 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
function $_(element) { return document.querySelector(element) }
let stack = [
'/js/autocomplete/jquery-1.12.4.js',
'/js/autocomplete/jquery-ui.js',
'/js/autocomplete/loadcss.js',
]
function loadFancy() {
let stack = [
'/vendor/jquery.min.js',
'/vendor/jquery.fancybox.min.js',
'/vendor/loadcss.js'
]
loadIt()
@aisteron
aisteron / gist:9c7867b4f20b065fc21194c7913dad02
Created February 20, 2019 13:43
modx сортировка по просмотрам
//- Сортировка по популярным постам
# 1. Устанавливаем плагин HitsPage;
# 2. Создаем дополнительное поле HitsPage с типом — число.
# 3. В шаблоне, где надо выводить просмотры пишем [[!HitsPage? &saveTv=`true`]]
[[!pdoResources?
&parents=`4,5,6,7`
&tpl=`pop_tpl`
&limit=`3`
//- вставляется в шаблоне "поиск по тегам"
//- https://youtu.be/5INOkXHP6xQ?t=2389
[[!pdoPage?
&tvFilters=`tags==%[[!#GET.tag]]%`
&parents=`3`
&tpl=`blog-item`
&sortby=`{ "pagetitle":"ASC" }`
]]
@aisteron
aisteron / gist:c5578bb1bfafd836ba916ffda3bc4394
Created February 19, 2019 14:16
parent pagetitle fenom
[[#[[*parent]].pagetitle]]
@aisteron
aisteron / mdx_ajax
Created January 23, 2019 12:35
modx ajax snippet
<?php
/*$page = $modx->getObject('modResource', 13);
$chars = json_decode($page->getTVValue('chars'));
echo '<pre>';
foreach($chars as $k => $v)
{
echo $v->key0.'-'.$v->value0;
}
$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;
@aisteron
aisteron / package.json
Last active December 6, 2018 18:09
default package.json
{
"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",
@aisteron
aisteron / Gruntfile.js
Created December 6, 2018 17:43
default Gruntfile.js
module.exports = function(grunt){
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
pug:
{
compile: {
options: {