<?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: Rafael Ahrons</title>
    <description>The latest articles on DEV Community by Rafael Ahrons (@luturol).</description>
    <link>https://dev.to/luturol</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%2F156737%2Ff5af1cd8-91e6-4990-b669-8ab915fa345f.jpeg</url>
      <title>DEV Community: Rafael Ahrons</title>
      <link>https://dev.to/luturol</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/luturol"/>
    <language>en</language>
    <item>
      <title>Using MongoDB with Docker</title>
      <dc:creator>Rafael Ahrons</dc:creator>
      <pubDate>Tue, 13 Jul 2021 01:40:56 +0000</pubDate>
      <link>https://dev.to/luturol/using-mongodb-with-docker-5gb6</link>
      <guid>https://dev.to/luturol/using-mongodb-with-docker-5gb6</guid>
      <description>&lt;h2&gt;
  
  
  Using MongoDB with Docker
&lt;/h2&gt;

&lt;p&gt;What you need to have installed:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Docker&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;With you want to learn more about Docker, you can check my blog post about it by &lt;a href="https://luturol.github.io/docker/Docker-101"&gt;clicking here&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Downloading &lt;a href="https://hub.docker.com/_/mongo"&gt;MongoDB Image&lt;/a&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight docker"&gt;&lt;code&gt;docker image pull mongo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Run a container
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight docker"&gt;&lt;code&gt;docker run -e MONGO_INITDB_ROOT_USERNAME=root -e MONGO_INITDB_ROOT_PASSWORD=root -p 27017:27017 mongo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Change password and username for a suitable for you&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  What this command does
&lt;/h3&gt;

&lt;p&gt;It will initialize your container and show you the logs while is initializing, so you can track if some errors appear in the console log.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;-e&lt;/strong&gt; will add &lt;strong&gt;MONGO_INITDB_ROOT_USERNAME&lt;/strong&gt; environment variable with the value &lt;strong&gt;root&lt;/strong&gt;. With that, your username to connect will be root.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;-e&lt;/strong&gt; will add &lt;strong&gt;MONGO_INITDB_ROOT_PASSWORD&lt;/strong&gt; environment variable with the value &lt;strong&gt;root&lt;/strong&gt;. With that, your password to connect will be root.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;-p&lt;/strong&gt; will share your local port with the port of the container. 27017 is the port that mongodb use.&lt;/p&gt;

&lt;h2&gt;
  
  
  Executing the same mongodb container after ended
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;You need to get the container ID from your mongodb container.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight docker"&gt;&lt;code&gt;docker container ps -a
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;With the container Id, now you can enter using the following command:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight docker"&gt;&lt;code&gt;docker start containerId
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;It will enter inside the container with a bash terminal executing.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Testing your connection
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Testing your connection&lt;/p&gt;

&lt;p&gt;You must have some program to connect with MongoDB. You can use or &lt;a href="https://www.mongodb.com/pt-br/products/compass"&gt;Mongo Compass&lt;/a&gt; or &lt;a href="https://robomongo.org/"&gt;Robot3&lt;/a&gt; or the one you prefer.&lt;/p&gt;

&lt;p&gt;To connect you will need a connection string.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mongodb://root:root@localhost:27017/admin
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;This is the connection string to connect inside mongodb of our container.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  What does that connection string means:
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;First &lt;strong&gt;root&lt;/strong&gt; is the username (if you changed, you must change in the connection string as well)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Second &lt;strong&gt;root&lt;/strong&gt; is our password (if you changed, you must change in the connection string as well)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;After @ is the IP you are trying to connect and the database that holds your user.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://hub.docker.com/_/mongo"&gt;MongoDB docker image&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://balta.io/blog/mongodb-docker"&gt;MongoDb Docker do Balta.io&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.mongodb.com/manual/reference/connection-string/"&gt;Connection String URI Format from MongoDB Documentation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>mongodb</category>
      <category>docker</category>
    </item>
    <item>
      <title>Using MySQL with Docker</title>
      <dc:creator>Rafael Ahrons</dc:creator>
      <pubDate>Tue, 13 Jul 2021 00:48:48 +0000</pubDate>
      <link>https://dev.to/luturol/using-mysql-with-docker-2fji</link>
      <guid>https://dev.to/luturol/using-mysql-with-docker-2fji</guid>
      <description>&lt;h2&gt;
  
  
  Using MySQL with Docker
&lt;/h2&gt;

&lt;p&gt;What you need to have installed:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Docker&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;With you want to learn more about Docker, you can check my blog post about it by &lt;a href="https://luturol.github.io/docker/Docker-101"&gt;clicking here&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Downloading &lt;a href="https://hub.docker.com/_/mysql"&gt;MySQL Image&lt;/a&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight docker"&gt;&lt;code&gt;docker image pull mysql:5.7
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Run a container
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight docker"&gt;&lt;code&gt;docker run -e MYSQL_ALLOW_EMPTY_PASSWORD=yes -v folderForVolume:/var/lib/mysql mysql:5.7
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Change folderForVolume for a path from a folder to create the volume&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  What this command does
&lt;/h3&gt;

&lt;p&gt;It will initialize your container and show you the logs while is initializing, so you can track if some errors appear in the console log.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;-e&lt;/strong&gt; will add MYSQL_ALLOW_EMPTY_PASSWORD environment variable with the value &lt;strong&gt;yes&lt;/strong&gt;. With that, you can enter in mysql without a password.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;-v&lt;/strong&gt; will create a volume with the container to share some data between your pc and the container. With this, you will be able to create another container with the same data without losing any tables or queries. &lt;/p&gt;

&lt;h2&gt;
  
  
  Entering the container
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;You need to get the container ID from your mysql container.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight docker"&gt;&lt;code&gt;docker container ls
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;With the container Id, now you can enter using the following command:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight docker"&gt;&lt;code&gt;docker exec -it containerID bash
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;It will enter inside the container with a bash terminal executing.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Enter MySQL&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mysql
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;If it works, then will show in the console that you are inside the mysql. To test just execute a&lt;br&gt;
&lt;br&gt;
&lt;code&gt;show databases&lt;/code&gt;&lt;br&gt;
&lt;br&gt;
to check.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://hub.docker.com/_/mysql"&gt;MySQL docker image&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/watch?v=S9BbUxmFaQI&amp;amp;ab_channel=AluraCursosOnline"&gt;Como rodar MySQL com Docker?&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>mysql</category>
      <category>docker</category>
    </item>
    <item>
      <title>Testing with XUnit and Moq</title>
      <dc:creator>Rafael Ahrons</dc:creator>
      <pubDate>Mon, 17 May 2021 16:40:40 +0000</pubDate>
      <link>https://dev.to/luturol/testing-with-xunit-and-moq-3cdg</link>
      <guid>https://dev.to/luturol/testing-with-xunit-and-moq-3cdg</guid>
      <description>&lt;h2&gt;
  
  
  Testing with XUnit
&lt;/h2&gt;

&lt;p&gt;In this article we will learn how to test your Web API with &lt;a href="https://xunit.net/"&gt;XUnit&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is XUnit
&lt;/h3&gt;

&lt;p&gt;Is an open source tool for testing C# applications.&lt;/p&gt;

&lt;h3&gt;
  
  
  How to configure
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;First you need to initilize your project:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   dotnet new webapi -n MoqXUnit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Then you need to initialize a XUnit project for testing
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; dotnet new xunit -n MoqXUnit.Test

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

&lt;/div&gt;



&lt;p&gt;This command will create a Test Project on your root folder.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Now you need to add MoqXUnit &lt;a href="https://docs.microsoft.com/pt-br/dotnet/core/tools/dotnet-add-reference"&gt;project reference&lt;/a&gt; to MoqXUnit.Test
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; dotnet add MoqXUnit.Test reference MoqXUnit

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

&lt;/div&gt;



&lt;p&gt;Having the reference you can access classes from the other project. In another words, now you can test them.&lt;/p&gt;

&lt;p&gt;Now we conclude the configuration part. Let’s make some tests.&lt;/p&gt;

&lt;h3&gt;
  
  
  Testing
&lt;/h3&gt;

&lt;p&gt;Let’s add some features to ours MoqXUnit Web API.&lt;/p&gt;

&lt;p&gt;Create another controller calling CalculatorController inside MoqXUnit/Controller folder and add this code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;using Microsoft.AspNetCore.Mvc;

namespace MoqXunit.Controllers
{
    [ApiController]
    [Route("[controller]")]
    public class CalculatorController : ControllerBase
    {
        [HttpGet]
        public ActionResult SumTwoNumbers([FromQuery] int num1, 
                                          [FromQuery] int num2)
        {            
            return Ok(num1 + num2);
        }
    }
}

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

&lt;/div&gt;



&lt;p&gt;SumTwoNumbers endpoint will only sum two numbers. Now let’s add some tests.&lt;/p&gt;

&lt;p&gt;Inside MoqXunit.Test add a .cs file and add a code more like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;using System;
using Microsoft.AspNetCore.Mvc;
using MoqXunit.Controllers;
using Xunit;

namespace MoqXunit.Teste
{
    public class CalculatorControllerTest
    {
        [Theory]
        [InlineData(1, 2)]
        [InlineData(1, 5)]
        [InlineData(1, 6)]
        [InlineData(10, 2)]
        [InlineData(1999, 2)]
        public void Sum_Two_Numbers_using_theory(int num1, int num2)
        {
            //arrange
            CalculatorController controller = new CalculatorController();
            int expected = num1 + num2;

            //act
            var response = controller.SumTwoNumbers(num1, num2).Result as OkObjectResult;

            //assert
            Assert.NotNull(response);
            Assert.Equal(response.Value, expected);
        }

        [Fact]
        public void Sum_two_numbers_using_fact()
        {
            //arrange
            CalculatorController controller = new CalculatorController();
            int num1 = 1;
            int num2 = 2;
            int expected = num1 + num2;            

            //act
            var response = controller.SumTwoNumbers(num1, num2).Result as OkObjectResult;

            //assert
            Assert.NotNull(response);
            Assert.Equal(response.Value, expected);
        }
    }
}

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

&lt;/div&gt;



&lt;p&gt;XUnit has two types of anottations to say that this method is a Test Method: &lt;a href="https://xunit.net/docs/getting-started/netfx/visual-studio"&gt;Fact and Theroy&lt;/a&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Fact&lt;/strong&gt; for methods with invariant data.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Theory&lt;/strong&gt; with variant data and those data is set by using InlineData anottations.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Using Asset Methods you can validade the results from your test. Go check the available ones.&lt;/p&gt;

&lt;h2&gt;
  
  
  Using Moq
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/moq/moq4"&gt;Moq&lt;/a&gt; is a library to Mock some interfaces to make testing easier.&lt;/p&gt;

&lt;h3&gt;
  
  
  How to add to your test project
&lt;/h3&gt;

&lt;p&gt;you can just execute the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dotnet add .\MoqXunit.Teste\ package Moq

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

&lt;/div&gt;



&lt;p&gt;Change .\MoqXunit.Teste\ to the name of your project.&lt;/p&gt;

&lt;p&gt;Now you have it installed.&lt;/p&gt;

&lt;h3&gt;
  
  
  How to use Moq
&lt;/h3&gt;

&lt;p&gt;You gonna use to mock some integrations that you don’t want to execute in your test, like, databases.&lt;/p&gt;

&lt;p&gt;Let’s create a folder inside MoqXunit project called Interfaces and add a interface for a ICalculatorRepository.cs We are not implementing calculator repository, it’s just an example.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;using System.Collections.Generic;
using MoqXunit.Models;

namespace MoqXunit.Interfaces 
{
    public interface ICalculatorRepository
    {
        IEnumerable&amp;lt;Calculation&amp;gt; GetAllCalculations();
        void SaveCalculation(Calculation calc);
    }
}

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

&lt;/div&gt;



&lt;p&gt;And let’s create this Calculation class:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;namespace MoqXunit.Models
{
    public record Calculation
    {
        public int Value1 { get; init; }
        public int Value2 { get; init; }
        public int Result { get; init; }

    }
}

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

&lt;/div&gt;



&lt;p&gt;Now let’s make some changes in our code to use this interface and calculation class.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;using System.Linq;
using Microsoft.AspNetCore.Mvc;
using MoqXunit.Interfaces;
using MoqXunit.Models;

namespace MoqXunit.Controllers
{
    [ApiController]
    [Route("[controller]")]
    public class CalculatorController : ControllerBase
    {
        private ICalculatorRepository _repository;

        public CalculatorController(ICalculatorRepository repository)
        {
            _repository = repository;
        }

        [HttpGet]
        public ActionResult SumTwoNumbers([FromQuery] int num1,
                                          [FromQuery] int num2)
        {

            var allCalculations = _repository.GetAllCalculations();
            if (allCalculations.Any(e =&amp;gt; e.Value1 == num1 &amp;amp;&amp;amp; e.Value2 == num2))
            {
                return Ok(allCalculations.First(e =&amp;gt; e.Value1 == num1 &amp;amp;&amp;amp; e.Value2 == num2));
            }
            else
            {
                var calculation = new Calculation
                {
                    Value1 = num1,
                    Value2 = num2,
                    Result = num1 + num2
                };

                _repository.SaveCalculation(calculation);

                return Ok(calculation);
            }
        }
    }
}

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

&lt;/div&gt;



&lt;p&gt;We add ICalculatorRepository as a dependency to our controller, and add a few changes on SumTwoNumbers to use GetAllCalculations and SaveCalculation method. Now we have this endpoint that if calculation exist in the database, it will return the result from it. Else it will create a instance of Calculation and save it with the result. The two paths will return Calculation object as response.&lt;/p&gt;

&lt;p&gt;To test this controller we need to make some changes and configurate the responses from GetAllCalculation and SaveCalculation methods. We do not want to execute the implementation of this interface.&lt;/p&gt;

&lt;p&gt;Moq solve this issue by using a class called Mock. With Mock you can create a setup to the interface by setting it’s methods income and output when it will be called inside the method that we are testing.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[Fact]
        public void Sum_two_numbers_using_fact()
        {
            //arrange
            var mock = new Mock&amp;lt;ICalculatorRepository&amp;gt;();

            var controller = new CalculatorController(mock.Object);

            //... all the other operations above
        }

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

&lt;/div&gt;



&lt;p&gt;Instantiate a Mock object by setting ICalculatorRepository as the type and pass mock.Object as parameter to CalculatorController and now you have mocked ICalculatorRepository.&lt;/p&gt;

&lt;p&gt;Inside SumTwoNumber method from CalculatorController we have a call to GetAllCalculations that will return all calculation in a IEnumerable. How to set that? By calling Setup and Return in mock instance.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mock.Setup(e =&amp;gt; e.GetAllCalculations()).Returns(Enumerable.Empty&amp;lt;Calculation&amp;gt;());

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

&lt;/div&gt;



&lt;p&gt;Our full method test will be something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;        [Fact]
        public void Sum_two_numbers_using_fact()
        {
            //arrange
            var mock = new Mock&amp;lt;ICalculatorRepository&amp;gt;();
            mock.Setup(e =&amp;gt; e.GetAllCalculations()).Returns(Enumerable.Empty&amp;lt;Calculation&amp;gt;());
            mock.Setup(e =&amp;gt; e.SaveCalculation(It.IsAny&amp;lt;Calculation&amp;gt;()));
            var controller = new CalculatorController(mock.Object);

            int num1 = 1;
            int num2 = 2;
            int expected = num1 + num2;            

            //act
            var response = controller.SumTwoNumbers(num1, num2) as OkObjectResult;

            //assert
            Assert.NotNull(response);
            Assert.Equal(response.Value, expected);
        }

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

&lt;/div&gt;



&lt;p&gt;You can also mock a method from a class that does not have a interface by setting virtual in the method declaration.&lt;/p&gt;

</description>
      <category>csharp</category>
      <category>test</category>
    </item>
    <item>
      <title>How to configure Azure Applications Insights on .Net 5</title>
      <dc:creator>Rafael Ahrons</dc:creator>
      <pubDate>Thu, 29 Apr 2021 13:58:17 +0000</pubDate>
      <link>https://dev.to/luturol/how-to-configure-azure-applications-insights-on-net-5-7a3</link>
      <guid>https://dev.to/luturol/how-to-configure-azure-applications-insights-on-net-5-7a3</guid>
      <description>&lt;h2&gt;
  
  
  How to configure Azure Applications Insights on .Net 5
&lt;/h2&gt;

&lt;p&gt;Application insights is a wonderful tool to help you track log, see performance issues and application map. It's more like CloudWatch on AWS.&lt;/p&gt;

&lt;p&gt;First, you need to download two packages from nuget to start.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.nuget.org/packages/Microsoft.ApplicationInsights.AspNetCore"&gt;Microsoft.ApplicationInsights.AspNetCore&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.nuget.org/packages/Microsoft.Extensions.Logging.ApplicationInsights"&gt;Microsoft.Extensions.Logging.ApplicationInsights&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dotnet add package Microsoft.ApplicationInsights.AspNetCore &lt;span class="nt"&gt;--version&lt;/span&gt; 2.17.0
dotnet add package Microsoft.Extensions.Logging.ApplicationInsights &lt;span class="nt"&gt;--version&lt;/span&gt; 2.17.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After that, you need to initialize the configurations from application insights on Statup.cs and Program.cs&lt;/p&gt;

&lt;p&gt;On Startup.cs, you need to add the service dependency.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;ConfigureServices&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;IServiceCollection&lt;/span&gt; &lt;span class="n"&gt;services&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;services&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;AddApplicationInsightsTelemetry&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

    &lt;span class="c1"&gt;//others dependencies&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On Program.cs, you need to set the Log Level and your Instrumentation Key.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="n"&gt;IHostBuilder&lt;/span&gt; &lt;span class="nf"&gt;CreateHosBuilder&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt;
    &lt;span class="n"&gt;Host&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;CreateDefaultBuilder&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ConfigureLogging&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;logging&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;logging&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;AddApplicationInsights&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"your-instrumentation-key"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="n"&gt;logging&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;AddFilter&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;ApplicationINsightsLoggerProvider&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;(&lt;/span&gt;&lt;span class="s"&gt;""&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;LogLevel&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Trace&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="p"&gt;})&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ConfigureWebHostDefaults&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;webBuilder&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt; 
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;webBuilder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;UseStartup&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Startup&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;();&lt;/span&gt;
        &lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now you can use ILogger to create logs on Azure Application Insights.&lt;/p&gt;

&lt;p&gt;Don't forget to eat clean and drink water.&lt;/p&gt;

&lt;p&gt;Peace!!&lt;/p&gt;

</description>
      <category>csharp</category>
      <category>azure</category>
    </item>
    <item>
      <title>C# - Jokenpo Challenge</title>
      <dc:creator>Rafael Ahrons</dc:creator>
      <pubDate>Thu, 26 Mar 2020 11:37:40 +0000</pubDate>
      <link>https://dev.to/luturol/csharp-jokenpo-challenge-l7a</link>
      <guid>https://dev.to/luturol/csharp-jokenpo-challenge-l7a</guid>
      <description>&lt;p&gt;&lt;em&gt;You can check the &lt;a href="https://github.com/luturol/jokenpo"&gt;repository right here&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="http://dojopuzzles.com/problemas/exibe/jokenpo/"&gt;Jokenpo Challenge&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;I like to solve problems and challenges, they make me feel excited about coding because I have to be on my best game and try to solve the problem is exciting . It gives that feel of accomplishment and victory when you finished.&lt;/p&gt;

&lt;p&gt;The challenge consist of making a Jokenpo game logic, by all means, you must implement the rules of the game. Rock wins against Scissor and lose against Paper, Paper wins against Rock and lose against Scissor, Scissor wins against Paper and lose against Rock. How can we implement that in C#?&lt;/p&gt;

&lt;p&gt;For this I thought that I must have some way of validation. The validation I wanted was to make it more “generic” and easy to create. Each validation only works for that one had form. To do it, I made an Enum for Hand forms:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;enum&lt;/span&gt; &lt;span class="n"&gt;HandForm&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;Rock&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;Paper&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;Scissor&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

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



&lt;p&gt;Now the problem is: &lt;em&gt;How to validate the Enum? How the Enum will have it’s own Rule?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The way I thought of solving was: create an extension for this enum that will return the &lt;strong&gt;Rule Class&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;HandFormExtensions&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="n"&gt;AbstractRules&lt;/span&gt; &lt;span class="nf"&gt;ToRule&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt; &lt;span class="n"&gt;HandForm&lt;/span&gt; &lt;span class="n"&gt;handForm&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;handForm&lt;/span&gt; &lt;span class="p"&gt;==&lt;/span&gt; &lt;span class="n"&gt;HandForm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Rock&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;RockRules&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
        &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;handForm&lt;/span&gt; &lt;span class="p"&gt;==&lt;/span&gt; &lt;span class="n"&gt;HandForm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Paper&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;PaperRules&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
        &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;handForm&lt;/span&gt; &lt;span class="p"&gt;==&lt;/span&gt; &lt;span class="n"&gt;HandForm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Scissor&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;ScissorRules&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
        &lt;span class="k"&gt;else&lt;/span&gt;
            &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;ArgumentException&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"There is no hand form rule for this option"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;   

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



&lt;p&gt;Rule class will implement the AbstractRule class that will contain an abstract method that returns the result of that play, this means that the Rule class will have the checks for that hand form against the opponent hand form.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;abstract&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;AbstractRules&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;abstract&lt;/span&gt; &lt;span class="n"&gt;GameResult&lt;/span&gt; &lt;span class="nf"&gt;WinAgainst&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;HandForm&lt;/span&gt; &lt;span class="n"&gt;opponent&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

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



&lt;p&gt;Now the Judge of the Jokenpo will have only one line of code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="n"&gt;GameResult&lt;/span&gt; &lt;span class="nf"&gt;ValidateGame&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Player&lt;/span&gt; &lt;span class="n"&gt;player1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Player&lt;/span&gt; &lt;span class="n"&gt;player2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;player1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;HandForm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ToRule&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;WinAgainst&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;player2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;HandForm&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;             
&lt;span class="p"&gt;}&lt;/span&gt;

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



&lt;p&gt;So, whenever someone call the Judge class to validate the game, it will only return the result of the game based on the first Player passed as Parameter.&lt;/p&gt;

&lt;p&gt;That’s it folks. Don’t forget to eat clean and drink water.&lt;/p&gt;

&lt;p&gt;Peace.&lt;/p&gt;

</description>
      <category>csharp</category>
      <category>begginer</category>
    </item>
    <item>
      <title>Devlog #03 - Final day from My First Game Jam Winter 2020 - from 29/01 to 08/02</title>
      <dc:creator>Rafael Ahrons</dc:creator>
      <pubDate>Wed, 26 Feb 2020 19:14:18 +0000</pubDate>
      <link>https://dev.to/luturol/devlog-03-final-day-from-my-first-game-jam-winter-2020-from-29-01-to-08-02-58kl</link>
      <guid>https://dev.to/luturol/devlog-03-final-day-from-my-first-game-jam-winter-2020-from-29-01-to-08-02-58kl</guid>
      <description>&lt;p&gt;&lt;strong&gt;&lt;em&gt;You can read this in &lt;a href="https://luturol.github.io/gamedev/Devlog-03-Final-Day-of-the-jam"&gt;my personal blog&lt;/a&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Finally released my first game
&lt;/h1&gt;

&lt;p&gt;It's finished? No, it is not. It is cool? You good damn right (at least I enjoyed making and playing the microgame).&lt;/p&gt;

&lt;h2&gt;
  
  
  What happend
&lt;/h2&gt;

&lt;p&gt;The game jam was tough. I've learned a lot and got passionate with game dev. It's my first game that I made by myself. The result of the game jam isn't that good, but I'm proud of it.&lt;/p&gt;

&lt;p&gt;In the middle of the jam I got sick and couldn't code till I get bether, so for some days I didn't code at all :(&lt;/p&gt;

&lt;p&gt;The final days was insane. I've code a lot and try to fix some bugs, but in programming code = new bugs.&lt;/p&gt;

&lt;p&gt;First, let's get to the results. You can play &lt;a href="https://luturol.itch.io/survive-the-night"&gt;Survive the night on itch&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;What the game has:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A player with animations for: running, idle and attack.&lt;/li&gt;
&lt;li&gt;A monster (Treant) with animations for: running, iddle and death.&lt;/li&gt;
&lt;li&gt;Pathfinder for the Treant can find and run to the Player&lt;/li&gt;
&lt;li&gt;Health bar for the Treant.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The game is simple for now. If you kill the treant, the game ends.&lt;/p&gt;

&lt;p&gt;I got so happy with the results that even when it's finished I started coding to improve the game.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/LmBbMG7zESbCufj64z/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/LmBbMG7zESbCufj64z/giphy.gif" alt="Player running from Treant and after that fighting against it"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The next features that I want is:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Spawn for Treants&lt;/li&gt;
&lt;li&gt;Adjust the ground layout. Because it doesn't fit the collor pallet and doesn't look natural.&lt;/li&gt;
&lt;li&gt;Add a combat system for the Treants&lt;/li&gt;
&lt;li&gt;Maybe add more creatures, but this would be made by me&lt;/li&gt;
&lt;li&gt;Add a bonfire&lt;/li&gt;
&lt;li&gt;Add light to the bonfire&lt;/li&gt;
&lt;li&gt;Logo for the Survive the night&lt;/li&gt;
&lt;li&gt;End screen when you win or loose.&lt;/li&gt;
&lt;li&gt;Intial start game screen with the main character and the bonfire just vibing&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This the features that I want to add for the next release.&lt;/p&gt;

&lt;p&gt;Don't forget to eat clean and drink water.&lt;/p&gt;

&lt;p&gt;Peace!! ✌️&lt;/p&gt;

</description>
      <category>gamedev</category>
      <category>devlog</category>
    </item>
    <item>
      <title>Devlog #02 - Fixing bugs from pass days and adding Particle System Day 3~4</title>
      <dc:creator>Rafael Ahrons</dc:creator>
      <pubDate>Wed, 12 Feb 2020 20:44:05 +0000</pubDate>
      <link>https://dev.to/luturol/devlog-2-fixing-bugs-from-pass-days-and-adding-particle-system-day-3-4-1227</link>
      <guid>https://dev.to/luturol/devlog-2-fixing-bugs-from-pass-days-and-adding-particle-system-day-3-4-1227</guid>
      <description>&lt;p&gt;&lt;em&gt;You can read the original post in &lt;a href="https://luturol.github.io/gamedev/Devlog-02-Fixing-bugs-from-pass-days-and-adding-Particle-System"&gt;my personal blog&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Days: 28/01 and 29/01&lt;/p&gt;

&lt;h1&gt;
  
  
  Bugs fixed
&lt;/h1&gt;

&lt;p&gt;In the last devlog we had an issue with the collision that I couldn't solve. But fortunately we found the answer in &lt;a href="https://docs.unity3d.com/Manual/CollidersOverview.html"&gt;Unity API!&lt;/a&gt;. The answer was in the rigid body added to Treant. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Colliders on a GameObject that has a Rigidbody are known as dynamic colliders. Static colliders can interact with dynamic colliders but since &lt;strong&gt;they don’t have a Rigidbody, they do not move in response to collisions&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Particle System
&lt;/h2&gt;

&lt;p&gt;After the bug was fixed we add a particle system to make a blood effect for when the monster or player got a hit it shows up. In the beginning, it won't show in the treant. We had to make a Prefab from the particle system, edit the properties to make small and finally add to the Enemy script.&lt;/p&gt;

&lt;p&gt;When we called from the script, it won't show the particles. To fix that bug we use this answer &lt;a href="http://answers.unity.com/answers/1407848/view.html"&gt;Particle System object (tab Renderer) value of "Sorting Fudge" to -100&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Now we have this:&lt;br&gt;
&lt;a href="https://i.giphy.com/media/fwtzcLu89NWlCFgTbb/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/fwtzcLu89NWlCFgTbb/giphy.gif" alt="Player hitting the tree"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The code to execute this is simple:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;bloodClone&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;Instantiate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;bloodEffect&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
                             &lt;span class="n"&gt;gameObject&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;transform&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;position&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
                             &lt;span class="n"&gt;gameObject&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;transform&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;rotation&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nf"&gt;Destroy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;bloodClone&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;bloodClone&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;GetComponent&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;ParticleSystem&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;().&lt;/span&gt;&lt;span class="n"&gt;main&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;duration&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Added to Enemy.cs, TakeDamage method. Now every time the object gets hit, it will instantiate a particle system that will be destroyed when it`s over&lt;/p&gt;

&lt;h3&gt;
  
  
  For the next days, we want to:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Change the scene layout for one that has snow ground and with trees&lt;/li&gt;
&lt;li&gt;Add the bonfire&lt;/li&gt;
&lt;li&gt;Add idle animations from is a side character&lt;/li&gt;
&lt;li&gt;Fix the bug that character can damage enemy hitting from down or up if the enemy is near&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>gamedev</category>
      <category>devlog</category>
    </item>
    <item>
      <title>Devlog #01 - My first game jam winter 2020 Day 2</title>
      <dc:creator>Rafael Ahrons</dc:creator>
      <pubDate>Wed, 29 Jan 2020 00:36:49 +0000</pubDate>
      <link>https://dev.to/luturol/devlog-01-my-first-game-jam-winter-2020-day-2-3if3</link>
      <guid>https://dev.to/luturol/devlog-01-my-first-game-jam-winter-2020-day-2-3if3</guid>
      <description>&lt;p&gt;You can read my original post in &lt;a href="https://luturol.github.io/gamedev/Devlog-01-my-first-game-jam-winter-2020"&gt;my personal blog&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  The Jam
&lt;/h1&gt;

&lt;p&gt;I've received an e-mail last week about a game jam that is happening right now. &lt;a href="https://itch.io/jam/my-first-game-jam-winter-2020"&gt;My First Game Jam Winter 2020&lt;/a&gt; is for begginers like me, so you can try to learn a new tool, try to learn how to code and receive a feedback of your work.&lt;/p&gt;

&lt;p&gt;The theme is &lt;strong&gt;Cold&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Let me tell you my background. I work as a software engineer and know how to code in C# and my brother work as a software engineer too but knows Java. So to help each other, we are going to try to lear Unity engine. C# is similar to Java, hence he won't be facing such difficulty in syntax.&lt;/p&gt;

&lt;h2&gt;
  
  
  Our Idea
&lt;/h2&gt;

&lt;p&gt;While talking to my brother we got an idea that both of us got interested of doing. The ideia is:&lt;/p&gt;

&lt;p&gt;We are going to try to build a survival game more like an Enfos map from Warcraft 3 that you have to protect something and has a hero. That hero will be you. So you have to protect a bonfire in the snow from monsters trying to extinguishement the bonfire. If the bonfire extinguishes you gonna die from cold and wont be able to see in the night. You must survive till dawn.&lt;/p&gt;

&lt;p&gt;The player will be able to move up, down, right and left. Will be able to attack other monsters and if he got hit by a monster than we want to display an animation for that, same as if he dies. Monsters will be able to do the same, but we wont be able to control.&lt;/p&gt;

&lt;p&gt;What we want is the monster to have a path finder to got directly to the bonfire or to the player if he is near the monster.&lt;/p&gt;

&lt;h2&gt;
  
  
  Our development journey from Day 2
&lt;/h2&gt;

&lt;p&gt;Day 1 we were in the beach and couldn't code, so we started coding in day 2 (sunday 26/01/2020).&lt;/p&gt;

&lt;p&gt;We don't know how to use Unity... We are using tutorials from Brackeys and Blackthornprod to learn how to do the stuffs we want.&lt;/p&gt;

&lt;p&gt;In day one, we built the movements from player and the add animations parameters to activate the right animation when he is going up, down, left and right. We add a simple combat system that when the player gets near to a monster he can hit until he kills them.&lt;/p&gt;

&lt;p&gt;The monster can't move yet, soon we will add movement animations and a path finder.&lt;/p&gt;

&lt;p&gt;We hope that in the next days, we add some art made by us.&lt;/p&gt;

&lt;p&gt;You can check ours &lt;a href="https://github.com/luturol/my-first-game-jam-winter-2020"&gt;repository in github&lt;/a&gt; to check our progress.&lt;/p&gt;

&lt;p&gt;This is what we have right now:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--NLW6yfyd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/xgdh9rhkl6s8lzica2qu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--NLW6yfyd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/xgdh9rhkl6s8lzica2qu.png" alt="Sprite of an idle character and an idle monster in Unity"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The player can attack the monster if he gets near and can walk up, down, left and right with their own animations.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/hXIeSAUKroDUTNqI4e/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/hXIeSAUKroDUTNqI4e/giphy.gif" alt="Gif of the character running up, down, right and left"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Problems that we faced
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Gizmos doesn't appear&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;While in the development we could add a Gizmos Sphere to see the range of the attack object. We add a gizmos in some scriptable object but it wasn't showing up. I've been searching in a lot how to fix it but when I found one, i laught about it. Gizmos was disable in the scene...&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Collider from player is pushing monster away when collide&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;As the title suggest, the player couldn't attack the monster because he was pushing them away. The bug is funny, but we couldn't solved very well yet. We changed the rigid body property to use kinematics instead of dynamic. Now the player can pass through the monster, but it isn't what we want. We want the player can't pass through the monster.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/gIIIP2TAHwDuhC62ru/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/gIIIP2TAHwDuhC62ru/giphy.gif" alt="Character pushing monster away when gets near him"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Even posted a &lt;a href="https://gamedev.stackexchange.com/questions/178616/how-to-not-move-my-character-when-they-collide-using-unity-and-box-collider"&gt;question to Game Development stackexchange&lt;/a&gt; to get some help.&lt;/p&gt;

</description>
      <category>gamedev</category>
      <category>devlog</category>
    </item>
    <item>
      <title>Docker 102 - What is Docker image and Dockerfiles</title>
      <dc:creator>Rafael Ahrons</dc:creator>
      <pubDate>Thu, 10 Oct 2019 11:46:55 +0000</pubDate>
      <link>https://dev.to/luturol/docker-102-the-beauty-of-dockerfiles-2f93</link>
      <guid>https://dev.to/luturol/docker-102-the-beauty-of-dockerfiles-2f93</guid>
      <description>&lt;p&gt;You can check the original post in &lt;a href="https://luturol.github.io/docker/Docker-102"&gt;my personal blog&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  What is Docker Image
&lt;/h1&gt;

&lt;p&gt;Docker image is a snapshot of a container. It's immutable and inert. Container is an instance of an image.&lt;/p&gt;

&lt;h1&gt;
  
  
  What is Dockerfiles
&lt;/h1&gt;

&lt;p&gt;Is a file that contains instructions to create an image and running it the way you want.&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating a Dockerfile
&lt;/h2&gt;

&lt;p&gt;This is an example of code that we're gonna put inside a docker image after creating one from a dockerfile.&lt;/p&gt;

&lt;p&gt;Python code to app.py&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;flask&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Flask&lt;/span&gt;

&lt;span class="n"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Flask&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;__name__&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="o"&gt;@&lt;/span&gt;&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;route&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"/"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;hello&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s"&gt;"hello world!"&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;__name__&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s"&gt;"__main__"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;host&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"0.0.0.0"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Example of Dockerfile that will build the image:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight docker"&gt;&lt;code&gt;&lt;span class="k"&gt;FROM&lt;/span&gt;&lt;span class="s"&gt; python:3.6.1-alpine&lt;/span&gt;
&lt;span class="k"&gt;RUN &lt;/span&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;flask
&lt;span class="k"&gt;CMD&lt;/span&gt;&lt;span class="s"&gt; ["python", "app.py"]&lt;/span&gt;
&lt;span class="k"&gt;COPY&lt;/span&gt;&lt;span class="s"&gt; app.py /app.py&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;FROM python:3.6.1-alpine&lt;/strong&gt; means that you're using a python 3.6.1 built-in Alpine image, you can see what have in the image looking for the tag in the official Python page on Docker Hub. More light the OS, faster is the deploy.&lt;/p&gt;

&lt;p&gt;By security measures it's recommended to verify if the image you are using is the official from the app or language and if it's certified by Docker. Also, verify what have in the dockerfile.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;RUN pip install flask&lt;/strong&gt; is the call to run pip install flask command, which is the dependency of our app. Run serves to execute the following command to configure the container environment. Usually used to install dependencies or build the project.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;CMD ["python", "app.py"]&lt;/strong&gt; is the command that will be executed after you initialized the container You must be careful to only have one CMD for dockerfile. If have more than one, it will always execute the last. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;COPY app.py /app.py&lt;/strong&gt; add a copy of app.py file inside the container in the /app.py folder. It looks kind of odd putting after CMD command, but because of layers, in case you change the file, the cache will only modify the last line in the image.&lt;/p&gt;

&lt;p&gt;There is no need to have python, pip, and flask installed. The vantage of using docker is that you don't need to have all installed to run the app, only need a container. After you finished using, just delete the container.&lt;/p&gt;

&lt;p&gt;The dockerfile has all the instructions the built the image and have it running (container) the way you desire.&lt;/p&gt;

&lt;h2&gt;
  
  
  Building the image
&lt;/h2&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;docker image build &lt;span class="nt"&gt;-t&lt;/span&gt; python-hello-world &lt;span class="nb"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;-t&lt;/strong&gt; allows you to add a name to the image.&lt;/p&gt;

&lt;p&gt;If you change some file, just run &lt;strong&gt;docker image build&lt;/strong&gt; again&lt;/p&gt;

&lt;p&gt;Check if the image was built.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;docker image &lt;span class="nb"&gt;ls&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Shows all images that you have created or download from docker hub.&lt;/p&gt;

&lt;h2&gt;
  
  
  Executing the docker image
&lt;/h2&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;docker run &lt;span class="nt"&gt;-p&lt;/span&gt; 5001:5000 &lt;span class="nt"&gt;-d&lt;/span&gt; python-hello-world
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;-p&lt;/strong&gt; maps the port that is running inside the container with the one from the host.&lt;br&gt;
&lt;strong&gt;-d&lt;/strong&gt; run the image in the background&lt;/p&gt;

&lt;p&gt;You can check on localhost:5001 if the container is running correctly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Layers
&lt;/h2&gt;

&lt;p&gt;It's basicly the series of steps which the container will built from the image. Which command on the docker file will be a layer. It's important to notice that everytime a layer is changed, the consectives are gonna change either. Because if one step has changed, the consectives steps must run to create the image. So, for bether performance, add the line that will have more changes for the last.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://stackoverflow.com/questions/31222377/what-are-docker-image-layers"&gt;This question from stackoverflow has a good answer for that&lt;/a&gt; and this &lt;a href="https://medium.com/@jessgreb01/digging-into-docker-layers-c22f948ed612"&gt;medium post from Jessica G either&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So that's all, folks. You learned how to create a dockerfile and image. Thanks for reading and keep going. Don't forget to drink water and eat clean..&lt;/p&gt;

</description>
      <category>docker</category>
      <category>begginers</category>
    </item>
    <item>
      <title>Docker 101 - What it is and how to start using</title>
      <dc:creator>Rafael Ahrons</dc:creator>
      <pubDate>Fri, 04 Oct 2019 02:24:02 +0000</pubDate>
      <link>https://dev.to/luturol/docker-101-what-it-is-and-how-to-start-using-1d84</link>
      <guid>https://dev.to/luturol/docker-101-what-it-is-and-how-to-start-using-1d84</guid>
      <description>&lt;p&gt;You can see the original post in &lt;a href="https://luturol.github.io/docker/Docker-101"&gt;my personal blog&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  What is Docker?
&lt;/h1&gt;

&lt;p&gt;Docker is a tool which controls containers and makes it possible for developers to use container with their own applications.&lt;/p&gt;

&lt;p&gt;Putting on a container, you have the advantage to grant that your application will always run fine and with the same environment every time, cause it is configurated in a container with all needed specifications. &lt;/p&gt;

&lt;p&gt;Docker has it's own interface standardized for all operations.&lt;/p&gt;

&lt;p&gt;Has it's own container orchestration.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is a container?
&lt;/h2&gt;

&lt;p&gt;It's something that packages up all application dependencies and code so the application runs as fine as it can. You can read more at &lt;a href="https://www.docker.com/resources/what-container"&gt;What is a Container? from docker page&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Running a container
&lt;/h2&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker container run -t ubuntu top
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;docker container run&lt;/strong&gt; initialize a container.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;-t&lt;/strong&gt; add an &lt;a href="https://unix.stackexchange.com/questions/21147/what-are-pseudo-terminals-pty-tty"&gt;pseudo-TTY&lt;/a&gt; to the image.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;run&lt;/strong&gt; first execute a docker pull to get ubuntu image for the host. After downloaded, initialize the container with the Ubuntu image.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;top&lt;/strong&gt; is a Linux command that shows all active process order by memory consumption.&lt;/p&gt;

&lt;p&gt;Looking at the output on bash you gonna see only the root process running, which means that all container is isolated from which other, avoiding conflicts between one and another.&lt;/p&gt;

&lt;p&gt;Even using the same image from Ubuntu, it's important to note that the container does not have it's own kernel. It uses the host kernel and the image is used only to provide the file system and tools available on Ubuntu.&lt;/p&gt;

&lt;h2&gt;
  
  
  Get inside the container
&lt;/h2&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker container exec -it
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Allows you to enter the container terminal.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;-it&lt;/strong&gt; allows you to enter without executing any command and you can navigate on it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Show all containers
&lt;/h2&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker container ls
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Shows all the containers that are running.&lt;/p&gt;

&lt;h2&gt;
  
  
  Using container ID to get into it's terminal
&lt;/h2&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker container ls
--Get the container ID
docker container exec -it CONTAINER_ID bash

--to leave from the container
exit
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The last argument selects the terminal to use. You can see on Docker hub which terminal is available to use.&lt;/p&gt;

&lt;h3&gt;
  
  
  Stopping a container
&lt;/h3&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker container stop container_id
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;You can use only the first 3 digits in the container ID to identify the contaier, those digits is whats make a container unique.&lt;/p&gt;

&lt;p&gt;It's possible to stop more than one container at once:&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker container stop d67 ead af5
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h3&gt;
  
  
  Removing a container
&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker system prune
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Remove all stopped containers.&lt;/p&gt;

&lt;p&gt;Thanks for reading it. I've been using docker for a while now and it's amazing having all my projects running without conflict and even their on database. I'm tired to install and configure all different types of databases...&lt;/p&gt;

&lt;p&gt;Don't forget to drink water and eat clean.&lt;/p&gt;

</description>
      <category>docker</category>
      <category>begginers</category>
    </item>
    <item>
      <title>Game dev for beginners like me</title>
      <dc:creator>Rafael Ahrons</dc:creator>
      <pubDate>Sat, 07 Sep 2019 20:49:05 +0000</pubDate>
      <link>https://dev.to/luturol/game-dev-for-beginners-like-me-4aff</link>
      <guid>https://dev.to/luturol/game-dev-for-beginners-like-me-4aff</guid>
      <description>&lt;h3&gt;
  
  
  You can see the original post with the game developed in &lt;a href="https://luturol.github.io/gamedev/game-dev-for-begginers-like-me"&gt;my personal blog&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;In the beginner of this is, I've got into a vibe of thoughts which I questioned what I liked to program. The good side and bad of been a dev is that you end up doing a lot of different stuff and, by consequence of the market, you end up in other fields of acting. I went through the banking sector, ERP of small enterprises, hospital management, and maybe in the near future banking sector again. The point is that in programming, you can do a lot of stuff, a lot of interesting stuff. But knowing what you really like to program is another 500.&lt;/p&gt;

&lt;p&gt;Been in love with programming is an extra bust of productive, that even when you're tired and exhaust you are going to code because you like it. You enjoy coding that, so you will do, you will learn and get motivated by the end of the day.&lt;/p&gt;

&lt;p&gt;What was always in love was RPG games, so I'm gonna on an adventure to learn how to make games.&lt;/p&gt;

&lt;p&gt;Found out some &lt;a href="http://dev.to"&gt;dev.to&lt;/a&gt; articles to help me find the right path to follow.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev.to/arnaudmorisset/an-overview-of-the-javascript-gamedev-ecosystem-4afb"&gt;This article&lt;/a&gt; by &lt;a class="comment-mentioned-user" href="https://dev.to/arnaudmorisset"&gt;@arnaudmorisset&lt;/a&gt;
 clarify some doubts of which language and where to start. It made go motivated to C# and Unity. Why? Just because I know how to code in C# and I like it.&lt;/p&gt;

&lt;p&gt;Thus, I followed a Youtube tutorial from  &lt;a href="https://www.youtube.com/user/gamesplusjames"&gt;GamePlusJames&lt;/a&gt; and learn it a lot of stuff about 2D games and scripting with Unity. The fact of knowing C# helped a lot but still got some doubt. &lt;/p&gt;

&lt;h2&gt;
  
  
  Doubts that came while doing Snowball Fight Tutorial:
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;How to build the project? Unity has a lot of different types of building your project and configs. Which one I use and why?
In the last video, he explains how to build and configure to play on windows.&lt;/li&gt;
&lt;li&gt;There is a way to make Unit Test to my business logic?&lt;/li&gt;
&lt;li&gt;How to connect on database?&lt;/li&gt;
&lt;li&gt;How to use HTTP Request to other services?&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  The path I've found:
&lt;/h2&gt;

&lt;p&gt;This &lt;a href="https://www.youtube.com/watch?v=p23J5-1OTAM&amp;amp;t=196s"&gt;tutorial from GamePlusJames&lt;/a&gt; is perfect for those that don't know yet how to programming and don't know anything about Unity. He explains very well what he is doing through the videos.&lt;/p&gt;

&lt;p&gt;There is this Udemy class &lt;a href="https://www.udemy.com/unitycourse/"&gt;Complete C# Unity Developer 2D: Learn to Code Making Games&lt;/a&gt; that teaches you how to program C# from the start and stuff about Unity. You will code at least 4 projects during the classes.&lt;/p&gt;

</description>
      <category>gamedev</category>
      <category>csharp</category>
      <category>beginners</category>
    </item>
    <item>
      <title>How I made my first blog with Jekyll and why</title>
      <dc:creator>Rafael Ahrons</dc:creator>
      <pubDate>Tue, 06 Aug 2019 00:22:05 +0000</pubDate>
      <link>https://dev.to/luturol/how-i-made-my-first-blog-with-jekyll-and-why-52i0</link>
      <guid>https://dev.to/luturol/how-i-made-my-first-blog-with-jekyll-and-why-52i0</guid>
      <description>&lt;p&gt;You can ready the original in &lt;a href="https://luturol.github.io/jekyll/how-i-made-my-first-blog-with-jekyll"&gt;my personal blog&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Motivation
&lt;/h2&gt;

&lt;p&gt;After wanting to make a blog and discuss it with my brother. I've got the conclusion that is necessary to have a blog to learn more about programming and to teach others that may be struggling with the same subject that I was. Now I'm gonna create a series of posts about Jekyll, Liquid templates and Css as I learn it and modify my blog to have more of me on it. In an article about &lt;a href="https://dev.to/quinncuatro/learning-devops-in-public-c26"&gt;DevOps from Henry Quinn @quinncuatro&lt;/a&gt; on &lt;a href="http://dev.to"&gt;dev.to&lt;/a&gt;, I got really intrigued with Learning in Public.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is learning in public?
&lt;/h2&gt;

&lt;p&gt;Is exposing for all what you are learning or developing in that moment. Why? Because, when you teach others you end up learning more about it and helping others with the same subject. It helps you to memorize and practice the subject.&lt;/p&gt;

&lt;h2&gt;
  
  
  Benefits to learn in public
&lt;/h2&gt;

&lt;p&gt;You would be helping others to not struggle as you when you were learning, you will be practicing journaling and maybe another language (my case).&lt;/p&gt;

&lt;h2&gt;
  
  
  Let's do it
&lt;/h2&gt;

&lt;p&gt;To begin, what I'm gonna be writing in this series are CSS, Liquid Template and Jekyll, becauses that's what I'm dealing with to build my personal blog. Feel free to give me a feedback in the end to help me more.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why Jekyll?
&lt;/h3&gt;

&lt;p&gt;Didn't want to host my blog anywhere and didn't want to have cost and problems with infrastructure and security, I really just want to focus in programming with a simple and fast result, so I end up picking Jekyll (and it's recommended by Github Pages tutorial).&lt;/p&gt;

&lt;p&gt;Jekyll is a generator of statics sites from a specific template.&lt;/p&gt;

&lt;p&gt;It's created in Ruby, so you have to have installed on your computer. In Jekyll's site has a tutorial to install Ruby and Jekyll.&lt;/p&gt;

&lt;p&gt;To initialize your project you have to execute the command below:&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;jekyll new nome-do-blog
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;It will create the structure of your project in his own folder.&lt;/p&gt;

&lt;p&gt;Jekyll default is to use Minimal template. To find where the files are, just use the command bellow:&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;bundle show minimal
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;It will show you the directory of it.&lt;/p&gt;

&lt;p&gt;If you want to change the template and have in your versioning program, then you should copy the files to your project directory.&lt;/p&gt;

&lt;p&gt;To build and execute your site it was never that easy!! Only execute the commands bellow on your project main folder.&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;bundle exec jekyll build
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;After built:&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;bundle exec jekyll s
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now you have your personal blog with Minimal Template on localhost:4000.&lt;/p&gt;

&lt;p&gt;As I learn more and modify my personal blog to have my own style, I'll be doing more posts and explain it. &lt;/p&gt;

&lt;p&gt;That's all folks.&lt;/p&gt;

&lt;p&gt;Don't forget to drink water.&lt;/p&gt;

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