<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Asrar</title>
    <description>The latest articles on Forem by Asrar (@asrar7787).</description>
    <link>https://forem.com/asrar7787</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F174375%2F78483d67-d232-45aa-a9b0-bf50bf4b08b6.jpeg</url>
      <title>Forem: Asrar</title>
      <link>https://forem.com/asrar7787</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/asrar7787"/>
    <language>en</language>
    <item>
      <title>Magento 2 Super Fast Setup RAM Disk Mac OS</title>
      <dc:creator>Asrar</dc:creator>
      <pubDate>Sun, 05 Apr 2020 14:40:43 +0000</pubDate>
      <link>https://forem.com/asrar7787/magento-2-super-fast-setup-ram-disk-mac-os-2eci</link>
      <guid>https://forem.com/asrar7787/magento-2-super-fast-setup-ram-disk-mac-os-2eci</guid>
      <description>&lt;p&gt;I have been working on &lt;code&gt;Magento An Adobe Company&lt;/code&gt; community for a time now. Folks, who are familiar with &lt;code&gt;Magento An Adobe Company&lt;/code&gt;, we know that application speed is the most expected factor that counts in local development time.&lt;/p&gt;

&lt;p&gt;Since the release of Magento 2.x.x there have been growing talks about - is Magento 1.x.x faster than Magento 2.x.x and vice-versa.&lt;br&gt;
Simply put, any product, doesn't matter any - you name it, has its own pros and cons.&lt;br&gt;
However, on the positive side, every product's &lt;code&gt;major&lt;/code&gt; release comes with pack of new features that we might previously have been talking about in the community.&lt;/p&gt;

&lt;p&gt;In terms of setting up local machine for development, I am a firm believer of using my host machine as much as possible. It's purely to do with my years of skills around many different distribution of Linux OS. Alongside using host, I also use Docker regular basis for spin things up when necessary.&lt;/p&gt;

&lt;h1&gt;
  
  
  Magento setup - the traditional way
&lt;/h1&gt;

&lt;p&gt;Setting up a default instance of Magento 1.x.x on a local machine generally used to take me &lt;code&gt;30 minutes&lt;/code&gt;, without using vagrant or docker. On a 16GB MacBook Pro this setup generally works fast without needing any extra performance tuning.&lt;/p&gt;

&lt;p&gt;Setting up a default instance of Magento 2.3.4 on a local machine generally takes me &lt;code&gt;30 minutes&lt;/code&gt; - again, without using vagrant or docker. On a 16GB MacBook Pro this setup generally should work as fast as Magento 1.x.x without needing any extra performance tuning.&lt;/p&gt;

&lt;p&gt;But Magento 2.x.x starts to show performance degradation as the code base starts to grow i.e multi-website setup, having multiple modules etc.&lt;br&gt;
I know there are thousands of developer who have been suffering from it!&lt;/p&gt;

&lt;h1&gt;
  
  
  The solution to speed
&lt;/h1&gt;

&lt;p&gt;So I came up with an architecture level solution to use &lt;code&gt;RAM disk&lt;/code&gt; which works blazingly fast. Using &lt;code&gt;RAM disk&lt;/code&gt; in E-Commerce might be something new but the usage of &lt;code&gt;RAM disk&lt;/code&gt; to run application has been a long practice in financial industry. &lt;/p&gt;

&lt;h1&gt;
  
  
  What is a RAM disk?
&lt;/h1&gt;

&lt;p&gt;A RAM disk is a portion of memory allocated in the RAM by the OS. Once RAM disk is configured, it acts like a mountable drive as if it is an external physical drive. It can be mounted and unmounted at any time.&lt;/p&gt;

&lt;h1&gt;
  
  
  Why RAM disk is fast?
&lt;/h1&gt;

&lt;p&gt;Any data put inside a RAM disk is processed without OS needing to write to a physical disk storage. The data communication between CPU kernel and RAM becomes direct. Hence the speed is super fast.&lt;/p&gt;

&lt;h1&gt;
  
  
  What I should know before I start using it?
&lt;/h1&gt;

&lt;p&gt;Of course it has its downside. The data which are available in a RAM disk is volatile. It means any data will be instantly erased if for any reason the host machine lost its power. More importantly, the host machine needs to have as much RAM as possible.&lt;/p&gt;

&lt;h1&gt;
  
  
  Regular backup is the key factor
&lt;/h1&gt;

&lt;p&gt;To mitigate data loss, it's an industry-wide practice to backup the data after certain interval - a very frequent interval i.e. every 10 mins.&lt;/p&gt;

&lt;h1&gt;
  
  
  What should be the size of a RAM disk?
&lt;/h1&gt;

&lt;p&gt;As mentioned, a RAM disk acts like an external storage. A decent size would be 4GB. On MacBook Pro 16GB, it can handle up to two Magento 2.x.x setup at a time with 4 or 5 background application running i.e. PHPStorm, Table Plus and 2/3 browser windows with multiple tabs. To save further system resources on browser tabs, using tab suspending browser extension would be ideal.&lt;/p&gt;

&lt;h1&gt;
  
  
  What can I save in a RAM disk?
&lt;/h1&gt;

&lt;p&gt;RAM disk can be used to save both the code base and MYSQL database. Both the code base and MYSQL database can be exposed to host machine using symbolic linking or just by using the &lt;code&gt;volume mounting path&lt;/code&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  Do I need a super computer to use a RAM disk?
&lt;/h1&gt;

&lt;p&gt;Generally, the host machine needs to have as much RAM as possible. I used a multi-store Magento 2.3.x and a single store Magento 2.3.x on a MacBook Pro 16GB RAM with regular incremental backup.&lt;br&gt;
The more the RAM space the more the Magento 2.3.x setup you can have without exhausting system resources.&lt;/p&gt;

&lt;h1&gt;
  
  
  RAM disk architecture diagram
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--J9MnBhAi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/67ul94d4mxa7k3v7mwp4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--J9MnBhAi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/67ul94d4mxa7k3v7mwp4.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Final thoughts
&lt;/h1&gt;

&lt;p&gt;The discussion on this article could open up a new window as to how we can achieve maximum speed from architectural point of view when it comes to production-level hosting as well. By the way, which doesn't mean, developers should overlook performance factors in their codes and relying heavily on stack resources. A non-performant code will always be non-performant even it gets deployed in a RAM disk.&lt;br&gt;
While server resources can be redesigned, E-Commerce community should explore new and faster web-technology tools i.e. Vue, React.&lt;br&gt;
Enjoy the speed!&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>devops</category>
      <category>magento</category>
      <category>webdev</category>
    </item>
    <item>
      <title>PHP Composer package version cheatsheet</title>
      <dc:creator>Asrar</dc:creator>
      <pubDate>Mon, 30 Mar 2020 22:45:37 +0000</pubDate>
      <link>https://forem.com/asrar7787/php-composer-package-version-cheatsheet-1h81</link>
      <guid>https://forem.com/asrar7787/php-composer-package-version-cheatsheet-1h81</guid>
      <description>&lt;p&gt;&lt;br&gt;
&lt;code&gt;"require": {&lt;br&gt;
    "vendor/package": "1.5.4", // Exact version to 1.5.4&lt;br&gt;
    "vendor/package": "&amp;gt;=1.5.0", // Anything above 1.5.0&lt;br&gt;
    "vendor/package": "&amp;lt;1.5.0", // Anything below 1.5.0&lt;br&gt;
    "vendor/package": "1.5.*", // Wildcard i.e. &amp;gt;=1.5 &amp;lt;1.6&lt;br&gt;
    "vendor/package": "~1.5", // Next significant release i.e. &amp;gt;=1.5 &amp;lt;2.0.0 // &lt;br&gt;
    "vendor/package": "~1.5.2", // Next significant release i.e. &amp;gt;=1.5.2 &amp;lt;1.6.0&lt;br&gt;
    "vendor/package": "^1.5.2", // Next release, major version fixed i.e. &amp;gt;=1.5.2 &amp;lt;2.0.0 &lt;br&gt;
    "vendor/package": "^0.5.2", // Next release, major version fixed i.e. &amp;gt;=0.5.2 &amp;lt;0.6.0&lt;br&gt;
}&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

</description>
      <category>php</category>
      <category>composer</category>
    </item>
    <item>
      <title>Install New Relic on Mac OS using homebrew php</title>
      <dc:creator>Asrar</dc:creator>
      <pubDate>Mon, 30 Mar 2020 22:23:44 +0000</pubDate>
      <link>https://forem.com/asrar7787/install-new-relic-on-mac-os-using-homebrew-2h6p</link>
      <guid>https://forem.com/asrar7787/install-new-relic-on-mac-os-using-homebrew-2h6p</guid>
      <description>&lt;p&gt;1.Grab archive from &lt;a href="https://download.newrelic.com/php_agent/release/"&gt;https://download.newrelic.com/php_agent/release/&lt;/a&gt; and decompressed&lt;br&gt;
gzip -dc newrelic-php*.tar.gz | tar xf -&lt;br&gt;
cd newrelic-php*/&lt;/p&gt;

&lt;p&gt;2.Check homebrew's PHP extension path exists&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ls -al /usr/local/Cellar/php@7.2/7.2.25/lib/php/20170718/&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;(My PHP version is &lt;code&gt;7.2&lt;/code&gt; and lib version is &lt;code&gt;20170718&lt;/code&gt;. Yours might be different based on PHP version. But in any case, &lt;code&gt;/usr/local/Cellar/php&lt;/code&gt; is a good direction.)&lt;/p&gt;

&lt;p&gt;3.Run install script with custom paths (since /usr/bin is not writeable because of macOS "system integrity protection")&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;NR_INSTALL_INITFILE=/usr/local/bin/newrelic-daemon-service NR_INSTALL_DAEMONPATH=/usr/local/bin/newrelic-daemon ./newrelic-install&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;4.Now New Relic agent has been installed and the daemon can be started using &lt;code&gt;sudo newrelic-daemon-service start&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;5.If you don't want to use &lt;code&gt;sudo&lt;/code&gt;, you need to change owner and group of &lt;code&gt;/var/log/newrelic/newrelic-daemon.log&lt;/code&gt; to your own user and group.&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;chown staff /var/log/newrelic/newrelic-daemon.log&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Then simply run &lt;code&gt;newrelic-daemon&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;6.Ensure New Relic daemon is up and running by running&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ps aux | grep newrelic&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;That's it, have fun with APM data!&lt;/p&gt;

</description>
      <category>newrelic</category>
      <category>architecture</category>
      <category>php</category>
    </item>
    <item>
      <title>ElasticHQ Setup On Docker</title>
      <dc:creator>Asrar</dc:creator>
      <pubDate>Tue, 22 Oct 2019 04:12:50 +0000</pubDate>
      <link>https://forem.com/asrar7787/elastichq-setup-on-docker-5027</link>
      <guid>https://forem.com/asrar7787/elastichq-setup-on-docker-5027</guid>
      <description>&lt;h1&gt;
  
  
  ElasticHQ Setup On Docker
&lt;/h1&gt;

&lt;p&gt;In this article, I am going to highlight what ElasticHQ is very briefly, its benefits and how we can install it using Docker.&lt;/p&gt;

&lt;p&gt;ElasticHQ is a powerful GUI tool packed with tons of good features which can be used to make life easier and meaningful when using with Elasticsearch. &lt;/p&gt;

&lt;h2&gt;
  
  
  Benefits
&lt;/h2&gt;

&lt;p&gt;Some of its most useful features are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Indices, nodes, shards, document size can be seen visually.&lt;/li&gt;
&lt;li&gt;Visual cluster health indicator.&lt;/li&gt;
&lt;li&gt;Visually manage indices, nodes.&lt;/li&gt;
&lt;li&gt;Includes a &lt;code&gt;Rest&lt;/code&gt; API feature which can be used to retrieve information without using terminal and curl commands.&lt;/li&gt;
&lt;li&gt;A powerful &lt;code&gt;Query&lt;/code&gt; feature to make life much easier to search through Elasticsearch documents. This is really great to validate if a document has been saved or not.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now let's see its installation process. We will install ElasticHQ using Docker. This guide is based on Mac, however the commands should be identical or similar on other platforms. &lt;em&gt;This guide also assumes, you are using Elasticsearch cluster on Docker.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  ElasticHQ Installation
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Determine the Docker &lt;code&gt;network&lt;/code&gt; which your Elasticsearch nodes are on. &lt;em&gt;This is imperative to ensure both Elasticsearch cluster and ElasticHQ use the same Docker network.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In terminal run:&lt;br&gt;
&lt;code&gt;docker run -d -p 5000:5000 --network elasticsearch -e HQ_DEFAULT_URL='http://es01:9200' -e HQ_ENABLE_SSL=False --name elastichq elastichq/elasticsearch-hq&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Change Elasticsearch cluster URL &lt;code&gt;HQ_DEFAULT_URL='http://es01:9200'&lt;/code&gt; and the &lt;br&gt;
&lt;code&gt;--network elasticsearch&lt;/code&gt;  to match yours.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If you are using Elasticsearch cluster using &lt;code&gt;docker-compose&lt;/code&gt;, ensure to use the Elasticsearch master node's &lt;code&gt;service name&lt;/code&gt; as it appears in &lt;code&gt;docker-compose.yml&lt;/code&gt;. &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let's look at an example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;version: '3.1'

services:
  elasticsearch: #master node's service name
    image: elasticsearch
    container_name: elasticsearch_cluster
    environment:
      - cluster.name=docker-cluster
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    ports:
      - 9200:9200
    volumes:
      - ./db:/usr/share/elasticsearch/data
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;For this recipe to work, our docker command would have been changed to:
&lt;code&gt;docker run -d -p 5000:5000 --network elasticsearch -e HQ_DEFAULT_URL='http://elasticsearch:9200' -e HQ_ENABLE_SSL=False --name elastichq elastichq/elasticsearch-hq&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Otherwise ElasticHQ will not be able to connect to cluster.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;This is an important point to remember!&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Now, update Elasticsearch node's configuration file &lt;code&gt;elasticsearch.yml&lt;/code&gt; by adding below :
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;http.cors.enabled : true
http.cors.allow-origin : "*"
http.cors.allow-methods : OPTIONS, HEAD, GET, POST, PUT, DELETE
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;This configuration file can be accessed in Elasticsearch Docker container. If you have multiple nodes you will need to add these in each node's configuration.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Adding these values will ensure ElasticHQ can communicate with each Elasticsearch node available on your cluster.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Restart each Elasticsearch node.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Restart ElasticHQ service:&lt;br&gt;
&lt;code&gt;docker conatiner restart elastichq&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;ElasticHQ GUI is now accessible via &lt;code&gt;localhost:5000&lt;/code&gt;. Make sure to enter the correct Elasticsearch service URL and choose correct Elasticsearch cluster on the main admin page.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By using ElasticHQ, hope you can reduce your all guess work and increase productivity.&lt;/p&gt;

</description>
      <category>docker</category>
      <category>webdev</category>
      <category>devops</category>
    </item>
    <item>
      <title>Mac os x install Xdebug with multiple PHP versions</title>
      <dc:creator>Asrar</dc:creator>
      <pubDate>Mon, 21 Oct 2019 00:47:40 +0000</pubDate>
      <link>https://forem.com/asrar7787/mac-os-x-install-xdebug-with-multiple-php-versions-4377</link>
      <guid>https://forem.com/asrar7787/mac-os-x-install-xdebug-with-multiple-php-versions-4377</guid>
      <description>&lt;p&gt;If you have brew installed with multiple PHP versions i.e. 7.1, 7.2 and 7.3 on Mac OS X mojave, you can to do the following:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Install autoconf with brew &lt;code&gt;brew install autoconf&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Change to the PHP version that you want Xdebug on, run &lt;code&gt;brew unlink php@7.1 &amp;amp;&amp;amp; brew link --force --overwrite php&lt;/code&gt;. This will switch from PHP 7.1 to PHP 7.3.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Download the latest Xdebug source from &lt;a href="https://xdebug.org/download"&gt;xdebug&lt;/a&gt; website.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Extract the Xdebug tar and navigate to extracted directory, where you'd see all the files.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Run &lt;code&gt;phpize&lt;/code&gt; to configure the build for the new Zend engine.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Run &lt;code&gt;./configure&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Run &lt;code&gt;make&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Xdebug extension &lt;code&gt;xdebug.so&lt;/code&gt; gets compiled in &lt;code&gt;modules&lt;/code&gt; directory.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create a new directory path under &lt;code&gt;/usr/local/lib/php/7.3.1/extensions/&lt;/code&gt; and copy &lt;code&gt;xdebug.so&lt;/code&gt; to this location. Here, &lt;code&gt;7.3.1&lt;/code&gt; is the current version that I switched earlier, change this to match your PHP version.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Open &lt;code&gt;php.ini&lt;/code&gt; in an editor and enter&lt;br&gt;
&lt;code&gt;zend_extension="/usr/local/lib/php/7.3.1/extensions/xdebug.so"&lt;/code&gt; then save the change.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Run &lt;code&gt;php -v&lt;/code&gt; and it will show Xdebug has been configured correctly.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you want to configure Xdebug on another PHP version then just repeat from step 2 all the way to 11. As mentioned in earlier post, this way you don't need to disable/enable System Integrity Protection on Mac OS X.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>devops</category>
    </item>
    <item>
      <title>Mac OS X brew install varnish specific version</title>
      <dc:creator>Asrar</dc:creator>
      <pubDate>Sat, 17 Aug 2019 22:33:46 +0000</pubDate>
      <link>https://forem.com/asrar7787/mac-os-x-brew-install-varnish-specific-version-pmm</link>
      <guid>https://forem.com/asrar7787/mac-os-x-brew-install-varnish-specific-version-pmm</guid>
      <description>&lt;p&gt;In Mac OS X High Sierra or later version, let's say you upgraded Varnish HTTP Accelerator from 4.x.x/5.x.x to any latest versions 6.x.x using &lt;em&gt;brew&lt;/em&gt;. And now for any reasons you want to go back to previous version i.e. 5.2.0 altogether? Good news folks! &lt;br&gt;
You can do that by copying over the actual brew formulae on your local and defining the version you want in the &lt;em&gt;rb&lt;/em&gt; file. &lt;br&gt;
&lt;em&gt;In the following example, I want to revert to version 5.2.0 from 6.2.0.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Let's copy over the file from &lt;a href="https://github.com/Homebrew/homebrew-core/blob/master/Formula/varnish.rb"&gt;https://github.com/Homebrew/homebrew-core/blob/master/Formula/varnish.rb&lt;/a&gt;  to your local. Then edit the &lt;em&gt;varnish.rb&lt;/em&gt; file, remove/comment out the following lines:&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sha256 "c37af353aca25a83d22f9c5ce0ae800fe433e4d02e1457e02886a5849f988e53"

bottle do

    sha256 "7101ff2895f77803ea1e1ca6c8ebc1feef2c07b77fbf612f6dcf6983bf4ffc27" =&amp;gt; :mojave

    sha256 "d1fd8751be2ddccb463b385377b88cc440632eb1a07c0175fab9ee77c57f986d" =&amp;gt; :high_sierra

    sha256 "e124ad1c5638c7304743b5f3dbec996afa33c972dbe991ec35280c4d7787b3a4" =&amp;gt; :sierra

end
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Replace this line: &lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;url "https://varnish-cache.org/_downloads/varnish-6.2.0.tgz"
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;with &lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;url "https://varnish-cache.org/_downloads/varnish-5.2.0.tgz"
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;You can get all available versions in &lt;a href="https://varnish-cache.org/releases/"&gt;https://varnish-cache.org/releases/&lt;/a&gt;. All you need to do is to tap on the intended version and paste the download url.&lt;/p&gt;

&lt;p&gt;Now, save this &lt;em&gt;varnish.rb&lt;/em&gt; file and run:&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;chmod 775 varnish.rb
brew install ./varnish.rb
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;brew will execute this and install varnish 5.2.0 as expected.&lt;/p&gt;

&lt;p&gt;That's all!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>devops</category>
    </item>
    <item>
      <title>Magento 2 theme what is etc/view.xml</title>
      <dc:creator>Asrar</dc:creator>
      <pubDate>Thu, 13 Jun 2019 00:08:01 +0000</pubDate>
      <link>https://forem.com/asrar7787/magento-2-theme-what-is-etc-view-xml-3hki</link>
      <guid>https://forem.com/asrar7787/magento-2-theme-what-is-etc-view-xml-3hki</guid>
      <description>&lt;p&gt;In this file, frontend related properties can be configured i.e. size of product images. Also a custom ID of image can be added here with its size and then this image can be generated in PHP.&lt;/p&gt;

&lt;p&gt;Additionally, some properties can be set without overriding template files :&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;vars module="Magento_ConfigurableProduct"&amp;gt;&lt;br&gt;
 &amp;lt;var name="gallery_switch_strategy"&amp;gt;replace&amp;lt;/var&amp;gt;&lt;br&gt;
&amp;lt;/vars&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now, in &lt;code&gt;vendor/magento/module-configurable-product/view/frontend/templates/product/view/type/options/configurable.phtml&lt;/code&gt;, the variable &lt;code&gt;gallery_switch_strategy&lt;/code&gt; is fetched like &lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;?php /* @escapeNotVerified */ echo $block-&amp;gt;getVar('gallery_switch_strategy', 'Magento_ConfigurableProduct') ?: 'replace'; ?&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;So, instead of overriding a template file, we can use theme's &lt;code&gt;etc/view.xml&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Theme's &lt;code&gt;etc/view.xml&lt;/code&gt; can be used to exclude any &lt;code&gt;js&lt;/code&gt; file, any &lt;code&gt;js&lt;/code&gt; components or a complete directory containing static assets from bundling, like below :&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;exclude&amp;gt;&lt;br&gt;
        &amp;lt;!-- js file --&amp;gt;&lt;br&gt;
        &amp;lt;item type="file"&amp;gt;Lib::jquery/jquery.min.js&amp;lt;/item&amp;gt;&lt;br&gt;
        &amp;lt;!-- Catalog level : js component --&amp;gt;&lt;br&gt;
        &amp;lt;item type="file"&amp;gt;Magento_Catalog::js/zoom.js&amp;lt;/item&amp;gt;&lt;br&gt;
        &amp;lt;!-- Dir level : exclude bundling for any static contents --&amp;gt;&lt;br&gt;
        &amp;lt;item type="directory"&amp;gt;Lib::modernizr&amp;lt;/item&amp;gt;&lt;br&gt;
        &amp;lt;item type="directory"&amp;gt;Lib::tiny_mce&amp;lt;/item&amp;gt;&lt;br&gt;
        &amp;lt;item type="directory"&amp;gt;Lib::varien&amp;lt;/item&amp;gt;&lt;br&gt;
        &amp;lt;item type="directory"&amp;gt;Lib::jquery/editableMultiselect&amp;lt;/item&amp;gt;&lt;br&gt;
        &amp;lt;item type="directory"&amp;gt;Lib::jquery/jstree&amp;lt;/item&amp;gt;&lt;br&gt;
        &amp;lt;item type="directory"&amp;gt;Lib::jquery/fileUploader&amp;lt;/item&amp;gt;&lt;br&gt;
        &amp;lt;item type="directory"&amp;gt;Lib::css&amp;lt;/item&amp;gt;&lt;br&gt;
        &amp;lt;item type="directory"&amp;gt;Lib::lib&amp;lt;/item&amp;gt;&lt;br&gt;
        &amp;lt;item type="directory"&amp;gt;Lib::mage/backend&amp;lt;/item&amp;gt;&lt;br&gt;
    &amp;lt;/exclude&amp;gt;&lt;/code&gt;&lt;/p&gt;

</description>
      <category>magento</category>
    </item>
    <item>
      <title>Magento PHPStorm conditional debugging</title>
      <dc:creator>Asrar</dc:creator>
      <pubDate>Sun, 02 Jun 2019 15:38:03 +0000</pubDate>
      <link>https://forem.com/asrar7787/magento-phpstorm-conditional-debugging-5hnl</link>
      <guid>https://forem.com/asrar7787/magento-phpstorm-conditional-debugging-5hnl</guid>
      <description>&lt;p&gt;Conditional debugging is an useful feature in PHPStorm. &lt;br&gt;
This can become very handy when you would want your breakpoint to fire-up  when a certain condition is met for instance - in an iteration.&lt;/p&gt;

&lt;p&gt;I was debugging &lt;code&gt;vendor/magento/module-customer/Model/Customer/DataProvider.php::getAttributesMeta()&lt;/code&gt;. But I really didn't want the debugger to stop on every single customer attributes in the following code:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;foreach ($attributes as $attribute) {&lt;br&gt;
     $this-&amp;gt;processFrontendInput($attribute, $meta);&lt;br&gt;
     $code = $attribute-&amp;gt;getAttributeCode();&lt;br&gt;
....&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Instead, all I wanted is, something like - hey debugger, when &lt;code&gt;$code == "group_id"&lt;/code&gt;, show me what's happening at that point. &lt;/p&gt;

&lt;p&gt;To, achieve this, I set a condition on the breakpoint on line &lt;code&gt;$code = $attribute-&amp;gt;getAttributeCode();&lt;/code&gt; like below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8WUPhJ_E--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/zsfshw810kg9m0wydspp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8WUPhJ_E--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/zsfshw810kg9m0wydspp.png" alt="PHPStorm Conditional Debugging"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And that's it, now my debugger fires up only when attribute code is &lt;code&gt;group_id&lt;/code&gt;.&lt;/p&gt;

</description>
      <category>magento</category>
      <category>php</category>
      <category>debug</category>
    </item>
  </channel>
</rss>
