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
FROM php:7.0.4-fpm | |
RUN apt-get update && apt-get install -y libmcrypt-dev \ | |
mysql-client libmagickwand-dev --no-install-recommends \ | |
&& pecl install imagick \ | |
&& docker-php-ext-enable imagick \ | |
&& docker-php-ext-install mcrypt pdo_mysql |
// source: http://doublespringlabs.blogspot.com.br/2012/11/decoding-polylines-from-google-maps.html | |
function decode(encoded){ | |
// array that holds the points | |
var points=[ ] | |
var index = 0, len = encoded.length; | |
var lat = 0, lng = 0; | |
while (index < len) { | |
var b, shift = 0, result = 0; |
license: apache-2.0 |
$username = "some-username"; | |
$password = "some-password"; | |
$remote_url = 'http://www.somedomain.com/path/to/file'; | |
// Create a stream | |
$opts = array( | |
'http'=>array( | |
'method'=>"GET", | |
'header' => "Authorization: Basic " . base64_encode("$username:$password") | |
) |
<?php | |
/** | |
* A class to create simple custom routes. | |
* | |
* Example usage: | |
* | |
* $theme_routes = new CustomRoutes(); | |
* $theme_routes->addRoute( | |
* |
The exchange of new line & br HTML tag could refer to PHP - nl2br() function, which uses to inserts HTML line breaks before all newlines in a string.
These JavaScript functions consider whether to use insert or replace to handle the swap.