<?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: Nicolas Sebastian Vidal</title>
    <description>The latest articles on DEV Community by Nicolas Sebastian Vidal (@nisevi).</description>
    <link>https://dev.to/nisevi</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%2F101968%2F92f4623c-b249-4b3b-a010-cd63ea4f5dbb.png</url>
      <title>DEV Community: Nicolas Sebastian Vidal</title>
      <link>https://dev.to/nisevi</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nisevi"/>
    <language>en</language>
    <item>
      <title>Python script for cloning repositories</title>
      <dc:creator>Nicolas Sebastian Vidal</dc:creator>
      <pubDate>Mon, 27 Jul 2020 12:02:11 +0000</pubDate>
      <link>https://dev.to/nisevi/script-for-cloning-repositories-4h4m</link>
      <guid>https://dev.to/nisevi/script-for-cloning-repositories-4h4m</guid>
      <description>&lt;p&gt;A couple times it happened to me this year that I had to pull again the repositories from a given organization.&lt;/p&gt;

&lt;p&gt;Mostly it happened to me because my computer broke, so a friend of mine lend me his computer so I could work. After mine was fixed I had to pull everything again.&lt;/p&gt;

&lt;p&gt;So for not having to clone the repositories manually I wrote a Python 3 script for doing it for me:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;The name of the organization is the GitHub username. So for example Facebook GitHub URL is &lt;a href="https://github.com/facebook"&gt;https://github.com/facebook&lt;/a&gt;, if you would like to clone all their repositories you will have to replace &lt;strong&gt;organization-name-goes-here&lt;/strong&gt; with &lt;strong&gt;facebook&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;If you don't know &lt;a href="https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token"&gt;how to create a personal access token&lt;/a&gt;, click the link for going to the GitHub documentation. It is well explained with screenshots of where to go and everything. Once you get it, you will have to place it where it says &lt;strong&gt;token-goes-here&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;If you don't know how to install different versions of python on your machine, you could take a look to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://opensource.com/article/19/5/python-3-default-mac"&gt;The right and wrong way to set Python 3 as default on a Mac&lt;/a&gt;;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://realpython.com/intro-to-pyenv/"&gt;Managing Multiple Python Versions With pyenv&lt;/a&gt;;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You will need to install &lt;a href="https://pypi.org/project/PyGithub/"&gt;PyGithub&lt;/a&gt; the library that I'm importing in the script:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install PyGithub
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you don't have &lt;code&gt;pip&lt;/code&gt; installed, take a look &lt;a href="https://pip.pypa.io/en/stable/installing/"&gt;here&lt;/a&gt; for setting it up properly.&lt;/p&gt;

&lt;p&gt;Finally for running the script you just need to write in the terminal of your choice:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;python cloner.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Where &lt;code&gt;cloner.py&lt;/code&gt; is the name of the file where we wrote our script. Be aware that all repositories will be cloned in the path where you are executing the script.&lt;/p&gt;

&lt;p&gt;Have a great week everyone!!&lt;/p&gt;

</description>
      <category>python</category>
      <category>script</category>
      <category>github</category>
      <category>token</category>
    </item>
    <item>
      <title>Create GitHub PR based on a shared component upgrade?</title>
      <dc:creator>Nicolas Sebastian Vidal</dc:creator>
      <pubDate>Sun, 04 Aug 2019 05:05:01 +0000</pubDate>
      <link>https://dev.to/nisevi/create-github-pr-based-on-a-shared-component-upgrade-3f6f</link>
      <guid>https://dev.to/nisevi/create-github-pr-based-on-a-shared-component-upgrade-3f6f</guid>
      <description>&lt;p&gt;Private shared React component living &lt;a href="https://bit.dev"&gt;here&lt;/a&gt; and installed cross several projects. Each project handled by different teams. I want to create a PR on all repositories using the component every time a new version of the shared component is published.&lt;/p&gt;

&lt;p&gt;Does anyone know of an existent solution? Checking &lt;a href="https://dependabot.com/"&gt;dependabot&lt;/a&gt; now, but not sure if that will work with private things :P.&lt;/p&gt;

</description>
      <category>help</category>
      <category>react</category>
      <category>javascript</category>
      <category>github</category>
    </item>
    <item>
      <title>How to create a gem from scratch?</title>
      <dc:creator>Nicolas Sebastian Vidal</dc:creator>
      <pubDate>Fri, 03 May 2019 15:35:42 +0000</pubDate>
      <link>https://dev.to/nisevi/how-to-create-a-gem-from-scratch-4ej3</link>
      <guid>https://dev.to/nisevi/how-to-create-a-gem-from-scratch-4ej3</guid>
      <description>&lt;p&gt;We will walk through the basic steps needed to create a gem and publish it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0EcIPIK8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2A70DsXmKuo8nDnXoWAUq01w.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0EcIPIK8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2A70DsXmKuo8nDnXoWAUq01w.jpeg" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;RubyGems has been included with Ruby itself since Ruby 1.9, and is central to Ruby code distribution. It allows Ruby developers to package their code up into a single compressed file, called a "gem". Gems have filenames that end in the .gem extension, and they contain both the Ruby code that makes up the library in question and metadata about the library, including author and version information.&lt;/p&gt;

&lt;p&gt;Hal Fulton.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;We will create a gem that will &lt;a href="https://en.wikipedia.org/wiki/Monkey_patch"&gt;MonkeyPatch&lt;/a&gt; the &lt;a href="https://ruby-doc.org/core-2.6.3/String.html"&gt;String&lt;/a&gt; class in the Ruby language. It will introduce two new methods.&lt;/p&gt;

&lt;p&gt;These methods will allow us to modify a string by randomly removing half the characters of it. We will call our gem &lt;a href="https://rubygems.org/gems/thanoscase"&gt;thanoscase&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The name of the gem must be unique within the RubyGems ecosystem. So if you want to follow along with the steps for creating the gem, remember to change its name.&lt;/p&gt;

&lt;p&gt;The only requirement for you is to have &lt;a href="https://github.com/rbenv/rbenv"&gt;Ruby 1.9 or greater is in your system&lt;/a&gt;. A little bit of &lt;a href="https://medium.com/@nisevi/how-to-create-a-github-repository-3990a467661e"&gt;GitHub&lt;/a&gt; won't hurt either.&lt;/p&gt;

&lt;h2&gt;
  
  
  Crafting the gem
&lt;/h2&gt;

&lt;p&gt;The first thing will be to create the structure we need to have a gem published in &lt;a href="https://rubygems.org/"&gt;RubyGems&lt;/a&gt;. As you can see in the gist below:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h3&gt;
  
  
  Basic file structure
&lt;/h3&gt;

&lt;p&gt;We will type a couple of commands in our console:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;mkdir -p thanoscase/lib/thanoscase&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;touch thanoscase/lib/thanoscase/string.rb&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;touch thanoscase/lib/thanoscase.rb&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;touch thanoscase/thanoscase.gemspec&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hYe2ohkA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/800/1%2AYCcBaUYivv69ipbNOfI0Rw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hYe2ohkA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/800/1%2AYCcBaUYivv69ipbNOfI0Rw.png" alt=""&gt;&lt;/a&gt;Commands for creation of basic file structure&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;string.rb&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It will hold the logic for the methods that are going to be added to the String class. As can be seen here:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;thanoscase.gemspec&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The gemspec defines what’s in the gem, who made it, and the version of the gem. It’s also your interface to &lt;a href="http://rubygems.org/"&gt;RubyGems.org&lt;/a&gt;. All of the information you see on a gem page (like &lt;a href="http://rubygems.org/gems/jekyll"&gt;jekyll&lt;/a&gt;’s) comes from the gemspec.&lt;/p&gt;
&lt;/blockquote&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;thanoscase.rb&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;At this point, we will use thanoscase.rb as a placeholder for importing other libraries. In this case, we are importing the class String.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h2&gt;
  
  
  Pushing changes to RubyGems
&lt;/h2&gt;

&lt;p&gt;Once all the files are created, we need to build the gem. We will build it from the thanospec.gemspec specifications.&lt;/p&gt;

&lt;p&gt;Inside your root folder run the following command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;gem build thanoscase.gemspec&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---TqneypK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/780/1%2APZnCMm3_-MA53NYoXiv2bw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---TqneypK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/780/1%2APZnCMm3_-MA53NYoXiv2bw.png" alt=""&gt;&lt;/a&gt;Command used for building the gem&lt;/p&gt;

&lt;h3&gt;
  
  
  Installing and using our newly created gem
&lt;/h3&gt;

&lt;p&gt;Run this for installing the gem locally:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;gem install thanoscase-0.0.1.gem&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--KhEuAeQ3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/822/1%2AEaEcGaceHlZiCTAV4XBoIQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KhEuAeQ3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/822/1%2AEaEcGaceHlZiCTAV4XBoIQ.png" alt=""&gt;&lt;/a&gt;Command used for installing&lt;/p&gt;

&lt;p&gt;Now we will trigger the irb console and we will play along a little bit with our gem.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9oxkaLvG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/886/1%2A5XDYxZQsSEhza9u0VgOzuw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9oxkaLvG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/886/1%2A5XDYxZQsSEhza9u0VgOzuw.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;irb stands for &lt;a href="https://ruby-doc.org/stdlib-2.6.3/libdoc/irb/rdoc/IRB.html"&gt;interactive ruby&lt;/a&gt; is a tool to interactively execute Ruby expressions read from the standard input.&lt;/p&gt;

&lt;p&gt;require 'thanoscase' is used for importing our library so we can play with it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Pushing our gem to RubyGems
&lt;/h3&gt;

&lt;p&gt;First, you will need to login into RubyGems:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;gem signin&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_w1mn-ZE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/806/1%2As2BiHKmJdFEeaY4b4B6PqQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_w1mn-ZE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/806/1%2As2BiHKmJdFEeaY4b4B6PqQ.png" alt=""&gt;&lt;/a&gt;Command used for signing into RubyGems&lt;/p&gt;

&lt;p&gt;And now what we have been waiting for!! Time to push your gem!!!&lt;/p&gt;

&lt;p&gt;&lt;code&gt;gem push thanoscase-0.0.1.gem&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;We are done!! Now your newly created gem can be installed from anywhere!!!&lt;/p&gt;

&lt;p&gt;&lt;code&gt;gem install thanoscase&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Gem creation ends here. If you want to keep reading, we will add tests to our gem and continuous integration for tests to run automatically on every build.&lt;/p&gt;

&lt;h2&gt;
  
  
  RSpec for testing
&lt;/h2&gt;

&lt;p&gt;It is a good practice to have tests in place for covering the functionality we have created.&lt;/p&gt;

&lt;p&gt;Being said that, we will install &lt;a href="https://rspec.info/"&gt;RSpec&lt;/a&gt;, a tool for testing.&lt;/p&gt;

&lt;p&gt;Add this line to your gemspec file:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;s.add\_development\_dependency "rspec", "~\&amp;gt; 3.8"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;It should look like this:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;We will need to create a &lt;code&gt;Gemfile&lt;/code&gt;, inside our root folder:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;touch Gemfile&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Add the following lines to it:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;echo "source 'https://rubygems.org'" \&amp;gt;\&amp;gt; Gemfile&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;echo "gemspec" \&amp;gt;\&amp;gt; Gemfile&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;We are all set. Run the bundle command in order to install the RSpec dependency:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;bundle&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--O-24GgMw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/794/1%2Axe7qJn4UBiuHxxxTpAw0tQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--O-24GgMw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/794/1%2Axe7qJn4UBiuHxxxTpAw0tQ.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you don't have bundler installed, you will need to run:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;gem install bundler&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If you want to install a specific bundler version:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;gem install bundler -v 1.17.3&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://bundler.io/v1.3/rationale.html#sharing-your-application-with-other-developers"&gt;A new file will be created&lt;/a&gt;. Gemfile.lock will keep track of the library versions we are using.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;When your co-developers (or you on another machine) check out your code, it will come with the exact versions of all the third-party code your application used on the machine that you last developed on (in the Gemfile.lock). When **they** run bundle install, bundler will find the Gemfile.lock and skip the dependency resolution step. Instead, it will install all of the same gems that you used on the original machine.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Once RSpec is installed. Run rspec --init to set up your project to use RSpec.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;rspec --init&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;A folder spec will be created with a file inside called &lt;code&gt;spec\_helper.rb&lt;/code&gt;. This file holds the basic and default configuration for RSpec to work. All tests will be expected to be placed under the spec folder.&lt;/p&gt;

&lt;p&gt;Following this convention, we proceed to emulate our lib folder structure. We will create a file called &lt;code&gt;string\_spec.rb&lt;/code&gt; as follows:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;mkdir -p spec/lib/thanoscase&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;touch spec/lib/thanoscase/string.rb&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;And our file structure should look something like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--gOL-s6N5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/680/1%2ADxxLr7pdA7-kDzx5j4KJ4Q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gOL-s6N5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/680/1%2ADxxLr7pdA7-kDzx5j4KJ4Q.png" alt=""&gt;&lt;/a&gt;File structure for specs&lt;/p&gt;

&lt;p&gt;Inside our &lt;code&gt;string\_spec.rb&lt;/code&gt; file, we will write a couple of tests:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;Now we can run our test with:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;bundle exec rspec --format documentation&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--YQS9RuqJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2As7-nJaL8uoGnbFDVArJ7Cg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YQS9RuqJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2As7-nJaL8uoGnbFDVArJ7Cg.png" alt=""&gt;&lt;/a&gt;The command for running specs&lt;/p&gt;

&lt;h2&gt;
  
  
  CircleCI 2.1 for Continuous Integration
&lt;/h2&gt;

&lt;p&gt;Once you have created a &lt;a href="https://medium.com/@nisevi/how-to-create-a-github-repository-3990a467661e"&gt;GitHub&lt;/a&gt; repository and pushed all your changes to the cloud, your code will be able to receive contributions from all around the globe.&lt;/p&gt;

&lt;p&gt;In order to ease the way to handle contributions (from other people or your own), we can automate the tests for running every time a new branch is created, or a new commit is pushed to such a branch.&lt;/p&gt;

&lt;p&gt;Create a folder called .circleci with a configuration file inside config.yml :&lt;/p&gt;

&lt;p&gt;&lt;code&gt;mkdir .circleci&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;touch .circleci/config.yml&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;And inside this configuration file copy the following lines:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;Once you have pushed these changes to your GitHub repository. And added the project to CircleCI, your tests will be running every time a contribution is made. You can take a look &lt;a href="https://circleci.com/gh/nisevi/thanoscase"&gt;here&lt;/a&gt; for seeing how the specs were run.&lt;/p&gt;

&lt;h2&gt;
  
  
  Links of interest
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://guides.rubygems.org/"&gt;RubyGems Guides&lt;/a&gt;;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/nisevi/thanoscase"&gt;Source code for&lt;/a&gt;&lt;a href="https://github.com/nisevi/thanoscase"&gt;thanoscase gem&lt;/a&gt;;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://circleci.com/docs/2.0/caching/"&gt;CircleCI Caching Dependencies&lt;/a&gt;;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://rspec.info/"&gt;RSpec main site&lt;/a&gt;;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://circleci.com/docs/2.0/workflows/"&gt;Using Workflows to Schedule Jobs&lt;/a&gt;;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://discuss.circleci.com/t/circleci-2-1-config-overview/26057"&gt;CircleCI 2.1 Config Overview&lt;/a&gt;;&lt;/li&gt;
&lt;li&gt;
&lt;a href="http://therubyway.io/"&gt;The Ruby Way. Third Edition&lt;/a&gt;;&lt;/li&gt;
&lt;/ul&gt;




</description>
      <category>tech</category>
      <category>ruby</category>
      <category>rails</category>
      <category>webdev</category>
    </item>
    <item>
      <title>The Sieve of Eratosthenes</title>
      <dc:creator>Nicolas Sebastian Vidal</dc:creator>
      <pubDate>Fri, 27 Apr 2018 11:48:54 +0000</pubDate>
      <link>https://dev.to/nisevi/the-sieve-of-eratosthenes-528f</link>
      <guid>https://dev.to/nisevi/the-sieve-of-eratosthenes-528f</guid>
      <description>&lt;p&gt;Generating a multiplication table with the first N prime numbers.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://cdn-images-1.medium.com/max/1024/1*MWlNEtcGTEDid6GDTVtPDQ.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://cdn-images-1.medium.com/max/1024/1*MWlNEtcGTEDid6GDTVtPDQ.jpeg" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Introduction
&lt;/h3&gt;

&lt;p&gt;This post is for walking you through the steps I have taken for creating a command line tool for printing out a multiplication table of the first N prime numbers. The result is a gem called &lt;a href="https://rubygems.org/gems/primes_table"&gt;primes_table&lt;/a&gt; and for the related code, you can take a look to this &lt;a href="https://github.com/nisevi/primes_table"&gt;repository&lt;/a&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  Stack:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/davetron5000/methadone"&gt;Methadone&lt;/a&gt; an awesome project for creating command-line tools;&lt;/li&gt;
&lt;li&gt;Ruby version 2.5.0;&lt;/li&gt;
&lt;li&gt;
&lt;a href="http://rspec.info"&gt;RSpec&lt;/a&gt; as a testing framework;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/colszowka/simplecov"&gt;Simplecov&lt;/a&gt; for code coverage;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://codeclimate.com/github/nisevi/primes_table"&gt;CodeClimate&lt;/a&gt; for engineering process insights and automated code review;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://semaphoreci.com/nisevi/primes_table"&gt;SemaphoreCI&lt;/a&gt; for continuous integration;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Input
&lt;/h4&gt;

&lt;p&gt;The command line tool will receive two parameters &lt;code&gt;rows&lt;/code&gt; and &lt;code&gt;columns&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Specifications:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;By default the table will be generated as a matrix of 10X10;&lt;/li&gt;
&lt;li&gt;Only values greater or equal than 10 will be considered for specifying rows or columns;&lt;/li&gt;
&lt;li&gt;If you enter a value minor than 10, it will default to 10;&lt;/li&gt;
&lt;li&gt;Only integer values are considered. For example, if you enter a string, it will be converted to an integer, the result will be 0 (zero) and will default to 10 because zero is minor than 10;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Output
&lt;/h4&gt;

&lt;p&gt;A multiplication table with the first N prime numbers. The first row and column are the respective prime numbers.&lt;/p&gt;

&lt;p&gt;For example, the default output will have as the first column, the first prime numbers until number 10. This means numbers 2, 3, 5 and 7. The same with the first row. The following image should help you visualize the desired output:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://cdn-images-1.medium.com/max/550/1*0x282WdYJKF9rBUsyH7DSA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://cdn-images-1.medium.com/max/550/1*0x282WdYJKF9rBUsyH7DSA.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Creating the gem
&lt;/h3&gt;

&lt;p&gt;With methadone installed you just need to run:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;methadone --readme --rspec --license apache primes\_table&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;That command will generate the skeleton of your command line tool.&lt;/p&gt;

&lt;p&gt;I have created an extra couple of options to add to the ones already included when you create the project. After that, all the options are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;-h, --help&lt;/code&gt; to see the available options;&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-r, --rows ROWS&lt;/code&gt; to specify how many rows;&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-c, --columns COLUMNS&lt;/code&gt; to specify how many columns;&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;--version&lt;/code&gt; it will give you the version of the gem you are using;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The following code handles the case where no options are entered. The default option is always going to be 10 for &lt;code&gt;rows&lt;/code&gt; and &lt;code&gt;columns&lt;/code&gt;.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;  &lt;/div&gt;

&lt;h3&gt;
  
  
  Naive approach
&lt;/h3&gt;

&lt;p&gt;The first approach was to loop over each number from 2 to N. This means that per each number I was iterating over it in order to check whether there was not another divisor than himself.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;  &lt;/div&gt;

&lt;p&gt;On the other hand, we have the &lt;code&gt;Matrix&lt;/code&gt; class with a private method called &lt;code&gt;header&lt;/code&gt; that returns the list of primes numbers I want, until the given N.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;  &lt;/div&gt;

&lt;h3&gt;
  
  
  Making improvements
&lt;/h3&gt;

&lt;p&gt;Once I got that working, I thought that it has to be a better approach to solving it. I'm iterating from 2 to N and over that list of numbers, I'm iterating again form 2 to N[i] checking for primality. So I checked in one of the books I have entitled &lt;strong&gt;Cracking the Coding Interview&lt;/strong&gt; and there it was. Two improvements that can be done.&lt;/p&gt;

&lt;p&gt;The first improvement was to iterate not from 2 to N[i] but to the square root of this number. So the code will look something like this:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;  &lt;/div&gt;

&lt;p&gt;The sqrt(n) is sufficient because for every number a which divides n evenly, there is a complement b , where a * b = n . If a &amp;gt; sqrt(n) , then b &amp;lt; sqrt(n) (since (sqrt(n))**2 = n). We, therefore, don't need to check n 's primality, since we would have already checked with b .&lt;/p&gt;

&lt;p&gt;The next improvement is to implement &lt;a href="https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes"&gt;&lt;strong&gt;The Sieve of Eratosthenes&lt;/strong&gt;&lt;/a&gt;. This is a highly efficient way to generate a list of primes. It works by recognizing all non-prime numbers are divisible by a prime number.&lt;/p&gt;

&lt;p&gt;We start with a list of all numbers up through some maximum value. First, we &lt;strong&gt;cross off&lt;/strong&gt; all numbers divisible by 2. Then, look for the &lt;strong&gt;next prime&lt;/strong&gt; (the next non-crossed off number) and cross off all numbers divisible by it. By crossing off all numbers divisible by 2, 3, 5, 7, 11, and so on, we wind up with a list of prime numbers from 2 through a maximum.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;  &lt;/div&gt;

&lt;p&gt;As you can see the method &lt;code&gt;header&lt;/code&gt; calls &lt;code&gt;process\_flags&lt;/code&gt; at the end. This is not part of &lt;strong&gt;The Sieve of Eratosthenes&lt;/strong&gt; calculations since we are using it only to get the primes numbers based on the flags we have:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;  &lt;/div&gt;

&lt;p&gt;At the end our class Matrix will look something like this:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;  &lt;/div&gt;

&lt;p&gt;A couple of things to notice here is that I'm not using the class Prime anymore. I have taken this decision because the actions I want to perform are related to the Matrix itself and at the moment I don't really see the need for spreading the logic into another class. In the future, if the project grows in some way, I could evaluate how to scale it. But at the moment, I don't have enough information to do it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Notes
&lt;/h3&gt;

&lt;p&gt;As I mentioned at the beginning of this post, all code is Open Source and it can be found in this &lt;a href="https://github.com/nisevi/primes_table"&gt;repository&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you think that I should have taken a different approach or maybe you have a couple of ideas that you would like to implement, don’t doubt it and make a PR right away ☺.&lt;/p&gt;

&lt;p&gt;One thing to notice is that right now I’m calculating the list of prime numbers for both, rows and columns. I think this could be improved. If rows are equal to columns it should be enough with calculating the list of primes only once.&lt;/p&gt;

&lt;p&gt;Another improvement could be to only calculate the list of primes of the biggest number that was entered as row or column. In the process of calculating the list of prime numbers for the biggest number entered, we should be able to collect the prime numbers for the minor value as well.&lt;/p&gt;




</description>
      <category>primenumbers</category>
      <category>methadone</category>
      <category>rubygems</category>
      <category>ruby</category>
    </item>
    <item>
      <title>Markdown files as static content</title>
      <dc:creator>Nicolas Sebastian Vidal</dc:creator>
      <pubDate>Sun, 15 Apr 2018 12:26:01 +0000</pubDate>
      <link>https://dev.to/nisevi/markdown-files-as-static-content-320m</link>
      <guid>https://dev.to/nisevi/markdown-files-as-static-content-320m</guid>
      <description>&lt;p&gt;How to use markdown files from a GitHub repository as static content in your website?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://cdn-images-1.medium.com/max/1024/1*Trx5kyF44KU7WqS8kDRCTA.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://cdn-images-1.medium.com/max/1024/1*Trx5kyF44KU7WqS8kDRCTA.jpeg" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Context
&lt;/h3&gt;

&lt;p&gt;We will be talking about a feature implemented on &lt;a href="https://www.agileventures.org"&gt;Agile Ventures&lt;/a&gt; that allow us to use markdown files as static content of the website. This idea was born when thinking about how to let developers contribute to the content of the site in an easier way while taking advantage of the GitHub ecosystem.&lt;/p&gt;

&lt;p&gt;What we were using for editing the static content on the website was the &lt;a href="https://github.com/jejacks0n/mercury"&gt;mercury&lt;/a&gt; editor. But the problem with that editor is that has fallen out of maintenance. I have done a couple &lt;a href="https://github.com/AgileVentures/mercury/commits/master"&gt;changes&lt;/a&gt; to that gem in order to make it work with rails 5. We are now using a custom version in a &lt;a href="https://github.com/AgileVentures/mercury"&gt;forked repository&lt;/a&gt;, but that is another story ;).&lt;/p&gt;

&lt;p&gt;As the main goal, we want to get rid of that editor from our system. So, we have started from removing the functionality that involves &lt;strong&gt;static pages&lt;/strong&gt;, for, later on, remove it from the &lt;strong&gt;projects&lt;/strong&gt; as well. All the code related to the changes I have done in order to implement this feature can be found &lt;a href="https://github.com/AgileVentures/WebsiteOne/pull/2252"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Preparations
&lt;/h3&gt;

&lt;p&gt;We need the repository from where we want to pull the content. Currently, our static pages live in this &lt;a href="https://github.com/AgileVentures/AgileVentures"&gt;repository&lt;/a&gt; and we are pulling data from the root path, and working only with the markdown files.&lt;/p&gt;

&lt;p&gt;The application is making requests to the &lt;a href="https://developer.github.com/v3/"&gt;GitHub API&lt;/a&gt; by using the &lt;a href="https://github.com/octokit/octokit.rb"&gt;octokit&lt;/a&gt; gem. So, we need to have the &lt;em&gt;octokit&lt;/em&gt; gem in our Gemfile:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;gem 'octokit', '~\&amp;gt; 4.8'&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;And the &lt;a href="https://github.com/gettalong/kramdown"&gt;kramdown&lt;/a&gt; gem is being used for converting the markdown content into HTML. For adding the &lt;em&gt;kramdown&lt;/em&gt; gem to the Gemfile:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;gem 'kramdown', '~\&amp;gt; 1.16', '\&amp;gt;= 1.16.2'&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Creating the service
&lt;/h3&gt;

&lt;p&gt;As we will be using the &lt;em&gt;kramdown&lt;/em&gt; gem for converting the content in a markdown file into HTML, we need to isolate the gem behavior. For doing this, we are going to create a class that will serve as a wrapper for the &lt;em&gt;kramdown&lt;/em&gt; functionality.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;  &lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;The path to changeable and maintainable object-oriented software begins with classes that have a single responsibility. Classes that do one thing isolate that thing from the rest of your application. This isolation allows change without consequence and reuses without duplication.&lt;/p&gt;

&lt;p&gt;Sandi Metz.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Crafting the rake task
&lt;/h3&gt;

&lt;p&gt;Now we need to create the rake task that is gonna be scheduled by using the &lt;a href="https://devcenter.heroku.com/articles/scheduler"&gt;Heroku Scheduler&lt;/a&gt; add-on. It will look something like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://cdn-images-1.medium.com/max/750/1*gwhLTDPsj7vBpZP-i7A4JA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://cdn-images-1.medium.com/max/750/1*gwhLTDPsj7vBpZP-i7A4JA.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I have created this rake task by following the code styles that the project is already implementing in order to preserve consistency within the system. So this rake task will call the logic that resides in the GithubStaticPages module.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;  &lt;/div&gt;

&lt;p&gt;The following code is the logic that we are using for pulling the content from markdown files, convert it to HTML and save it using the StaticPages model. This means that all HTML code related to a particular static content lives in the database.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;  &lt;/div&gt;

&lt;h3&gt;
  
  
  Rendering the content
&lt;/h3&gt;

&lt;p&gt;Since we have to change the way we CRUD static pages on the system, and we now will be using the GitHub ecosystem for doing it, there is no change to be implemented in the way we get the content from the database. The only difference is that now we have been able to remove the actions that were tightly coupled to the mercury editor.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;  &lt;/div&gt;

&lt;p&gt;Finally, we just get the HTML from the body attribute in the page object.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;  &lt;/div&gt;

&lt;h3&gt;
  
  
  What's next?
&lt;/h3&gt;

&lt;p&gt;Instead of having this rake task running daily within our system, we could be using &lt;a href="https://developer.github.com/webhooks/"&gt;GitHub Webhooks&lt;/a&gt; for achieving the same goal. But for doing this, we need first to create the functionality within our system that will handle those requests.&lt;/p&gt;

&lt;p&gt;Talking about priorities, I will keep working on the removal of the mercury editor from the system since that is the general goal. Once removed, with the AV (Agile Ventures) team, we will decide what to do next. I'll keep you posted;)!&lt;/p&gt;

&lt;h3&gt;
  
  
  Notes
&lt;/h3&gt;

&lt;p&gt;Something that it worth to mention is that this feature only creates and updates the static pages on the database. It doesn't remove pages that no longer exist in the repository from where we pull the content. This was a decision that we discussed within the team to be implemented in this way.&lt;/p&gt;

&lt;p&gt;All code shared here is Open Source and you will find it in the &lt;a href="https://github.com/AgileVentures/WebsiteOne"&gt;WebsiteOne&lt;/a&gt; repository. If you want to contribute to the code, even if it is a small change where you are thinking "this could have been done in this other way". I invite you to create a pull request. It doesn't matter how small the change is, it will help us to improve and make our code better, while you will be contributing to an Open Source project ;).&lt;/p&gt;




</description>
      <category>ruby</category>
      <category>rails</category>
      <category>octokit</category>
      <category>staticsite</category>
    </item>
    <item>
      <title>How to create a GitHub repository?</title>
      <dc:creator>Nicolas Sebastian Vidal</dc:creator>
      <pubDate>Mon, 12 Feb 2018 13:20:03 +0000</pubDate>
      <link>https://dev.to/nisevi/how-to-create-a-github-repository-3o1j</link>
      <guid>https://dev.to/nisevi/how-to-create-a-github-repository-3o1j</guid>
      <description>&lt;p&gt;A simple guide to get you started with GitHub.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://cdn-images-1.medium.com/max/1024/1*I_VX8P2sOhU83ijUtbRY5g.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://cdn-images-1.medium.com/max/1024/1*I_VX8P2sOhU83ijUtbRY5g.jpeg" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Context
&lt;/h3&gt;

&lt;p&gt;This blog will walk you through the different steps you need in order to have your GitHub account setup and ready for creating amazing things :)! We will set up the SSH key and also the GPG key for having signed commits. The operative system that I will be using is Linux, distribution &lt;a href="https://www.ubuntu.com/download/desktop"&gt;Ubuntu 16.04.3 LTS&lt;/a&gt;. If you are using Windows or MAC, you can follow this post as a guide but the respective commands for your operative system will be slightly different. You can post on the comments so I can help you. We will &lt;a href="https://git-scm.com"&gt;install GIT&lt;/a&gt; and push our first signed commit.&lt;/p&gt;

&lt;h3&gt;
  
  
  Creating a GitHub account
&lt;/h3&gt;

&lt;p&gt;First, you just need to go &lt;a href="https://github.com"&gt;here&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://cdn-images-1.medium.com/max/930/1*LLAC5eTXNfEAg8Qgkwnjdg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://cdn-images-1.medium.com/max/930/1*LLAC5eTXNfEAg8Qgkwnjdg.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Complete the form with the requested info, and you will have your account created immediately. It will look something like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://cdn-images-1.medium.com/max/905/1*jCDIMrrMIFtDj47gRoZObA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://cdn-images-1.medium.com/max/905/1*jCDIMrrMIFtDj47gRoZObA.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Creating your first repository
&lt;/h3&gt;

&lt;p&gt;Notice that you have different tabs in your profile view: &lt;code&gt;Overview&lt;/code&gt;, &lt;code&gt;Repositories&lt;/code&gt;, &lt;code&gt;Stars&lt;/code&gt;, &lt;code&gt;Followers&lt;/code&gt;, and &lt;code&gt;Following&lt;/code&gt;. One of our interest is &lt;code&gt;Repositories&lt;/code&gt;, click there :D!&lt;/p&gt;

&lt;p&gt;It will appear a view with the new button in it, click it:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://cdn-images-1.medium.com/max/686/1*mdlbWciucIkLoTMOTIXz5w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://cdn-images-1.medium.com/max/686/1*mdlbWciucIkLoTMOTIXz5w.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After that you will be presented with the following form:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://cdn-images-1.medium.com/max/687/1*dOI3QnLE1Q-ieEqt5-mvQw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://cdn-images-1.medium.com/max/687/1*dOI3QnLE1Q-ieEqt5-mvQw.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Notice that I completed the &lt;code&gt;Repository name&lt;/code&gt;, I added a little &lt;code&gt;Description&lt;/code&gt; and I clicked &lt;code&gt;Initialize this repository with a README&lt;/code&gt;. This last step is important since we will be creating a repository with a file in it and it is different from when we create an empty repository (we will cover the empty repository later).&lt;/p&gt;

&lt;p&gt;Regarding the name of the repository, I always use &lt;code&gt;downcase&lt;/code&gt; only or combined with &lt;code&gt;_&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Once you created the repository by hitting the button &lt;code&gt;Create repository&lt;/code&gt; you will see something like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://cdn-images-1.medium.com/max/911/1*bk2z061_F003nViAlanyEA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://cdn-images-1.medium.com/max/911/1*bk2z061_F003nViAlanyEA.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A couple of things to notice here since we are gonna configure the SSH key and the GPG key, we will clone the repository with the Clone with SSH option.&lt;/p&gt;

&lt;h3&gt;
  
  
  GIT installation
&lt;/h3&gt;

&lt;p&gt;Now, if we want to work locally (meaning with our computer) with the repository we just created, we will need to install GIT.&lt;/p&gt;

&lt;p&gt;Open a console &lt;code&gt;Ctrl+T&lt;/code&gt; or go your programs an click the &lt;code&gt;Terminal&lt;/code&gt; icon:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://cdn-images-1.medium.com/max/566/1*6UqeDEt-szNQkXXm9YUU1A.png" class="article-body-image-wrapper"&gt;&lt;img src="https://cdn-images-1.medium.com/max/566/1*6UqeDEt-szNQkXXm9YUU1A.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once you are with the opened terminal, write the following command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sudo apt-get update&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This will update your local package index.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://cdn-images-1.medium.com/max/619/1*2LqpZ8woEjd126WAw23gQg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://cdn-images-1.medium.com/max/619/1*2LqpZ8woEjd126WAw23gQg.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now we will proceed to &lt;a href="https://git-scm.com"&gt;install GIT&lt;/a&gt; with:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sudo apt-get install git&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://cdn-images-1.medium.com/max/976/1*d7PQw5c1emPxF0OkvamBog.png" class="article-body-image-wrapper"&gt;&lt;img src="https://cdn-images-1.medium.com/max/976/1*d7PQw5c1emPxF0OkvamBog.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We also need to tell GIT who we are, and for that, we are going to set up our &lt;code&gt;name&lt;/code&gt; and &lt;code&gt;email&lt;/code&gt; with the following commands:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git config --global user.name "Nicolas Sebastian Vidal"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git config --global user.email "nicolas.s.vidal@gmail.com"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://cdn-images-1.medium.com/max/880/1*ds2WQFBY1YmnZqt_GzLDhw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://cdn-images-1.medium.com/max/880/1*ds2WQFBY1YmnZqt_GzLDhw.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Of course, where I have put my name it will go yours and the same with the email :).&lt;/p&gt;

&lt;h3&gt;
  
  
  Configuring your SSH key
&lt;/h3&gt;

&lt;p&gt;Before cloning our repository, and in order to be able to commit and push our changes to the GitHub repository, first, we need to generate our SSH key.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open a console &lt;code&gt;Ctrl+T&lt;/code&gt; or go your programs an click the &lt;code&gt;Terminal&lt;/code&gt; icon;&lt;/li&gt;
&lt;li&gt;Paste the text below, substituting in your GitHub email address.
&lt;code&gt;ssh-keygen -t rsa -b 4096 -C "your\_email@example.com"&lt;/code&gt;
This creates a new ssh key using the provided email as a label.
&lt;code&gt;Generating a public/private rsa key pair.&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;When you’re prompted to "Enter a file in which to save the key", press &lt;code&gt;Enter&lt;/code&gt;. This accepts the default file location.
&lt;code&gt;Enter a file in which to save the key (/home/you/.ssh/id\_rsa):[Press enter]&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;At the prompt, type a secure passphrase. I encourage you to type a passphrase and not to leave it empty since it will give you more security.
&lt;code&gt;Enter passphrase (empty for no passphrase): [Type a passphrase]&lt;/code&gt;
&lt;code&gt;Enter same passphrase again: [Type passphrase again]&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://cdn-images-1.medium.com/max/695/1*dvb6brlY9y_V3ig-nlH5cg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://cdn-images-1.medium.com/max/695/1*dvb6brlY9y_V3ig-nlH5cg.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Start the ssh-agent in the background.&lt;/li&gt;
&lt;li&gt;Add your SSH private key to the ssh-agent. If you created your key with a different name, or if you are adding an existing key that has a different name, replace &lt;em&gt;id_rsa&lt;/em&gt; in the command with the name of your private key file.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://cdn-images-1.medium.com/max/613/1*aUYwWGNkEWO46D0uGPA1tw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://cdn-images-1.medium.com/max/613/1*aUYwWGNkEWO46D0uGPA1tw.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;These last two steps are for not entering the passphrase &lt;a href="https://stackoverflow.com/questions/10032461/git-keeps-asking-me-for-my-ssh-key-passphrase"&gt;every time&lt;/a&gt; you want to push your changes to your repository.&lt;/p&gt;

&lt;p&gt;These mentioned steps can be found also &lt;a href="https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  Adding the SSH key to your GitHub account
&lt;/h4&gt;

&lt;p&gt;While being in your terminal, write the following command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;cat ~/.ssh/id\_rsa&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This command will show you your SSH public key:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://cdn-images-1.medium.com/max/1024/1*EuHWXhvBHmrdaILJxtpF6A.png" class="article-body-image-wrapper"&gt;&lt;img src="https://cdn-images-1.medium.com/max/1024/1*EuHWXhvBHmrdaILJxtpF6A.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Copy this key from &lt;code&gt;ssh-rsa&lt;/code&gt; to your email &lt;code&gt;nicolas.s.vidal@gmail.com&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Now we need to go to our GitHub profile, and click &lt;code&gt;Settings&lt;/code&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://cdn-images-1.medium.com/max/953/1*nlE2crDHwdIRcdxZ9tgWmA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://cdn-images-1.medium.com/max/953/1*nlE2crDHwdIRcdxZ9tgWmA.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once you are there click the option that says &lt;code&gt;SSH and GPG keys&lt;/code&gt;, click &lt;code&gt;New SSH key&lt;/code&gt; after that, it will appear a form where we will paste our &lt;code&gt;SSH key&lt;/code&gt;, add also a title to identify the machine that it will be using the mentioned key:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://cdn-images-1.medium.com/max/908/1*g05Qq5ly67Hfna27f2OopA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://cdn-images-1.medium.com/max/908/1*g05Qq5ly67Hfna27f2OopA.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Press &lt;code&gt;Add SSH key&lt;/code&gt; and finally our key it will be configured to be used:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://cdn-images-1.medium.com/max/649/1*eVly3rsNk7zmDbtzCAIWkg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://cdn-images-1.medium.com/max/649/1*eVly3rsNk7zmDbtzCAIWkg.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Configuring your GPG key
&lt;/h3&gt;

&lt;p&gt;If you want to have all your commits signed, follow these steps. Otherwise, you can completely avoid this.&lt;/p&gt;

&lt;p&gt;Back in your terminal type the following command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;gpg --gen-key&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Some options will appear, here the detail of each of them and the usual configuration that I use:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;Please select what kind of key you want&lt;/code&gt; I use the default option &lt;code&gt;RSA and RSA&lt;/code&gt;;&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;What keysize do you want?(20148)&lt;/code&gt; here you will see that I selected "2048", however, I only selected the default option because I'm using a virtual machine and it is kind of troublesome to generate the necessary entropy for getting all the needed bytes. I always go with 4096 as it is the recommended key size.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Key is valid for?(0)&lt;/code&gt; for this example, I have chosen that the key should not expire but what I always change the GPG key every month :D!&lt;/li&gt;
&lt;li&gt;The next step will be to set up your &lt;code&gt;Real name&lt;/code&gt;, &lt;code&gt;Email address&lt;/code&gt; and &lt;code&gt;Comment&lt;/code&gt;, this last one I use it to put my username :P!&lt;/li&gt;
&lt;li&gt;The last step, you will have to generate enough entropy for getting the needed bytes, so for this, you will have to start doing some work on your computer. you could start moving your mouse like crazy (that works for me), also typing on a text editor a lot of random characters. One thing, do it fast!.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://cdn-images-1.medium.com/max/496/1*aHsr4B0cOJKy8-tT8845kw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://cdn-images-1.medium.com/max/496/1*aHsr4B0cOJKy8-tT8845kw.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once we have generated our GPG key we still need to add it to our GitHub account, the following steps need to follow:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use the &lt;code&gt;gpg --list-secret-keys --keyid-format LONG&lt;/code&gt; command to list GPG keys for which you have both a public and private key. A private key is required for signing commits or tags:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://cdn-images-1.medium.com/max/806/1*7NHBEU7WaVSK3uYSHP6C_A.png" class="article-body-image-wrapper"&gt;&lt;img src="https://cdn-images-1.medium.com/max/806/1*7NHBEU7WaVSK3uYSHP6C_A.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;From the list of GPG keys, copy the GPG key ID you’d like to use. In this example, the GPG key ID is 77384044A63D6CFF ;&lt;/li&gt;
&lt;li&gt;Configure Git on your machine for using this GPG key to sign your commits: &lt;code&gt;git config user.signingkey 77384044A63D6CFF&lt;/code&gt;;&lt;/li&gt;
&lt;li&gt;Paste the text below, substituting in the GPG key ID you’d like to use. In this example, the GPG key ID is &lt;code&gt;77384044A63D6CFF&lt;/code&gt;:
&lt;code&gt;gpg --armor --export 77384044A63D6CFF&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://cdn-images-1.medium.com/max/690/1*IIerOEvTL-gkIfRrEGfUJA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://cdn-images-1.medium.com/max/690/1*IIerOEvTL-gkIfRrEGfUJA.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Copy your GPG key, beginning with &lt;code&gt;-----BEGIN PGP PUBLIC KEY BLOCK-----&lt;/code&gt; and ending with &lt;code&gt;-----END PGP PUBLIC KEY BLOCK-----&lt;/code&gt;;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Adding the GPG key to your GitHub account
&lt;/h4&gt;

&lt;p&gt;Once again as we did with the &lt;code&gt;SSH&lt;/code&gt; key, you need to go to your GitHub profile and click on the &lt;code&gt;Settings&lt;/code&gt; option.&lt;/p&gt;

&lt;p&gt;Once you are there, click the option that says &lt;code&gt;SSH and GPG keys&lt;/code&gt; and click &lt;code&gt;New GPG key&lt;/code&gt;, a form will appear where we will paste it:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://cdn-images-1.medium.com/max/925/1*T9HjK9g610CkrkwFaJMcgw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://cdn-images-1.medium.com/max/925/1*T9HjK9g610CkrkwFaJMcgw.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Press &lt;code&gt;Add GPG key&lt;/code&gt; and finally our key it will be configured to be used:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://cdn-images-1.medium.com/max/650/1*2CXhH7vivn8U6d-PYfB5cg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://cdn-images-1.medium.com/max/650/1*2CXhH7vivn8U6d-PYfB5cg.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The steps that I have mentioned to generate a GPG key can also be found &lt;a href="https://help.github.com/articles/generating-a-new-gpg-key/"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Cloning our repository
&lt;/h3&gt;

&lt;p&gt;Back in our terminal, we will go to &lt;code&gt;Documents&lt;/code&gt; and there we will clone our GitHub repository:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://cdn-images-1.medium.com/max/917/1*HAx0uyCxjB7i6uJtH9QWdQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://cdn-images-1.medium.com/max/917/1*HAx0uyCxjB7i6uJtH9QWdQ.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We will clone our repository by using SSH, so our command line would look something like this:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git clone git@github.com:nisevi/staticwebsite.git&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://cdn-images-1.medium.com/max/807/1*JbPG84fmsM8_O1DpmPHUPg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://cdn-images-1.medium.com/max/807/1*JbPG84fmsM8_O1DpmPHUPg.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It will ask us if we want to continue since the authenticity of the host github.com can't be established, but! as we trust GitHub we will say &lt;code&gt;yes&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;After that, you will have the repository cloned within the &lt;code&gt;Documents&lt;/code&gt; folder, and you will find the &lt;code&gt;README.md&lt;/code&gt; file that we have selected for initializing our repository:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://cdn-images-1.medium.com/max/498/1*enGtVdDUobQfmrVfCWvWpw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://cdn-images-1.medium.com/max/498/1*enGtVdDUobQfmrVfCWvWpw.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Pushing your first commit
&lt;/h3&gt;

&lt;p&gt;In order to create a commit, first we need to generate some changes to the files that we have in our repository, otherwise, we won't have anything to commit.&lt;/p&gt;

&lt;p&gt;In order to check the status of the files and see if any of them has changed, we will use the following command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git status&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://cdn-images-1.medium.com/max/449/1*n9e75Hko8MrPWjzLH5Y4kA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://cdn-images-1.medium.com/max/449/1*n9e75Hko8MrPWjzLH5Y4kA.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is the actual content of the &lt;code&gt;README.md&lt;/code&gt; file:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://cdn-images-1.medium.com/max/475/1*05xZhy2t8TOyEV-MhrukZQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://cdn-images-1.medium.com/max/475/1*05xZhy2t8TOyEV-MhrukZQ.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After the modification, we can see that our file was changed by typing the following command again:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git status&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://cdn-images-1.medium.com/max/685/1*L44WlVIx_FFyLCfQKZqZVA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://cdn-images-1.medium.com/max/685/1*L44WlVIx_FFyLCfQKZqZVA.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And we can take a look at the changes we have done with the following command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git diff&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://cdn-images-1.medium.com/max/431/1*NmnEtFI72q8M24pdKt3bHw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://cdn-images-1.medium.com/max/431/1*NmnEtFI72q8M24pdKt3bHw.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As we can see &lt;code&gt;Static website&lt;/code&gt;. has been deleted, space has been added, and &lt;code&gt;Hello World.&lt;/code&gt; was written.&lt;/p&gt;

&lt;p&gt;Now, we will add this file to our commit by doing:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git add README.md&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;After running this command, we will be able to see that our changes have been added to the commit we want to create. We can check this by doing:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git status&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://cdn-images-1.medium.com/max/450/1*FvyzTNl8HIMVE_Vag1c0PA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://cdn-images-1.medium.com/max/450/1*FvyzTNl8HIMVE_Vag1c0PA.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Our next step is to create a signed commit with a proper message about the changes we have done to the file. Please notice that here you will be asked to type the passphrase you used when creating your &lt;code&gt;GPG key&lt;/code&gt; (if you have skipped that section you won't need to use the &lt;code&gt;-S&lt;/code&gt; flag):&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git commit -S -m "Update README.md"&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;-S&lt;/code&gt; flag is for signing our commit;&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-m&lt;/code&gt; flag is for the message we want to write;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once the commit has been created we will proceed to push our changes :D !!&lt;/p&gt;

&lt;p&gt;Type the following command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git push origin master&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://cdn-images-1.medium.com/max/555/1*O5yKS-IoB9z7NXPfZMcfwg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://cdn-images-1.medium.com/max/555/1*O5yKS-IoB9z7NXPfZMcfwg.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Done!!! we have pushed our changes. If you want to see them, go back to your GitHub repository. You will see that the &lt;code&gt;README.md&lt;/code&gt; file has changed and if you want to know if your commit has been signed click where it says &lt;code&gt;2 commits&lt;/code&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://cdn-images-1.medium.com/max/1005/1*8N1EWKRbgA-arRCtEWypgg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://cdn-images-1.medium.com/max/1005/1*8N1EWKRbgA-arRCtEWypgg.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the following view, you will find the commit that we just did with the comment we have added; the green label that says Verified means that our &lt;code&gt;commit&lt;/code&gt; has been signed :D!!!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://cdn-images-1.medium.com/max/1017/1*b-hiw42dSgKnO7G2v7m9GQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://cdn-images-1.medium.com/max/1017/1*b-hiw42dSgKnO7G2v7m9GQ.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Something to notice here is that I have already a signed commit that says &lt;code&gt;Initial commit&lt;/code&gt;. This commit was created when we decided to initialize our repository with a &lt;code&gt;README;&lt;/code&gt; for me is signed or &lt;code&gt;Verified&lt;/code&gt; because I already have other &lt;code&gt;GPG key&lt;/code&gt; and &lt;code&gt;SSH key&lt;/code&gt; working on my laptop. What it matters is the commit that you just pushed :)!&lt;/p&gt;

&lt;p&gt;This post ends here.&lt;/p&gt;

&lt;p&gt;What you will find next are some alternatives to things that I have done in this tutorial. I hope you have enjoyed it!!&lt;/p&gt;

&lt;h3&gt;
  
  
  Creating an empty repository
&lt;/h3&gt;

&lt;p&gt;If you decided to create an empty repository, you will be presented with different options. Here, we will walk through the steps for having this repository cloned and working on your computer.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://cdn-images-1.medium.com/max/1018/1*23glSrCbPISp-YyhOlFq3w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://cdn-images-1.medium.com/max/1018/1*23glSrCbPISp-YyhOlFq3w.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Notice that I haven't selected the option &lt;code&gt;Initialize this repository with a README&lt;/code&gt;. After you hit &lt;code&gt;Create repository&lt;/code&gt; you will be presented with the following view:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://cdn-images-1.medium.com/max/1017/1*fQqKJYZXFvQFH51tOYR1mw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://cdn-images-1.medium.com/max/1017/1*fQqKJYZXFvQFH51tOYR1mw.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Please notice that I have selected &lt;code&gt;SSH&lt;/code&gt; as we will clone the created repository by doing:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git clone git@github.com:nisevi/staticwebsite.git&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://cdn-images-1.medium.com/max/673/1*HsKEGz4aWUgg7DRoek-zQA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://cdn-images-1.medium.com/max/673/1*HsKEGz4aWUgg7DRoek-zQA.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As we can see the repository has been cloned but there is nothing inside the folder (except the &lt;code&gt;.git&lt;/code&gt; configuration folder of the repository). At this point, you can just create any file and follow the steps we have described on &lt;code&gt;Pushing your first commit&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Cloning a repository by using HTTPS
&lt;/h3&gt;

&lt;p&gt;Other option, instead of doing all the SSH and GPG configuration for pushing commits, will be to clone the repository with HTTPS:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://cdn-images-1.medium.com/max/907/1*H5FUNT7W-egH_qduOCqKOg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://cdn-images-1.medium.com/max/907/1*H5FUNT7W-egH_qduOCqKOg.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Back in your terminal, we will clone the repository by doing:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git clone [https://github.com/nisevi/staticwebsite.git](https://github.com/nisevi/staticwebsite.git) https-staticwebsite&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The last part that I just added was only to give the folder a name, in this case &lt;code&gt;https-staticwebsite&lt;/code&gt;. I have done this because I didn't want to have conflicts with the same repository that I cloned with &lt;code&gt;SSH&lt;/code&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://cdn-images-1.medium.com/max/889/1*dFAd_wkijiRI4syILsaQ0A.png" class="article-body-image-wrapper"&gt;&lt;img src="https://cdn-images-1.medium.com/max/889/1*dFAd_wkijiRI4syILsaQ0A.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If we take a look at the folders inside &lt;code&gt;Documents&lt;/code&gt;, we will see:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://cdn-images-1.medium.com/max/602/1*q2dXKpPjiG439Zq6K-eNfA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://cdn-images-1.medium.com/max/602/1*q2dXKpPjiG439Zq6K-eNfA.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We will get inside &lt;code&gt;https-staticwebsite&lt;/code&gt; and do some changes to the &lt;code&gt;README.md&lt;/code&gt; file and create a signed commit. But! as this is another folder with another Git configuration, we will have to setup our GPG key again by doing:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git config user.signinkey 77384044A63D6CFF&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If you don't remember where this number &lt;code&gt;77384044A63D6CFF&lt;/code&gt; comes from, you might take a look back to the section where we have configured the &lt;code&gt;GPG key&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://cdn-images-1.medium.com/max/847/1*_8Wh_cr1qIRIPE3kKaQWJw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://cdn-images-1.medium.com/max/847/1*_8Wh_cr1qIRIPE3kKaQWJw.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After we have created our signed commit we will push our changes:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git push origin master&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://cdn-images-1.medium.com/max/610/1*yKjbQAi0TgsFkosoyMb7PQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://cdn-images-1.medium.com/max/610/1*yKjbQAi0TgsFkosoyMb7PQ.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Notice that by using &lt;code&gt;HTTPS&lt;/code&gt; you will always have to enter your &lt;code&gt;username&lt;/code&gt; and &lt;code&gt;password&lt;/code&gt;. In case you are using two-factor authentication instead of a &lt;code&gt;password&lt;/code&gt;, you will need to enter a &lt;code&gt;token&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  How to generate a GitHub token
&lt;/h3&gt;

&lt;p&gt;Go to your profile and click &lt;code&gt;Settings&lt;/code&gt;. After that, click &lt;code&gt;Developer settings&lt;/code&gt; and select the option that says &lt;code&gt;Personal access tokens&lt;/code&gt;, press &lt;code&gt;Generate new token&lt;/code&gt; and give it rights only for repo, as displayed here:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://cdn-images-1.medium.com/max/1002/1*tovwwChnol9YQcAYJiXRSw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://cdn-images-1.medium.com/max/1002/1*tovwwChnol9YQcAYJiXRSw.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After you press &lt;code&gt;Generate token&lt;/code&gt;, you will see the following:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://cdn-images-1.medium.com/max/1008/1*T5u4HJyRyH7MMAaZVgwY1w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://cdn-images-1.medium.com/max/1008/1*T5u4HJyRyH7MMAaZVgwY1w.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Copy the token and save it in a safe place since this is the last time you will see it here. Once copied you can use it as password if you have activated two-factor authentication and want to push commits by using &lt;code&gt;HTTPS&lt;/code&gt;.&lt;/p&gt;




</description>
      <category>git</category>
      <category>gitcommit</category>
      <category>github</category>
      <category>gitpush</category>
    </item>
  </channel>
</rss>
