You can have a linear workflow with the array functions.
The following is unreadable:
$output = array_reduce(
array_map(
function($n) { return $n ** 2; }
array_filter($input, function($n) { return $n % 2 == 0; })
),
You can have a linear workflow with the array functions.
The following is unreadable:
$output = array_reduce(
array_map(
function($n) { return $n ** 2; }
array_filter($input, function($n) { return $n % 2 == 0; })
),
<?xml version="1.0"?> | |
<!-- | |
/** | |
* Copyright © 2016 Magento. All rights reserved. | |
* See COPYING.txt for license details. | |
*/ | |
--> | |
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> | |
<body> | |
<!-- Remove unwanted account navigation links --> |
In order to submit extensions to Magento marketplace, source code needs to pass Magento Extension Quality Program Coding Standard checks.
You can either do it manually, by following this guide in official Github repository, or by fixing things as you code, by setting up check in PHP Storm.
<template name="magento2:__" value="<?php echo __('$SELECTION$'); ?>" description="Translation" toReformat="false" toShortenFQNames="true"> | |
<context> | |
<option name="HTML" value="true" /> | |
<option name="PHP" value="true" /> | |
</context> | |
</template> | |
<template name="magento2:collection" value="class Collection extends AbstractCollection { /** * Initialize resource model * * @return void */ protected function _construct() { $this->_init($model$::class, $resourceModel$::class); } }" toReformat="true" toShortenFQNames="true"> | |
<variable name="model" expression="" defaultValue="" alwaysStopAt="true" /> | |
<variable name="resourceModel" expression="" defaultValue="" alwaysStopAt="true" /> | |
<context> |
Ansible playbook to setup HTTPS using Let's encrypt on nginx. | |
The Ansible playbook installs everything needed to serve static files from a nginx server over HTTPS. | |
The server pass A rating on [SSL Labs](https://www.ssllabs.com/). | |
To use: | |
1. Install [Ansible](https://www.ansible.com/) | |
2. Setup an Ubuntu 16.04 server accessible over ssh | |
3. Create `/etc/ansible/hosts` according to template below and change example.com to your domain | |
4. Copy the rest of the files to an empty directory (`playbook.yml` in the root of that folder and the rest in the `templates` subfolder) |
java -jar ~/Downloads/<name_of_the_selenium_executable>.jar
dev/tests/functional/phpunit.xml
and change: app_frontend_url
, app_backend_url
(i.e. URL's of your storefront and admin page).dev/tests/functional/etc/config.xml
and change: application/backendLogin
, application/backendPassword
(i.e. admin username and password).dev/tests/functional/etc/config.xml
and use one of them at a time <server>
if ($http_user_agent ~* (360Spider|80legs.com|Abonti|AcoonBot|Acunetix|adbeat_bot|AddThis.com|adidxbot|ADmantX|AhrefsBot|AngloINFO|Antelope|Applebot|BaiduSpider|BeetleBot|billigerbot|binlar|bitlybot|BlackWidow|BLP_bbot|BoardReader|Bolt\ 0|BOT\ for\ JCE|Bot\ mailto\:craftbot@yahoo\.com|casper|CazoodleBot|CCBot|checkprivacy|ChinaClaw|chromeframe|Clerkbot|Cliqzbot|clshttp|CommonCrawler|comodo|CPython|crawler4j|Crawlera|CRAZYWEBCRAWLER|Curious|Curl|Custo|CWS_proxy|Default\ Browser\ 0|diavol|DigExt|Digincore|DIIbot|discobot|DISCo|DoCoMo|DotBot|Download\ Demon|DTS.Agent|EasouSpider|eCatch|ecxi|EirGrabber|Elmer|EmailCollector|EmailSiphon|EmailWolf|Exabot|ExaleadCloudView|ExpertSearchSpider|ExpertSearch|Express\ WebPictures|ExtractorPro|extract|EyeNetIE|Ezooms|F2S|FastSeek|feedfinder|FeedlyBot|FHscan|finbot|Flamingo_SearchEngine|FlappyBot|FlashGet|flicky|Flipboard|g00g1e|Genieo|genieo|GetRight|GetWeb\!|GigablastOpenSource|GozaikBot|Go\!Zilla|Go\-Ahead\-Got\-It|GrabNet|grab|Grafula|GrapeshotCrawler|GTB5|GT\:\:WWW|Guzz |
<?php | |
/** | |
* Enable sql profiling for each page. | |
* | |
* Put code to index file in two parts | |
*/ | |
// place it BEFORE application run | |
$profiler = \Magento\Framework\App\ObjectManager::getInstance() | |
->get('Magento\Framework\App\ResourceConnection') |
#Steps to install latest Laravel, LEMP on AWS Ubuntu 16.4 version. This tutorial is the improvised verision of this tutorial on Digitalocean based on my experience.
Run the following commands in sequence.
sudo apt-get install -y language-pack-en-base
sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install zip unzip