Include a technical summary of the code update.
[x] added unit test [x] executed all unit tests in DEV env [x] added PHPUnit groups to facilitate unit tests execution
[x] conducted basic QA in TEST/DEV envs
# | |
# BACKUP FILES | |
# sources: | |
# https://tonyteaches.tech/rsync-backup-tutorial/ | |
# https://www.nexcess.net/help/using-rsync-for-backups/ | |
# | |
# daily | |
tar -zcf /home/tony/backup/daily/backup-$(date +%Y%m%d).tar.gz /home/website/public_html | |
find /home/tony/backup/daily/* -mtime +7 -delete |
# | |
# renews lets encrypt on a running server | |
# note: not ideal as it stops/renews nginx for a few millisecs | |
# | |
sudo certbot certonly --standalone --pre-hook "service nginx stop" --post-hook "service nginx restart" -d mydomain.com -d www.mydomain.com | |
const myMethod = function () { | |
const promise = new Promise(function (resolve, reject) { | |
const result = null; | |
const y = "geeksforgeeks"; | |
if (result !== null) { | |
resolve(result); | |
} else { | |
reject("Error"); | |
} | |
}); |
<?php | |
namespace App; | |
use PHPMailer\PHPMailer\PHPMailer; | |
use PHPMailer\PHPMailer\SMTP; | |
class Mailer | |
{ | |
private $client; |
# | |
# 2. install ffmpeg on Ubuntu 18.04 | |
# https://linuxize.com/post/how-to-install-ffmpeg-on-ubuntu-18-04/ | |
# | |
sudo apt update | |
sudo apt install ffmpeg | |
ffmpeg -version | |
# | |
# 1. install audacity on Ubuntu |
/* | |
* Postman script to automatically get token and assign it to environment variable | |
* - Create new endpoint (GET, POST, etc) | |
* - Create an env variable called "access_token" | |
* - Add this script in Tests tab in Postman for your newly created endpoint | |
* - To debug you can use Postman Console (Alt + Ctrl + C) | |
*/ | |
const tokenUrl = 'https://mywebsite.com/auth/token'; | |
const apiKey = "123FJSKAHFSAJFHSAFKJSAFHASSAFA"; |
# PHP COMPATIBILITY CHECK | |
# PHP CODE SNIFFER (with compatibility 7.4) | |
docker run --rm -v $(pwd):/app vfac/php7compatibility 7.4 [folder or file path] --extensions=php --ignore=vendor | |
# ------- | |
# PHPSTAN (with .neon configs) |
<?php | |
/* | |
* Prints out time the specified method takes to run. | |
* Just need to add a bunch of files in your specified directory | |
* | |
* From console: php index.php [name_of_method] (ex: php index.php runiterator) | |
* From web request: go to http://yourdomain.test/?test=[name_of_method] (ex: http://yourdomain.test/?test=runglob) | |
* | |
*/ |