<?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>DEV Community: Srini Raju</title>
    <description>The latest articles on DEV Community by Srini Raju (@srinivasarajui).</description>
    <link>https://dev.to/srinivasarajui</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%2F311421%2F4f07a1df-896f-46ff-839c-9e0bc9fc7593.jpg</url>
      <title>DEV Community: Srini Raju</title>
      <link>https://dev.to/srinivasarajui</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/srinivasarajui"/>
    <language>en</language>
    <item>
      <title>My Experience with GitHub copilot</title>
      <dc:creator>Srini Raju</dc:creator>
      <pubDate>Sun, 14 Nov 2021 18:11:30 +0000</pubDate>
      <link>https://dev.to/srinivasarajui/my-experience-with-github-copilot-8f6</link>
      <guid>https://dev.to/srinivasarajui/my-experience-with-github-copilot-8f6</guid>
      <description>&lt;p&gt;Last week, I got my access to GitHub copilot. I was slightly skeptical about how much will this be useful before I started to use it.&lt;/p&gt;

&lt;p&gt;Today I had installed my vs-code extension and logged into the account. Then started working on my personal project. Spent most of my time on refactoring my code today. There were suggestions which I felt not great when I was doing the code refactoring.&lt;/p&gt;

&lt;p&gt;Then I had to write a simple utility to get Socket URL and Graphql URL based on the hostname and protocol. If the host is localhost we have to point to a local backend server which is running on different port. This is a very common use-case. When I started to code this utility I was amazed by the amount of code that was generated by copilot. The attached image has code is what we(me and copilot) have come up.&lt;/p&gt;

&lt;p&gt;Out of the the 24 lines of code in the file, 11 lines of code was auto generated by copilot. This is close to 50% of the code. I crossed the line numbers which were generated by copilot.&lt;/p&gt;

&lt;p&gt;Though at times the code generation is slightly slower, But once the tool matures it would be of great help to programmers. I feel that this will help developers with their productivity and improve the quality of code.&lt;/p&gt;

&lt;p&gt;Let us see how these AI for coding will shape the future of application development.&lt;/p&gt;

</description>
      <category>vscode</category>
      <category>github</category>
    </item>
    <item>
      <title>Angular Development on VS code and Docker using Remote Containers</title>
      <dc:creator>Srini Raju</dc:creator>
      <pubDate>Sun, 13 Jun 2021 10:17:00 +0000</pubDate>
      <link>https://dev.to/srinivasarajui/angular-development-on-vs-code-and-docker-using-remote-containers-5a1a</link>
      <guid>https://dev.to/srinivasarajui/angular-development-on-vs-code-and-docker-using-remote-containers-5a1a</guid>
      <description>&lt;p&gt;VS Code  with Remote Containers extension will help us develop with in container. More details are &lt;a href="https://code.visualstudio.com/docs/remote/containers" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I decided to try angular development using VS Code Docker containers. This is my Journey Hope it helps others.&lt;/p&gt;

&lt;p&gt;prerequisite:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Docker&lt;/li&gt;
&lt;li&gt;VS Code with Visual Studio Code Remote - Containers&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 1: Create a New Project and Start in a container.
&lt;/h2&gt;

&lt;p&gt;Start VS code in a brand new folder(say AngularOnRC). Open Command palette by pressing F1. Follow this naviation.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv7yoaw5wvw6wbgemwtqj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv7yoaw5wvw6wbgemwtqj.png" alt="Image of VS code palette"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Select Remote-Containers: Add Development Container Configurations Files..&lt;/li&gt;
&lt;li&gt;Select Nodejs &amp;amp; Typescript&lt;/li&gt;
&lt;li&gt;Select node version as 16.
This will add files in .devcontainer and the VS code will prompt to restart in Docker Container. Restart in docker container.(If you miss the prompt you use command Palette for the same)&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;
  
  
  Step 2: Initialize an Angular project.
&lt;/h2&gt;

&lt;p&gt;Once the Project starts in Container(starting may take some time). Open the terminal and Run the following Commands.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;

npm install -g @angular/cli
ng new AngularOnRC --directory .


&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Choose the values of our preference for angular project.&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 3: Run the Project
&lt;/h2&gt;

&lt;p&gt;Run the angular project using the following command.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;

npm run start


&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;This would prompt you to open in Browser. Now you can see you application Running. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;This proves that basic angular project development works but the problem starts when we want to run unit tests.&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;

npm run test


&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;The issue is due to the fact that docker on which we are developing do not have chrome installed. &lt;/p&gt;
&lt;h2&gt;
  
  
  Step 4: Add chrome to Dockers
&lt;/h2&gt;

&lt;p&gt;Add the following code to Docker file in .devcontainer&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

RUN apt-get update &amp;amp;&amp;amp; export DEBIAN_FRONTEND=noninteractive \
     &amp;amp;&amp;amp; apt-get -y install --no-install-recommends chromium
ENV CHROME_BIN=/usr/bin/chromium


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Now from command palette choose the rebuild container option this will rebuild docker by adding chrome.&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 5: Change karma config.
&lt;/h2&gt;

&lt;p&gt;In karma.conf.js file change browser config shown as below.&lt;/p&gt;

&lt;p&gt;Old Code&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;span class="err"&gt;browsers:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="err"&gt;'Chrome'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt;&lt;span class="w"&gt;


&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;New Code&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;span class="err"&gt;browsers:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="err"&gt;'ChromeHeadlessNoSandbox'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="err"&gt;customLaunchers:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="err"&gt;ChromeHeadlessNoSandbox:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="err"&gt;base:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"ChromeHeadless"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="err"&gt;flags:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="s2"&gt;"--no-sandbox"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="s2"&gt;"--disable-setuid-sandbox"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt;&lt;span class="w"&gt;


&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Now tests should run as expected. So we are good to develop the application with Unit testing.&lt;/p&gt;

&lt;p&gt;Find the git Repo&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/srinivasarajui" rel="noopener noreferrer"&gt;
        srinivasarajui
      &lt;/a&gt; / &lt;a href="https://github.com/srinivasarajui/AngularOnRC" rel="noopener noreferrer"&gt;
        AngularOnRC
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      
    &lt;/h3&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Waiting for your comments and feedback&lt;/p&gt;

</description>
      <category>vscode</category>
      <category>angular</category>
      <category>docker</category>
    </item>
  </channel>
</rss>
