NathanFriend.co.uk

Developers notebook

Category: Uncategorized

Docker Live 2020

After watching some of the Docker Live 2020 talks https://docker.events.cube365.net/docker/dockercon I was inspired to take another look at using Docker for some PHP development work.

How to Create PHP Development Environments with Docker Compose

Become a Docker Power User With Microsoft Visual Studio Code

With the following docker-compose.yml you can stand up a PHP/MySQL environment with docker-compose up

version: '3'

services:
db:
container_name: DB
image: mysql:5.7
environment:
MYSQL_ROOT_PASSWORD: pw
MYSQL_DATABASE: MyDB
MYSQL_USER: MyDBUser
MYSQL_PASSWORD: pw
ports:
- "9906:3306"
web:
container_name: App
image: php:7.2.2-apache
depends_on:
- db
volumes:
- ./php/:/var/www/html/
ports:
- "8100:80"
stdin_open: true
tty: true


Fix OS X slow populating file picker

rm ~/Library/Caches/CloudKit/CloudKitMetadata*;killall cloudd

Orignal source: http://osxdaily.com/2015/04/17/fix-slow-folder-populating-cloudkit-macosx/

Start MySQL on Yosemite

sudo /usr/local/mysql/support-files/mysql.server start

Orignal source: http://osxdaily.com/2014/11/26/start-stop-mysql-commands-mac-os-x/

Duplicate a directory structure.

From the root of structure you want to duplicate run find . -maxdepth 2 -type d | sed 's/$/"/' | sed 's/^/mkdir "/' > create.sh

-maxdepth sets the recursion level.
-type d identifies only directories.
sed commands wrap the output in mkdir “{Path}”

Output is redirected to a file.

MS Access Sum a date time field

Example data

id TimeElapsed User
1 00:01:44 Bob
2 00:01:46 Bob

To sum a date time field first convert the field data to double with an expression using the CDbl Function.

exp1: CDbl([TimeElapsed])

Set the total type to Sum.

Then create another expression to convert the data from the first expression back to a date time field using the CVDate function.

exp2: CVDate([exp1])

Set the total value to Expression.

TimeElapsed User
00:03:30 Bob