PK's Diary - few pages from Purushotam Rai's Diary http://mail.purushotam.in/ en Software Engineer Interview Experience with Glovo http://mail.purushotam.in/stories/software-engineer-interview-experience-glovo <span property="schema:name">Software Engineer Interview Experience with Glovo</span> <span rel="schema:author"><span lang="" about="/user/1" typeof="schema:Person" property="schema:name" datatype="">purushotam</span></span> <span property="schema:dateCreated" content="2022-01-23T19:35:37+00:00">Sun, 01/23/2022 - 20:35</span> <div property="schema:text" class="text-content field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>For those who directly want to know the interview details, topics and main points, you can directly skip to the <a href="#round-1">Round 1 section</a>, but for those who want to experience this ride with me on this journey from Drupal to Glovo, stay, it will be short and definitely, I will try not to bore you a lot 😉.</p> <p>A quick intro about me, I'm <strong>PK</strong>, as of June 2021 was working with <strong>Selectra</strong>, as <strong>Technical Lead</strong> with expertise in <strong>Drupal</strong>. I was too much into Drupal and enjoyed every bit of it. For the last 6 yrs, I was working with Drupal, the journey was going great and quite comfortable, I had an amazing journey in Drupal.</p></div> Sun, 23 Jan 2022 19:35:37 +0000 purushotam 53 at http://mail.purushotam.in http://mail.purushotam.in/stories/software-engineer-interview-experience-glovo#comments Accessing Translated Entity in Views Twig | Drupal 8 http://mail.purushotam.in/notes/accessing-translated-entity-views-twig-drupal-8 <span property="schema:name">Accessing Translated Entity in Views Twig | Drupal 8</span> <span rel="schema:author"><span lang="" about="/user/1" typeof="schema:Person" property="schema:name" datatype="">purushotam</span></span> <span property="schema:dateCreated" content="2021-07-12T23:49:18+00:00">Tue, 07/13/2021 - 01:49</span> <div property="schema:text" class="text-content field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>Though ideally if we use the views correctly and override them well, Drupal Views itself take care of getting the translated version as per configurations of the view. For details check this: <a href="https://api.drupal.org/api/drupal/core%21modules%21views%21src%21Plugin%21views%21field%21EntityField.php/function/EntityField%3A%3AgetValue/8.8.x">EntityField::getValue</a></p> <p>But if somehow we wanna get translated version of the entity in a views twig, we will have to get the current language and then call <a href="https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Entity%21ContentEntityBase.php/function/ContentEntityBase%3A%3AgetTranslation/8.8.x">ContentEntityBase::getTranslation</a> on the entity of the views row. And there are various ways of getting the current language in the views-view.html.twig:</p> <p>#1 Use preprocess to add current language</p></div> Mon, 12 Jul 2021 23:49:18 +0000 purushotam 50 at http://mail.purushotam.in http://mail.purushotam.in/notes/accessing-translated-entity-views-twig-drupal-8#comments Storing extra information for any entity in Drupal http://mail.purushotam.in/articles/storing-extra-information-any-entity-drupal <span property="schema:name">Storing extra information for any entity in Drupal</span> <span rel="schema:author"><span lang="" about="/user/1" typeof="schema:Person" property="schema:name" datatype="">purushotam</span></span> <span property="schema:dateCreated" content="2021-04-03T21:20:04+00:00">Sat, 04/03/2021 - 23:20</span> <div property="schema:text" class="text-content field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>A lot of times we come across a requirement where we need to manage some additional data for the Drupal entities. Now, if we think simply, the solution is to create fields .. right... easy and best, that's what Drupal is all about, entities and their properties as fields. But, there can be scenarios where the entity is not fieldable (as of now).</p> <p>We will be specifically focusing on them in this post, though this can be implemented for any entity, the key is to understand what we want to solve and how, it's a kind of trade-off that we need to do while making any decision. As I always say Drupal has a lot of ways to solve a problem statement, it's you who decide which is the efficient one. You may not find the below solution as most efficient or scalable for you, but definitely, you would draw some important knowledge/information from this post.</p></div> Sat, 03 Apr 2021 21:20:04 +0000 purushotam 49 at http://mail.purushotam.in http://mail.purushotam.in/articles/storing-extra-information-any-entity-drupal#comments Making a variable available (as global) in all twig files in Drupal http://mail.purushotam.in/notes/making-variable-available-global-all-twig-files-drupal <span property="schema:name">Making a variable available (as global) in all twig files in Drupal</span> <span rel="schema:author"><span lang="" about="/user/1" typeof="schema:Person" property="schema:name" datatype="">purushotam</span></span> <span property="schema:dateCreated" content="2021-03-30T23:28:39+00:00">Wed, 03/31/2021 - 01:28</span> <div property="schema:text" class="text-content field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>Most of us know, the ideal way of making a variable available in a specific twig file is to use hook_preprocess_HOOK. But what if we have a requirement that we need a kind of global variable that should be accessible in any twig file. So, that we are able to use it wherever we want to, without additional pain.</p> <p>The best part of Drupal is, everything is possible. But at the same time, there is a trick, you always have more than one way of doing things. And now it's in your hands to pick up the best suitable performant way for your solution.</p> <p>So, over here you have the following solutions (which I can instantly think for this problem statement):</p></div> Tue, 30 Mar 2021 23:28:39 +0000 purushotam 48 at http://mail.purushotam.in http://mail.purushotam.in/notes/making-variable-available-global-all-twig-files-drupal#comments How to check if Memcache, opcache or varnish is functional with the Drupal 8 application? http://mail.purushotam.in/reposts/how-check-if-memcache-opcache-or-varnish-functional-drupal-8-application <span property="schema:name">How to check if Memcache, opcache or varnish is functional with the Drupal 8 application?</span> <span rel="schema:author"><span lang="" about="/user/1" typeof="schema:Person" property="schema:name" datatype="">purushotam</span></span> <span property="schema:dateCreated" content="2021-02-27T23:01:22+00:00">Sun, 02/28/2021 - 00:01</span> <div property="schema:text" class="text-content field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>A successful application is always defined by its performance and Security besides the proper operational functioning. Drupal 8 can make use of Memcache, opcache and varnish to significantly reduce the load on the servers and greatly improve the performance. After installing and setting up these performance improvement tools it’s important to know if they are actually working and improving the application performance. Let’s explore the validation ways for each of them:</p></div> Sat, 27 Feb 2021 23:01:22 +0000 purushotam 21 at http://mail.purushotam.in http://mail.purushotam.in/reposts/how-check-if-memcache-opcache-or-varnish-functional-drupal-8-application#comments Acquia Backend Specialist Certification Guide http://mail.purushotam.in/articles/acquia-backend-specialist-certification-guide <span property="schema:name">Acquia Backend Specialist Certification Guide</span> <span rel="schema:author"><span lang="" about="/user/1" typeof="schema:Person" property="schema:name" datatype="">purushotam</span></span> <span property="schema:dateCreated" content="2021-02-27T21:49:22+00:00">Sat, 02/27/2021 - 22:49</span> <div property="schema:text" class="text-content field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>Recently completed Acquia Backend Specialist Certification thought to share my thoughts around this certification exam that might help the aspiring ones. While preparing for this exam, I had heard that this is the toughest exam out of all the Acquia Drupal Certifications and in my opinion, this rumour is true.</p> <p>Actually, these certifications might be easy for others but were not for me, as, since last 1.5 yrs I have been working in Drupal 7 only. When I started preparing for this exam, I followed the same preparation pattern which I used while preparing for Acquia Drupal 8 Developer Certification Exam.</p></div> Sat, 27 Feb 2021 21:49:22 +0000 purushotam 6 at http://mail.purushotam.in http://mail.purushotam.in/articles/acquia-backend-specialist-certification-guide#comments Why Amazon is better than Flipkart - Indian ecommerce market http://mail.purushotam.in/stories/why-amazon-better-flipkart-indian-ecommerce-market <span property="schema:name">Why Amazon is better than Flipkart - Indian ecommerce market</span> <span rel="schema:author"><span lang="" about="/user/1" typeof="schema:Person" property="schema:name" datatype="">purushotam</span></span> <span property="schema:dateCreated" content="2021-10-17T06:58:45+00:00">Sun, 10/17/2021 - 08:58</span> <div property="schema:text" class="text-content field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>Indian ecommerce market is quite a big playground, especially for these 2 companies, Amazon and Flipkart. They always fight to be the best in the market. </p> <p>Many of my friends told me that Amazon is better in terms of overall experience. But I never really believed that statement, the reason being the discounts offered by Flipkart. There we can clearly see that Flipkart offers some very good deals. And at the end customer gets the product in cheaper prices. But recently I had an experience which challenges this.</p></div> Sun, 17 Oct 2021 06:58:45 +0000 purushotam 52 at http://mail.purushotam.in http://mail.purushotam.in/stories/why-amazon-better-flipkart-indian-ecommerce-market#comments Create alias for frequently used commands http://mail.purushotam.in/notes/create-alias-frequently-used-commands <span property="schema:name">Create alias for frequently used commands</span> <span rel="schema:author"><span lang="" about="/user/1" typeof="schema:Person" property="schema:name" datatype="">purushotam</span></span> <span property="schema:dateCreated" content="2021-03-04T15:43:13+00:00">Thu, 03/04/2021 - 16:43</span> <div property="schema:text" class="text-content field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>No one wants to waste time on unnecessary things, especially a developer. If you frequently use a command on your terminal/command line, I would recommend creating a command alias to save some seconds (I guess).</p> <p>I would make it quick, let's assume you want to navigate to some directory from anywhere and you want to avoid typing cd .... bla bla bla bla. So, let's make the alias for this.</p> <p>Open the terminal and edit the .bash_profile</p> <p><code>sudo nano ~/.bash_profile</code></p> <p>Add the following line in the file </p> <p><code>alias ms='cd ~/Sites/my_site'</code></p> <p>Save the file, exit and restart the terminal. and try your command, for the above case it's 'ms'. And here you go, you saved some milliseconds or seconds ;)</p> <p> </p> <p> </p> </div> Thu, 04 Mar 2021 15:43:13 +0000 purushotam 40 at http://mail.purushotam.in http://mail.purushotam.in/notes/create-alias-frequently-used-commands#comments Acquia Certified Drupal 8 Grand Master http://mail.purushotam.in/stories/acquia-certified-drupal-8-grand-master <span property="schema:name">Acquia Certified Drupal 8 Grand Master</span> <span rel="schema:author"><span lang="" about="/user/1" typeof="schema:Person" property="schema:name" datatype="">purushotam</span></span> <span property="schema:dateCreated" content="2021-02-27T22:42:50+00:00">Sat, 02/27/2021 - 23:42</span> <div property="schema:text" class="text-content field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>probably the youngest certified grand master of India<br /> ...that too within 4 months<br />  </p> <img alt="Drupal Grand Master" data-entity-type="file" data-entity-uuid="c6944677-d22b-4d63-b502-bae989e6b3c1" height="467" src="/sites/default/files/inline-images/Drupal-Grand-MAster.png" width="506" class="align-center" loading="lazy" /> <p> </p></div> Sat, 27 Feb 2021 22:42:50 +0000 purushotam 37 at http://mail.purushotam.in http://mail.purushotam.in/stories/acquia-certified-drupal-8-grand-master#comments A Walk to Remember | June 2015 - August 2018 | QED42 http://mail.purushotam.in/stories/walk-remember-june-2015-august-2018-qed42 <span property="schema:name">A Walk to Remember | June 2015 - August 2018 | QED42</span> <span rel="schema:author"><span lang="" about="/user/1" typeof="schema:Person" property="schema:name" datatype="">purushotam</span></span> <span property="schema:dateCreated" content="2021-02-27T22:39:43+00:00">Sat, 02/27/2021 - 23:39</span> <div property="schema:text" class="text-content field field--name-body field--type-text-with-summary field--label-hidden field__item"><p><iframe allowfullscreen="true" frameborder="0" height="400" mozallowfullscreen="true" src="https://docs.google.com/presentation/d/e/2PACX-1vR7-rUlH3Du4ooKisQeim5Hl14k1pFxzqpuDPxql6BhYafdQ51CCQjeWSyMd0KraVGDQFKSPgvp1X4d/embed?start=true&amp;loop=true&amp;delayms=3000" webkitallowfullscreen="true" width="660"></iframe></p> <p> </p> <p><strong>QED42 - My first LOVE &lt;3</strong></p> <p>A great journey comes to an end :). </p> </div> Sat, 27 Feb 2021 22:39:43 +0000 purushotam 35 at http://mail.purushotam.in http://mail.purushotam.in/stories/walk-remember-june-2015-august-2018-qed42#comments