- 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 |
Snippet: [[SnippetName]] | |
Chunk: [[$ChunkName]] | |
System Setting: [[++SettingName]] | |
TV: [[*fieldName/TvName]] | |
Link tag: [[~PageId? ¶mName=`value`]] | |
Placeholder: [[+PlaceholderName]] | |
<?php |
<?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, |
#!/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 |
#! /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 ..." |
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
#!/bin/bash | |
# Tar shit up: | |
today=$(date '+%d_%m_%y') | |
echo "* Performing domain backup..." | |
tar czf /var/backups/constantshift.com_"$today".tar.gz -C / var/www/constantshift.com | |
echo "* Backed up..." | |
# Remove shit older than 7 days: | |
MaxFileAge=7 | |
find /var/backups/ -name '*.gz' -type f -mtime +$MaxFileAge -exec rm -f {} \; | |
# Rsync shit to the grid: |