- create a new redis .conf file
$ cp /etc/redis.conf /etc/redis-xxx.conf
- edit /etc/redis-xxx.conf, illustrated as below
...
from dataclasses import dataclass, field | |
from itertools import count | |
from datetime import datetime | |
counter = count() | |
@dataclass | |
class Event: | |
message: str |
FROM python:3.6.3-alpine3.6 | |
COPY requirements.txt / | |
RUN apk --update add --virtual .base build-base && \ | |
apk add --no-cache postgresql-dev && \ | |
pip install -r requirements.txt && \ | |
rm requirements.txt && \ | |
apk del .base && \ | |
adduser -D -S -u 1000 -G users -h /home/app app && \ | |
rm -rf /tmp/* /var/tmp/* /usr/share/man /tmp/* /var/tmp/* \ |
var addEvent = function(el, e, callback, capture) { | |
if (!!window.addEventListener) { | |
el.addEventListener(e, callback, !!capture); | |
} else { | |
el.attachEvent("on" + e, callback); | |
} | |
}, | |
removeEvent = function(el, e, callback, capture) { | |
if (!!window.addEventListener) { | |
el.removeEventListener(e, callback, !!capture); |
Snippet: [[SnippetName]] | |
Chunk: [[$ChunkName]] | |
System Setting: [[++SettingName]] | |
TV: [[*fieldName/TvName]] | |
Link tag: [[~PageId? ¶mName=`value`]] | |
Placeholder: [[+PlaceholderName]] | |
<?php |
<?php | |
// взято здесь https://ilyaut.ru/reposts/sending-mail-through-modmail/ | |
/** | |
* Перед использованием установить переменные: emailsender, site_name | |
* Опции: | |
* [$html] отправить в виде html, если не задан, останется текст | |
* $address строка адресов через "," | |
* $subject | |
* [$subject_prefix] префикс для сообщения напр, "[site_name] Вам письмо" | |
* $message |
<?php | |
if (empty($parent)) {$parent = $modx->resource->id;} | |
$pids = array_merge(array($parent), $modx->getChildIds($parent)); | |
$ids = array(); | |
$q = $modx->newQuery('msProduct'); | |
$q->where(array('class_key' => 'msProduct','parent:IN' => $pids,'published' => 1,'deleted' => 0)); | |
$q->select('`msProduct`.`id`'); | |
if ($q->prepare() && $q->stmt->execute()) { | |
$ids = $q->stmt->fetchAll(PDO::FETCH_COLUMN); |
{ | |
"presets": ["@babel/preset-env"] | |
} |
$ cp /etc/redis.conf /etc/redis-xxx.conf
...
<?php | |
// (string) $message - message to be passed to Slack | |
// (string) $room - room in which to write the message, too | |
// (string) $icon - You can set up custom emoji icons to use with each message | |
public static function slack($message, $room = "engineering", $icon = ":longbox:") { | |
$room = ($room) ? $room : "engineering"; | |
$data = "payload=" . json_encode(array( | |
"channel" => "#{$room}", | |
"text" => $message, |
# немного синтетики | |
# fmt = "<p>{0} {1} (<a href='mailto:{2}'>{2}</a>)</p>" | |
String::format = (args...) -> | |
@replace /{(\d+)}/g, (match, number) -> | |
if number < args.length then args[number] else match |