This file will setup Wordpress, MySQL & PHPMyAdmin with a single command. Add the code below to a file called "docker-compose.yaml" and run the command
$ docker-compose up -d
# To Tear Down
$ docker-compose down --volumes
| // Regex para validação de string no formato CNPJ | |
| export const regexCNPJ = /^\d{2}.\d{3}.\d{3}\/\d{4}-\d{2}$/ | |
| // Método de validação | |
| // Referência: https://pt.wikipedia.org/wiki/Cadastro_Nacional_da_Pessoa_Jur%C3%ADdica | |
| export function validCNPJ(value: string | number | number[] = '') { | |
| if (!value) return false | |
| // Aceita receber o valor como string, número ou array com todos os dígitos | |
| const isString = typeof value === 'string' |
| <?php if ( ! defined( 'ABSPATH' ) ) { | |
| die( 'Restricted Area' ); | |
| } | |
| /* | |
| * Plugin Name: Sanitize File Name | |
| * Description: Clean file name when uploading files in WordPress. | |
| * Version: 20240103 | |
| * Author: Mickaël Gris (Saipafo) & Aurélien Denis (WP channel) | |
| * Author URI: https://wpchannel.com/wordpress/tutoriels-wordpress/renommer-automatiquement-fichiers-accentues-wordpress/ |
| #http://stackoverflow.com/questions/6348289/download-a-working-local-copy-of-a-webpage | |
| #http://stackoverflow.com/questions/8755229/how-to-download-all-file-from-website-using-wget | |
| #http://stackoverflow.com/questions/4272770/wget-with-authentication?rq=1 | |
| #add browser headers: | |
| #--header="Accept: text/html" --user-agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:21.0) Gecko/20100101 Firefox/30.0" | |
| #add .htaccess authentication details: | |
| #--password=password --user=user | |
| wget -m -p -E -k -K -np http://site/path/ | |
| wget -p -k http://ExampleSite.com | |
| # and another via Quora https://www.quora.com/How-do-you-export-a-WordPress-site-to-a-static-HTML |
| FROM php:5.6-apache | |
| RUN apt-get update && apt-get install -y libpq-dev && docker-php-ext-install pdo pdo_pgsql | |
| COPY src/ /var/www/html |
| # Backup | |
| docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
| # Restore | |
| cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
| convert -density 256x256 -background transparent favicon.svg -define icon:auto-resize -colors 256 favicon.ico |
| #!/bin/bash | |
| # Author: Maxwel Leite | |
| # Website: http://needforbits.wordpress.com/ | |
| # Description: Script to install the latest Wine Tahoma Regular and Wine Tahoma Bold fonts on Ubuntu distros from the Wine Project. | |
| # The Wine project includes the free and open-source fonts Wine Tahoma Regular and Wine Tahoma Bold released under LGPL | |
| # designed to have identical metrics to the Microsoft Tahoma font. This was done because Tahoma is available by default | |
| # on Windows, and many applications expect the font to be available. | |
| # Dependencies: wget | |
| # Tested: Ubuntu Saucy/Trusty/Xenial |
| #!/bin/bash | |
| # Author: Maxwel Leite | |
| # Website: http://needforbits.wordpress.com/ | |
| # Description: Script to install Microsoft Vista TrueType Fonts (TTF) aka Microsoft’s ClearType fonts on Ubuntu distros | |
| # Microsoft added a group of new "ClearType Fonts" to Windows with Windows Vista and Office 2007. | |
| # These fonts are named Constantia, Corbel, Calibri, Cambria (and Cambria Math), Candara, and Consolas. | |
| # Calibri became the default font on Microsoft Word 2007, and it’s still the default font on Word 2016 today. | |
| # Dependencies: wget, fontforge and cabextract | |
| # Note: Microsoft no longer provides the PowerPoint Viewer 2007 (v12.0.4518.1014) or any version anymore for download | |
| # Tested: Ubuntu Saucy/Trusty/Xenial/Bionic |