The popular open-source contract for web professionals by Stuff & Nonsense
- Originally published: 23rd December 2008
- Revised date: March 15th 2016
- Original post
| function dumpdb() | |
| { | |
| # source https://stackoverflow.com/a/46042938/2223106 | |
| # source https://gist.github.com/spalladino/6d981f7b33f6e0afe6bb | |
| local wkdir=`basename $PWD` | |
| local container='echo ${wkdir}_my-wpdb_1' | |
| docker exec ${container} mysqldump -uroot --password=password wordpress > backup.sql | |
| } | |
| function restoredb() |
| #/usr/bin/bash | |
| # Loop through jpg images and apply sips, mkbitmap and potrace | |
| # http://potrace.sourceforge.net/ | |
| if [ $1 == '--help' ]; then | |
| echo "Two optional parameters: filename and threshold. Otherwise vectorizes as .jpg in current dir."; | |
| exit 1; | |
| fi |
| /** | |
| * Add & remove image sizes from the "Image Sizes" panel | |
| * | |
| * @since 1.0.0 | |
| * source: https://wpexplorer-themes.com/total/snippets/addremove-image-sizes/ | |
| */ | |
| public static function cpt_image_sizes( $sizes ) { | |
| // Remove "blog_post_full" image size | |
| unset( $sizes['blog_post_full'] ); |
| #!/bin/bash | |
| # Read more: https://medium.com/@tatemz/using-wp-cli-with-docker-21b0ab9fab79#.bzqhqfa6a | |
| # Also see https://github.com/chriszarate/docker-wordpress | |
| if [ $# -eq 0 ] ; then | |
| echo usage: directory_name | |
| else | |
| WPDIR="$1" | |
| mkdir "$WPDIR" && cd "$WPDIR" | |
| cat >> docker-compose.yml <<EOL |
| #!/bin/bash | |
| # Read more: https://medium.com/@tatemz/using-wp-cli-with-docker-21b0ab9fab79#.bzqhqfa6a | |
| # Also see https://github.com/chriszarate/docker-wordpress | |
| if [ $# -eq 0 ] ; then | |
| echo usage: directory_name | |
| else | |
| WPDIR="$1" | |
| mkdir "$WPDIR" && cd "$WPDIR" | |
| cat >> docker-compose.yml <<EOL |
| <?php | |
| require_once('../lists/admin/PHPMailer/PHPMailerAutoload.php'); | |
| //include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded | |
| $mail = new PHPMailer(); | |
| $body = file_get_contents('contents.html'); | |
| $body = eregi_replace("[\]",'',$body); | |
| $mail->IsSMTP(); // telling the class to use SMTP |
| blockquote, blockquote p { | |
| font-family: Hoefler Text,Baskerville Old Face,Garamond,Times New Roman,serif !important; | |
| font-style: normal; | |
| font-variant: normal; | |
| font-weight: 500; | |
| display: block; | |
| margin-left: auto; | |
| margin-right: auto; | |
| } | |
| blockquote p cite { |