Version: 2.1.1
Platform: x86_64
First, install or update to the latest system software.
sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev
groups: | |
- name: node_exporter_alerts | |
rules: | |
- alert: Node down | |
expr: up{job="monitoring-pi"} == 0 | |
for: 2m | |
labels: | |
severity: warning | |
annotations: | |
title: Node {{ $labels.instance }} is down |
CLOUDFLARE_USER=example@example.com | |
CLOUDFLARE_KEY=probablyshoulduseyourapikeyhereinstead |
<?php | |
if (!defined('MODX_BASE_PATH')) { die('HACK???'); } | |
/** | |
* LoadElement | |
* | |
* Загрузка чанков и сниппетов из файлов | |
* | |
* @license GNU General Public License (GPL), http://www.gnu.org/copyleft/gpl.html | |
* @author Agel_Nash <modx@agel-nash.ru> |
<?php | |
/** | |
* ----------------------------------------------------------------------------------------- | |
* Based on `https://github.com/mecha-cms/mecha-cms/blob/master/system/kernel/converter.php` | |
* ----------------------------------------------------------------------------------------- | |
*/ | |
// HTML Minifier | |
function minify_html($input) { |
# Backup | |
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
# Restore | |
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
<?php | |
/** | |
* LoadElement | |
* | |
* Загрузка элементов из файлов | |
* | |
* @version 2.0.0 | |
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License (GPL) | |
* @category plugin | |
* @author Agel Nash <modx@agel-nash.ru> |
We're currently working on making it easier to add new field types to KeystoneJS as plugins.
In the meantime, if you'd like to work on your own field type, hopefully this guide will point you in the right direction.
Keystone fields require the following:
{fieldType}.js
file in ./lib/fieldTypes
that controls the field and encapsulates options support, underscore functions, validation and updating{fieldType}.js
file needs to be included by ./lib/fieldTypes/index.js
// Returns an array of dates between the two dates | |
function getDates (startDate, endDate) { | |
const dates = [] | |
let currentDate = startDate | |
const addDays = function (days) { | |
const date = new Date(this.valueOf()) | |
date.setDate(date.getDate() + days) | |
return date | |
} | |
while (currentDate <= endDate) { |