[PHP]Convert JSON to class instance

https://johannespichler.com/from-json-to-model-instances-in-php/

PHP 7.1 new features

Nullable Types

// return null|int
function checkAge($age): ?int
{
	if($age > 12){
		return $age;
	}else{
		return null; 
	}
}

PHP extensions for Laravel

  • php7.1
  • php7.1-common
  • php7.1-cli
  • php7.1-fpm
  • php7.1-mysql
  • php7.1-mcrypt
  • php7.1-mbstring
  • php7.1-xml
  • php7.1-gd
  • php7.1-curl
  • php-xdebug
  • php7.1-bcmath

Travis CI

https://docs.travis-ci.com/user/docker/ https://docs.travis-ci.com/user/languages/ruby/#stq=&stp=0 https://docs.travis-ci.com/user/deployment/s3/

Execute Artisan Command

```php \Illuminate\Support\Facades\Artisan::call(‘command’, [ ‘param1’ => ‘value’, ‘–param2’ => ‘value’, ]);

Host static website on AWS S3

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "PublicReadGetObject",
            "Effect": "Allow",
            "Principal": "*",
            "Action": [
                "s3:GetObject"
            ],
            "Resource": [
                "arn:aws:s3:::example-bucket/*"
            ]
        }
    ]
}

Lactation Cookies

Cookies recipes

  • 1 cup self raising wholemeal flour (if you have plain flour, add 1/2 teaspoon baking powder)
  • 1/2 cup butter (you can use organic virgin coconut oil instead if you prefer)
  • 3/4 cup brown sugar (if you want to reduce sugar, you could try just 1/2 cup)
  • 2 tablespoons flaxseed meal
  • 1 egg
  • 2-3 tablespoons of water (depends on how moist you prefer the cookies to be)
  • 1 tablespoon vanilla extract (optional, for flavour)
  • 1 teaspoon cinnamon (optional, for flavour)
  • 1-2 tablespoons of brewers yeast – do not substitute with bakers yeast or any other yeast
  • 1/2 teaspoon salt
  • 1 & 1/2 cups oats – organic, steel cut oats are best for you, but rolled oats are fine
  • OPTIONAL: 1/2 cup of your favourite biscuit ingredients (see suggested list below) -

Crontab schedule

Description Example
Every minute * * * * *
Every 2nd minute * /2 * * *
At minute 30. 30 * * * *
At 00:00. 0 0 * * *

Deletion Distance

Overview

The deletion distance of two strings is the minimum number of characters you need to delete in the two strings in order to get the same string. For instance, the deletion distance between heat and hit is 3:

[PHP]Calling dynamic method by name

```php