<?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: Akshay Khale</title>
    <description>The latest articles on Forem by Akshay Khale (@akshaykhale1992).</description>
    <link>https://forem.com/akshaykhale1992</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%2F120152%2Fba307188-a034-4464-ad30-fa270bc11e50.jpeg</url>
      <title>Forem: Akshay Khale</title>
      <link>https://forem.com/akshaykhale1992</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/akshaykhale1992"/>
    <language>en</language>
    <item>
      <title>Share your GitHub Profile Readme Link</title>
      <dc:creator>Akshay Khale</dc:creator>
      <pubDate>Fri, 18 Nov 2022 09:15:01 +0000</pubDate>
      <link>https://forem.com/akshaykhale1992/share-your-github-profile-readme-link-5d6d</link>
      <guid>https://forem.com/akshaykhale1992/share-your-github-profile-readme-link-5d6d</guid>
      <description>&lt;p&gt;Hi All,&lt;/p&gt;

&lt;p&gt;GitHub Profile Readme.md file is an excellent options for developers to showcase their achievements and sometimes event brag about their open source contribution.&lt;/p&gt;

&lt;p&gt;I am requesting you all to share your GitHub profile Readme and let's make a curated list of creative ways of using this simple feature provided by GitHub.&lt;/p&gt;

&lt;p&gt;Here is my GitHubProfile Readme: &lt;a href="https://github.com/akshaykhale1992/akshaykhale1992"&gt;@akshaykhale1992&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And Please share your's&lt;/p&gt;

</description>
      <category>github</category>
      <category>readme</category>
      <category>githubprofile</category>
      <category>githubreadme</category>
    </item>
    <item>
      <title>Getting Started with NextJS13</title>
      <dc:creator>Akshay Khale</dc:creator>
      <pubDate>Thu, 03 Nov 2022 11:24:31 +0000</pubDate>
      <link>https://forem.com/akshaykhale1992/getting-started-with-nextjs13-1292</link>
      <guid>https://forem.com/akshaykhale1992/getting-started-with-nextjs13-1292</guid>
      <description>&lt;p&gt;In the last week, &lt;a href="https://vercel.com/"&gt;Varcel&lt;/a&gt; made a lot of announcements at their &lt;a href="https://nextjs.org/conf"&gt;NextJS conference&lt;/a&gt; (&lt;a href="https://nextjs.org/conf"&gt;NextConf&lt;/a&gt;), it was a fascinating event with some significant announcements and keynotes by our favorite Dev-YouTubers (or should I say Dev-tubers). Most of the announced products are still in the Beta and Alpha stages but that does not stop us from giving them a try.&lt;/p&gt;

&lt;p&gt;Here are some significant announcements made during the conference:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The NextJS-13&lt;/li&gt;
&lt;li&gt;Turbopack&lt;/li&gt;
&lt;li&gt;Improvements to the @next/image&lt;/li&gt;
&lt;li&gt;Improvements to the @next/link&lt;/li&gt;
&lt;li&gt;and updated and faster Next Router.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Out of these new features/products, NextJS-13 got me excited since I am already using NextJS for some of my projects and I love their philosophy and their focus on the developer experience (DX) while designing the framework. So when I heard about NextJS13, I was super excited and wanted to give it a try.&lt;/p&gt;

&lt;p&gt;After digging the internet on how to start with NextJS-13, I could not find solid documentation for the same. &lt;a href="https://nextjs.org/docs"&gt;Next/docs&lt;/a&gt; do not contain documentation for Next-13 since it’s not stable yet but after googling and watching some youtube videos, I could find the link for their &lt;a href="https://beta.nextjs.org/docs/getting-started"&gt;Beta documentation&lt;/a&gt; that has complete details of the NextJS-13, as to how to get started, what’s new and what’s same.&lt;/p&gt;

&lt;p&gt;So let's get started with NextJS13&lt;/p&gt;

&lt;p&gt;If you are starting with a new project then you can simply run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// With npx
npx create-next-app@latest --experimental-app
// With yarn
yarn create next-app --experimental-app
// With pnpm
pnpm create next-app --experimental-app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you want to continue with the existing project then you can simply run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// With npm
npm i next@latest react@latest react-dom@latest eslint-config-next@latest
// With yarn
yarn add next@latest react@latest react-dom@latest eslint-config-next@latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note: If you are making changes to the existing project then it will work with the pages directory and not the experimental app directory, if you want to use the &lt;code&gt;app&lt;/code&gt; directory instead of &lt;code&gt;pages&lt;/code&gt; then you will have to make the following changes to your next.config.js file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const nextConfig = {
  experimental: {
    appDir: true,
  },
};

module.exports = nextConfig;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After following all these steps you will have a NextJS 13 project up and running.&lt;/p&gt;

&lt;p&gt;This article is a snippet from &lt;a href="https://medium.com/@TheAkshayKhale/a-quick-look-at-nextjs13-whats-changed-what-s-new-and-what-s-improved-46ce9ab77598"&gt;this article&lt;/a&gt;, I published on &lt;a href="https://medium.com/@TheAkshayKhale"&gt;medium&lt;/a&gt; (don't worry it's not a members only article) where I shared about how to get started with NextJS13 and what are the changes and new improvements to NextJS13.&lt;/p&gt;

&lt;p&gt;Thank you!!! &lt;/p&gt;

</description>
      <category>nextjs13</category>
      <category>nextjs</category>
      <category>nextconf</category>
      <category>typescript</category>
    </item>
    <item>
      <title>Password-based or Passwordless login, what do you prefer/recommend and why?</title>
      <dc:creator>Akshay Khale</dc:creator>
      <pubDate>Sat, 25 Jul 2020 09:21:04 +0000</pubDate>
      <link>https://forem.com/akshaykhale1992/discuss-password-based-or-passwordless-login-what-do-you-prefer-recommend-and-why-1o1b</link>
      <guid>https://forem.com/akshaykhale1992/discuss-password-based-or-passwordless-login-what-do-you-prefer-recommend-and-why-1o1b</guid>
      <description>&lt;p&gt;I am an advocate of Passwordless login, I recommend everyone to go passwordless, and rely on social logins but I would love to know the views of dev-community on the subject.&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>password</category>
      <category>passwordless</category>
    </item>
    <item>
      <title>Are we losing the Basics???</title>
      <dc:creator>Akshay Khale</dc:creator>
      <pubDate>Mon, 29 Jun 2020 14:31:51 +0000</pubDate>
      <link>https://forem.com/akshaykhale1992/are-we-losing-the-basics-48gk</link>
      <guid>https://forem.com/akshaykhale1992/are-we-losing-the-basics-48gk</guid>
      <description>&lt;p&gt;Being in the Tech field, We are &lt;em&gt;"Standing on the shoulders of giants"&lt;/em&gt;. Our IDEs are powerful in fact normal Text-Editors are also Powerful with thousands of extensions making coding as simple as possible.&lt;/p&gt;

&lt;p&gt;So, do you think that being surrounded by all these powerful tools, we are losing the basics?&lt;/p&gt;

&lt;h3&gt;
  
  
  An ancient example:
&lt;/h3&gt;

&lt;p&gt;Since we have phonebooks we don't remember anyone's phone number anymore.&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>codingbasics</category>
    </item>
    <item>
      <title>A simple way to debug PHP applications.</title>
      <dc:creator>Akshay Khale</dc:creator>
      <pubDate>Sun, 28 Jun 2020 09:08:45 +0000</pubDate>
      <link>https://forem.com/akshaykhale1992/a-simple-way-to-debug-php-applications-5e08</link>
      <guid>https://forem.com/akshaykhale1992/a-simple-way-to-debug-php-applications-5e08</guid>
      <description>&lt;h2&gt;
  
  
  The Problem:
&lt;/h2&gt;

&lt;p&gt;Debugging can be irritating sometimes and when it comes to debugging server-side code, it's can be daunting. Printing the variable values, stopping the execution, and then continue, sometimes it takes hours. In Client-side languages like Javascript, it's pretty simple, you just do a &lt;code&gt;console.log&lt;/code&gt; and wait for the complete page to render without stopping.&lt;/p&gt;

&lt;h2&gt;
  
  
  Solution:
&lt;/h2&gt;

&lt;p&gt;That was my inspiration behind creating &lt;a href="https://github.com/akshaykhale1992/console-logger"&gt;console-logger&lt;/a&gt;.&lt;br&gt;
A simple PHP library that can be installed using composer and get you started with logging details in your browser console.&lt;/p&gt;
&lt;h2&gt;
  
  
  How to use it?
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Install the package using composer
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;composer require akshaykhale1992/console-logger
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;Start using it...&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Simple Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php
include './vendor/autoload.php';
use consoleLogger\Logger;
(new Logger())-&amp;gt;emergency("This is from Server Side");
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Available Functions:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Logger Function&lt;/th&gt;
&lt;th&gt;Equivalent Console Log&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;(new Logger())-&amp;gt;emergency&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;console.error&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;(new Logger())-&amp;gt;alert&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;console.warn&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;(new Logger())-&amp;gt;critical&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;console.error&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;(new Logger())-&amp;gt;error&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;console.error&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;(new Logger())-&amp;gt;warning&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;console.warn&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;(new Logger())-&amp;gt;notice&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;console.log&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;(new Logger())-&amp;gt;info&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;console.info&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;(new Logger())-&amp;gt;debug&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;console.debug&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;(new Logger())-&amp;gt;group&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;console.group&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;(new Logger())-&amp;gt;groupEnd&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;console.groupEnd&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The &lt;code&gt;consoleLogger\Logger&lt;/code&gt; class follows &lt;a href="https://www.php-fig.org/psr/psr-3/"&gt;PHP PSR-3: Logger Interface&lt;/a&gt; standards and implements all the functions for your specific needs.&lt;/p&gt;

&lt;p&gt;I hope it will be useful for you and it's an open-source project so please feel free to tag along by creating issues or by adding new features.&lt;/p&gt;

&lt;p&gt;Best.&lt;/p&gt;

</description>
      <category>php</category>
      <category>debugging</category>
      <category>consolelogger</category>
    </item>
    <item>
      <title>Composer Package Development tips and tricks</title>
      <dc:creator>Akshay Khale</dc:creator>
      <pubDate>Wed, 24 Jun 2020 15:31:46 +0000</pubDate>
      <link>https://forem.com/akshaykhale1992/composer-package-development-tips-and-tricks-4cln</link>
      <guid>https://forem.com/akshaykhale1992/composer-package-development-tips-and-tricks-4cln</guid>
      <description>&lt;p&gt;If you are a PHP developer and do active PHP Development then there are a lot of chances that you would want to develop a Package and use it in your application.&lt;/p&gt;

&lt;p&gt;This is a very short article (rather a tip) which will help you with package development.&lt;/p&gt;

&lt;p&gt;If you have your package ready, with PSR-4 Autoloading and you do not want to publish it on Packagist or simply want to test it on your development environment then simply you can use composer repositories option.&lt;/p&gt;

&lt;p&gt;Just add following code in your composer.json file where you want to use the package.&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"require": {
    ....
    "&amp;lt;vendor-name&amp;gt;/&amp;lt;package-name&amp;gt;": "dev-master",
    ....
},
"repositories": [
    {
        "type": "vcs",
        "url": "git@github.com:&amp;lt;vendor-name&amp;gt;/&amp;lt;repository-name&amp;gt;.git"
    }
],
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;It will auto-pull the Package from Github (or any other VCS) and set it up for you to start with your development (provided you have repository access).&lt;/p&gt;

&lt;p&gt;I was following the same and it worked flawlessly multiple developers were working on the Package and it worked like magic but then there was another catch, I wanted to avoid pushing on git and wanted to test the package in an application. composer to the rescue, composer allows local path in repository like this:&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"require": {
    ....
    "&amp;lt;vendor-name&amp;gt;/&amp;lt;package-name&amp;gt;": "dev-master",
    ....
},
"repositories": [
    {
        "type": "path",
        "url": "/Users/user/package"
    }
],
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;It worked but the problem was before pushing the code, I had to make changes from VCS to Path in the calling application’s composer file. which was a pain, I tried searching options for commenting in composer.json file or some other options where I can keep the local and production environment together. The internet spoke the truth, No, there is no way to comment in composer.json file. but I found a work-around on &lt;a href="https://stackoverflow.com/questions/34807269/different-composer-json-files-for-production-and-staging-development"&gt;stackoverflow&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Apparently, you can have multiple composer.json files in your PHP application and you can mention it run-time, which one to use for installing packages.&lt;/p&gt;

&lt;p&gt;you can do:&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    composer install // or composer update
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;which will install the packages from composer.json file and you can do&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    COMPOSER=composer-local.json composer install // or composer update
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;which will load the packages from composer-local.json file.&lt;/p&gt;

&lt;p&gt;Hope these tricks will be useful for you.&lt;/p&gt;

&lt;p&gt;Thank you for reading.&lt;/p&gt;

&lt;p&gt;Happy coding!!!&lt;/p&gt;

&lt;p&gt;Originally published on &lt;a href="https://medium.com/@TheAkshayKhale/composer-package-development-tricks-and-tips-89f2208426eb"&gt;Medium&lt;/a&gt;&lt;/p&gt;

</description>
      <category>php</category>
      <category>composer</category>
      <category>phppackage</category>
      <category>packagedevelopment</category>
    </item>
    <item>
      <title>A simple Database Suggestion</title>
      <dc:creator>Akshay Khale</dc:creator>
      <pubDate>Tue, 03 Mar 2020 05:17:59 +0000</pubDate>
      <link>https://forem.com/akshaykhale1992/a-simple-database-suggestion-51a8</link>
      <guid>https://forem.com/akshaykhale1992/a-simple-database-suggestion-51a8</guid>
      <description>&lt;p&gt;If you have been doing software development then you might have encountered a situation where you would want to deactivate a user account or mark some actions as done, where you might be using Boolean Data-type to store those actions.&lt;/p&gt;

&lt;p&gt;E.g.&lt;/p&gt;

&lt;p&gt;If you want to deactivate then you might have been setting boolean is_active field to true for active users and false for in-active users.&lt;/p&gt;

&lt;p&gt;Or&lt;/p&gt;

&lt;p&gt;If you want to save notification status for an order then you might have been using email_status as a boolean field with default value as false which you change it to true when the email status is shared with the customer.&lt;/p&gt;

&lt;p&gt;The approach above is completely fair and it works but there is a problem in the above approach. It does not have a record of exactly when the user was deactivated or exactly when the email_status was sent to the customer.&lt;/p&gt;

&lt;p&gt;For that most of the developers follow a simple approach, instead of using boolean field is_active they use activated_on (or deactivated_on depends on your business requirement) Date field with default value as NULL. They use the following queries to find users:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--SRoxFQPJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/fwozkp8cg2kyc8vr5osz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SRoxFQPJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/fwozkp8cg2kyc8vr5osz.png" alt="https://gist.github.com/akshaykhale1992/22448e265e646c5143ec2725d0358549#file-queries-sql"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://gist.github.com/akshaykhale1992/22448e265e646c5143ec2725d0358549#file-queries-sql"&gt;View on Gist&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I am not saying this is the best approach but it surely help you to make more sense out of the data in the Database and it completely depends on your business requirements.&lt;/p&gt;

&lt;p&gt;That’s all folks!!!&lt;/p&gt;

&lt;p&gt;Thank you for reading :) :) :)&lt;/p&gt;

&lt;p&gt;Originally Published on Medium: &lt;a href="https://medium.com/@TheAkshayKhale/a-simple-database-suggestion-dc52404e8fcc"&gt;A simple Database Suggestion&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Follow me on my social media profiles:&lt;br&gt;
&lt;a href="https://twitter.com/TheAkshayKhale"&gt;Twitter@TheAkshayKhale&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.facebook.com/TheAkshayKhale"&gt;Fb@TheAkshayKhale&lt;/a&gt;&lt;br&gt;
&lt;a href="https://medium.com/@TheAkshayKhale"&gt;Medium@TheAkshayKhale&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;GitHub: &lt;a href="https://github.com/akshaykhale1992"&gt;AkshayKhale1992&lt;/a&gt;&lt;/p&gt;

</description>
      <category>database</category>
    </item>
  </channel>
</rss>
