WooCommerce Documentation WooCommerce Action and Filter Hook Reference

Scaffold Symfony app from existing database

Prepare for a new run rm -r src/Entity/* rm -r src/Form/* rm -r src/Controller/* rm -r src/Repository/* rm -r templates/* Copy in a backup of base twig template cp base.html.twig templates/ Generate entities from an existing database bin/console doctrine:mapping:import “App\Entity” annotation –path=src/Entity bin/console make:entity –regenerate App Make CRUD for each new entity bin/console make:crud MyEntity… Continue reading Scaffold Symfony app from existing database

Categorised as Symfony

Query DNS data

dig Query for information on all DNS records dig your_domain_name.com ANY Query for A records dig your_domain_name.com A host, nslookup and dig share similar functionality. whois Return information about a domain name registration, including the name servers it is configured to work with whois your_domain_name.com

WordPress debugging

To turn on debugging add the following to wp-config.php // Turn debugging on define(‘WP_DEBUG’, true); // Tell WordPress to log everything to /wp-content/debug.log define(‘WP_DEBUG_LOG’, true); // Display error messages define(‘WP_DEBUG_DISPLAY’, true); Write to /wp-content/debug.log error_log(‘logging message here…’);

Backup mysql database via socks tunnel

The following bash script will open a socks tunnel with a remote host and use a local mysqldump cli tool to backup a mysql database. #!/bin/sh DT=$(date ‘+%Y-%m-%dT%H:%M:%S’) SUFFIX= FILENAME=$DT$SUFFIX BACKUPSPATH= USER= IP= PORT= DBUSER= DBPASS= DBNAME= echo “Opening socks tunnel to $IP” echo “Writing $FILENAME” ssh -f -L $PORT:$PORT $USER@$IP sleep 10; \ mysqldump… Continue reading Backup mysql database via socks tunnel

Dockerized phpmyadmin

Phpmyadmin is available as a Docker image. The mysql server connection parameters are provided when the container is instantiated. docker run -d –name pma_local \ –network=docker_network \ -e PMA_HOST=db \ -e PMA_PORT=3306 \ -e PMA_USER=root \ -e PMA_PASSWORD=password \ -p 8080:80 phpmyadmin/phpmyadmin –network The docker network the phpmyadmin container will join. PMA_HOST, PMA_PORT Name and… Continue reading Dockerized phpmyadmin

Import Barclays Bank statement

Create a table for the bank statement entries CREATE TABLE `bank_statement_entries` ( `id` int(11) NOT NULL, `cheque_id` varchar(50) DEFAULT NULL, `date` date DEFAULT NULL, `amount` decimal(13,4) DEFAULT NULL, `subcategory` varchar(50) DEFAULT NULL, `memo` varchar(100) DEFAULT NULL, `my_notes` text ) ENGINE=MyISAM DEFAULT CHARSET=latin1; SQL script for importing batch of csv statement entries into table `bank_statement_entries` DELIMITER… Continue reading Import Barclays Bank statement

Configure Laradock, XDebug, VSCode and Selenium Chrome

Getting the basics working first i.e. a simple index.php file inside laravel/public. Install Laravel framework after this setup. Directory structure: .vscode/ └── launch.json laradock/ laravel/ └── xdebug.log └── public/ └── index.php With a fresh install of Laradock cp env-example .env In .env APP_CODE_PATH_HOST=../laravel/ WORKSPACE_INSTALL_XDEBUG=true PHP_FPM_INSTALL_XDEBUG=true In laradock/selenium/Dockerfile, use the latest chrome debug image and expose… Continue reading Configure Laradock, XDebug, VSCode and Selenium Chrome