apt-get install postgresql-12
sudo -u postgres psql
type PromiseAny<T = any> = Promise<T>; | |
interface IClass { | |
methodA: ( | |
paramA?: string, | |
) => PromiseAny | void; | |
} |
# Disable PHAR readonly for producing PHAR archives | |
RUN echo 'phar.readonly=0' >> /usr/local/etc/php/conf.d/docker-php-phar-readonly.ini |
version: '3.3' | |
services: | |
wordpress: | |
depends_on: | |
- db | |
- phpmyadmin | |
image: wordpress:latest | |
ports: | |
- 8000:80 |
// Pipe takes the first argument and pipes it though each of the functions that you provide as the remaining arguments, | |
// and can be implemented as follows: | |
const pipe = (...fns) => x => fns.reduce((v, f) => f(v), x); | |
const fn1 = s => s.toLowerCase(); | |
const fn2 = s => s.split('').reverse().join(''); | |
const fn3 = s => s + '!' | |
const newFunc = pipe(fn1, fn2, fn3); | |
const result = newFunc('Time'); // emit! |
const compose = (...fns) => x => fns.reduceRight((v, f) => f(v), x); |
#!/usr/bin/env bash | |
# This script will transfer a directory from a source server (A) | |
# into a directory on a target server (B) | |
# Pre-requisites: The script must be run by a user who has SSH / passwordless access to both server A & B | |
# From StackExchange.com (https://unix.stackexchange.com/a/317815) - Authored by David I. (https://unix.stackexchange.com/users/71948/david-i) adapated from an answer by roaima (https://unix.stackexchange.com/users/100397/roaima) - Under the license: cc by-sa 4.0 with attribution required (https://creativecommons.org/licenses/by-sa/4.0/) | |
# Slight modifications may have been made to the original script, which are in no way endorsed by the original authors of this script | |
# Specific alterations include: | |
# - the rsync parameters checking files by checksum instead of date/time/size |
#!/usr/bin/env bash | |
# This script will pipe a MySQL database from a source server (A) | |
# into a target MySQL database on another server (B) | |
# From StackExchange.com (https://dba.stackexchange.com/a/180) - Authored by David Hall - Under the license: cc by-sa 4.0 with attribution required (https://creativecommons.org/licenses/by-sa/4.0/) | |
# Slight modifications may have been made to the original script, which are in no way endorsed by the original author(s) of this script | |
# Specific alterations include: | |
# - Adding both a source & target hostname & database | |
# - Updating the command-line options in line with the latest versions of the `mysqldump` & `mysql` command-line tools |
#!/usr/bin/env bash | |
APP=a | |
if [[ "$1" ]]; then | |
APP="$1" | |
fi | |
# This is automatically determined by the $APP variable | |
CONFIG="app-default.config" | |
case "$APP" in |