This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM php:7.3-fpm-alpine | |
# Install dev dependencies | |
RUN apk add --no-cache --virtual .build-deps \ | |
$PHPIZE_DEPS \ | |
curl-dev \ | |
imagemagick-dev \ | |
libjpeg-turbo \ | |
libjpeg-turbo-dev \ | |
libjpeg \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* These are two points in New York City */ | |
$point1 = array('lat' => 40.770623, 'long' => -73.964367); | |
$point2 = array('lat' => 40.758224, 'long' => -73.917404); | |
$distance = getDistanceBetweenPoints($point1['lat'], $point1['long'], $point2['lat'], $point2['long']); | |
foreach ($distance as $unit => $value) { | |
echo $unit.': '.number_format($value,4).'<br />'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var crypto = require('crypto'); | |
var key = 'MySecretKey12345'; | |
var iv = '1234567890123456'; | |
var cipher = crypto.createCipheriv('aes-128-cbc', key, iv); | |
var decipher = crypto.createDecipheriv('aes-128-cbc', key, iv); | |
var text = 'plain text'; | |
var encrypted = cipher.update(text, 'utf8', 'binary'); | |
encrypted += cipher.final('binary'); | |
hexVal = new Buffer(encrypted, 'binary'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class BlogController extends Controller | |
{ | |
/** | |
* Posts | |
* | |
* @return void | |
*/ | |
public function showPosts() |