- create a new redis .conf file
$ cp /etc/redis.conf /etc/redis-xxx.conf- edit /etc/redis-xxx.conf, illustrated as below
...| #! /bin/bash | |
| MYSQL="/opt/local/etc/LaunchDaemons/org.macports.mysql5/mysql5.wrapper" | |
| NGINX="/opt/local/sbin/nginx" | |
| PHPFPM="/opt/local/sbin/php-fpm" | |
| PIDPATH="/opt/local/var/run" | |
| MEMCACHED="/opt/local/bin/memcached -m 24 -P /opt/local/var/run/memcached.pid -u root" | |
| if [ $1 = "start" ]; then | |
| sudo $MYSQL start | |
| echo "Starting php-fpm ..." |
| #!/bin/bash | |
| if [ 1 -ne $# ] | |
| then | |
| echo "Usage `basename $0` {tar.gz database file}" | |
| exit 65; | |
| fi | |
| if [ -f "$1" ] | |
| then |
| #!/bin/bash | |
| OLD=`md5 -q composer.lock.old` | |
| NEW=`md5 -q composer.lock` | |
| if [ "$NEW" != "$OLD" ] | |
| then | |
| rm -rf vendor | |
| php composer.phar install | |
| fi | |
| cat composer.lock > composer.lock.old |
| # немного синтетики | |
| # 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 |
| <?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, |
$ cp /etc/redis.conf /etc/redis-xxx.conf...| { | |
| "presets": ["@babel/preset-env"] | |
| } |
| <?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); |
| <?php | |
| // взято здесь https://ilyaut.ru/reposts/sending-mail-through-modmail/ | |
| /** | |
| * Перед использованием установить переменные: emailsender, site_name | |
| * Опции: | |
| * [$html] отправить в виде html, если не задан, останется текст | |
| * $address строка адресов через "," | |
| * $subject | |
| * [$subject_prefix] префикс для сообщения напр, "[site_name] Вам письмо" | |
| * $message |
| Snippet: [[SnippetName]] | |
| Chunk: [[$ChunkName]] | |
| System Setting: [[++SettingName]] | |
| TV: [[*fieldName/TvName]] | |
| Link tag: [[~PageId? ¶mName=`value`]] | |
| Placeholder: [[+PlaceholderName]] | |
| <?php |