<?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: Cristhian Ferreira </title>
    <description>The latest articles on DEV Community by Cristhian Ferreira  (@cferreirasuazo).</description>
    <link>https://dev.to/cferreirasuazo</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%2F49966%2Fa1e309d7-f8e4-4643-897d-de80898bf5e7.jpeg</url>
      <title>DEV Community: Cristhian Ferreira </title>
      <link>https://dev.to/cferreirasuazo</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/cferreirasuazo"/>
    <language>en</language>
    <item>
      <title>Configure your Django project for multiple stages</title>
      <dc:creator>Cristhian Ferreira </dc:creator>
      <pubDate>Sun, 11 Feb 2024 02:32:04 +0000</pubDate>
      <link>https://dev.to/cferreirasuazo/configure-your-django-project-for-multiple-stages-1haf</link>
      <guid>https://dev.to/cferreirasuazo/configure-your-django-project-for-multiple-stages-1haf</guid>
      <description>&lt;p&gt;Hey guys, In the next article I want to provide you with a step by step guide on how to configure your Django project for multiple stages. Such as local, testing and production. &lt;/p&gt;

&lt;h2&gt;
  
  
  Django Settings.
&lt;/h2&gt;

&lt;p&gt;When a Django App is created, a file project.settings is generated. This file has all the settings for running your applications including the database settings, authentication settings, third party apps, etc. By default, Django calls this file in three places, manage.py, wsgi.py and asgi.py. The last two files are used to run your app in production, while the manage.py is the main file used for running operations e.g create apps, run migrations, and other django internal commands.&lt;/p&gt;

&lt;p&gt;By default, Django calls the settings file in your project using python path syntax .e.g mysite.settings. We can create multiple files that we can use in different stages. &lt;/p&gt;

&lt;p&gt;In manage.py, wsgi.py and asgi.py uses the following line to tell which settings you want to use. Django calls the variable  DJANGO_SETTINGS_MODULE and takes the specified setting. If the variable doesn’t exist, It will use the one set by default.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'exerciselogs.settings.dev')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Create dev setting files.
&lt;/h2&gt;

&lt;p&gt;First we are going to create a new directory called settings, where our setting files will reside.  Move the default settings file to this directory then rename it to base.py. You can use any descriptive name for this file. I use base because all our setting files will inherent from this file. Next create a new file called dev.py. &lt;/p&gt;

&lt;p&gt;In the first line of the file, add&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;From .base  * 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here It’s inheriting all the settings variables and configurations from base.py. Now we can overwrite the settings variables in dev.py. In base.py leave DEBUG=FALSE now in dev.py will &lt;br&gt;
Be DEBUG = True. dev.py will be the file that Django will call by default, as our development environment. &lt;/p&gt;

&lt;p&gt;In manage.py make some changes to the os.environ.setdefault statement in order to call dev.py. It should 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;os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'exerciselogs.settings.dev')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When running python manage.py runserver you will see 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;Django version 4.2.4, using settings 'exerciselogs.settings.dev'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here Django is telling us which setting file we are using.&lt;/p&gt;

&lt;p&gt;If you access to a wrong URL in a browser you will see&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;You’re seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 404 page.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Production Setting File.
&lt;/h2&gt;

&lt;p&gt;Now we are going to configure the production setting file. &lt;/p&gt;

&lt;p&gt;Create a file called prod.py&lt;br&gt;
Add inheritance from base.py  using the previous line code.&lt;br&gt;
From base.py remove the DEBUG variable we are not going to need it here. &lt;/p&gt;

&lt;p&gt;In prod.py add&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;DEBUG = False.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In your computer create a environment variable called DJANGO_SETTINGS_MODULE and add the path syntax to prod.py&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;DJANGO_SETTINGS_MODULE=exerciselogs.settings.prod
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When running manage.py, django will tell us that we are using the prod.py&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Django version 4.2.4, using settings 'exerciselogs.settings.prod'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Open the browser, search for a non existing route and It should show you the NOT FOUND page. This tells us that the DEBUG is set to False.&lt;/p&gt;

&lt;p&gt;Here I explained how to create and prepare multiple configuration files in Django in order to have multiple configurations for different environments. I hope this article has been useful to improve the deployment of your application in Django. Any suggestion or doubt, you can write in the comments.&lt;/p&gt;

</description>
      <category>django</category>
      <category>python</category>
      <category>deployment</category>
    </item>
    <item>
      <title>Project Maintenance: A Developer's Personal Perspective.</title>
      <dc:creator>Cristhian Ferreira </dc:creator>
      <pubDate>Fri, 08 Sep 2023 11:41:51 +0000</pubDate>
      <link>https://dev.to/cferreirasuazo/project-maintenance-a-developers-personal-perspective-21oi</link>
      <guid>https://dev.to/cferreirasuazo/project-maintenance-a-developers-personal-perspective-21oi</guid>
      <description>&lt;p&gt;I'd like to share my experience with mobile app and web app maintenance, highlighting its importance for developers. I believe it's crucial to perform maintenance 2-3 times a year, and I hope my experience will help you on your development journey.&lt;/p&gt;

&lt;h2&gt;
  
  
  My Challenges with Expokit
&lt;/h2&gt;

&lt;p&gt;I want to start this article with an experience I had developing an app in React Native and Expokit. If you don’t know, Expo is a collection of tools and services that simplifies the process of building your React Native application. It provides a range of pre-built components, libraries, and services that make mobile app development faster and easier.&lt;/p&gt;

&lt;p&gt;Some years ago, there was a tool called Expokit. ExpoKit was an option within Expo ecosystem that allows you to transition to a more customizable bare workflow when you need to include custom native code or libraries. It gives you more freedom to implement custom native code. In 2020, Expo announced that it would deprecate Expokit, and users will need to migrate to Expo Bareflow.&lt;/p&gt;

&lt;p&gt;In 2022, I was working on a mobile app based on React Native, using Expokit as its foundation alongside various other React Native libraries. One day, Google removed the app from their app store for an upgrade that required some app information. I had to complete the necessary form and upload the app quickly, as it was in use by multiple users daily. To make things worse, while trying to run the app, I encountered numerous errors with Gradle.&lt;/p&gt;

&lt;p&gt;Gradle, a vital build automation tool for building, testing, and packaging Android applications, is integral to the Android app development process. It manages project dependencies, configures the build process, and compiles source code into APK (Android Package) files. Android Studio alerted me to an SDK upgrade requirement to run the application, which is when I discovered that Expokit had been deprecated.&lt;/p&gt;

&lt;p&gt;For several days, I struggled to run the app without success. I attempted upgrades for React Native, React, Gradle, Android Studio, and various other components. It was only after seeking advice from a friend experienced in the React Native ecosystem that I decided to rebuild the application. I created a new app and imported many of the components from the previous app. I also installed expo-modules-core to utilize the expo dependency modules in the new app. This involved upgrading all the modules, refactoring code, implementing new flows, and more. After a couple of weeks of effort, I finally managed to upload the application again and publish it on Google Play.&lt;/p&gt;

&lt;p&gt;I took several components and created custom ones that would extend those components, then abstracting away the implementation details. This abstraction simplifies maintenance and code reuse. This will allow you to change the implementation if there is an upgrade or you need to change it to a different component or if you need to perform any change to the implementation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Suggestions for Effective Maintenance
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Research Module Changes:&lt;/strong&gt; Begin by researching the modules you're using to identify what has changed from your current version to the latest release.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Avoid Immediate Upgrades:&lt;/strong&gt; It's wise to refrain from upgrading to the very latest version immediately. Allow some time for the current version of the module, library, or package to be in circulation, as this ensures that different patches and fixes have been released.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Read Documentation:&lt;/strong&gt; Always take the time to read the documentation for the new version or upgrade. It provides valuable insights into what has changed, deprecated, or will be removed in the next release.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Abstract the Libraries:&lt;/strong&gt; In the case of React Native, I was using MaterialUI as a component library and other types of libraries to use in the project. It is a good practice to abstract their logic so that the business logic of your project does not get mixed up with it. This separation can lead to cleaner and more maintainable code.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Today, I strongly recommend performing regular maintenance after developing an application. Periodic maintenance ensures your app stays current with the latest framework and library updates. It's also beneficial in case your hosting provider, such as an app store or a cloud service like Heroku, updates its policies.&lt;/p&gt;

</description>
      <category>softwaredevelopment</category>
      <category>reactnative</category>
      <category>developmentchallenges</category>
      <category>maintenance</category>
    </item>
    <item>
      <title>AWS Certification Journey: Preparing for the AWS CCP Exam</title>
      <dc:creator>Cristhian Ferreira </dc:creator>
      <pubDate>Wed, 26 Jul 2023 02:29:27 +0000</pubDate>
      <link>https://dev.to/cferreirasuazo/aws-certification-journey-preparing-for-the-aws-ccp-exam-4bpk</link>
      <guid>https://dev.to/cferreirasuazo/aws-certification-journey-preparing-for-the-aws-ccp-exam-4bpk</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Athn_-v6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://images.unsplash.com/photo-1501504905252-473c47e087f8%3Fixlib%3Drb-4.0.3%26ixid%3DM3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%253D%253D%26auto%3Dformat%26fit%3Dcrop%26w%3D3174%26q%3D80" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Athn_-v6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://images.unsplash.com/photo-1501504905252-473c47e087f8%3Fixlib%3Drb-4.0.3%26ixid%3DM3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%253D%253D%26auto%3Dformat%26fit%3Dcrop%26w%3D3174%26q%3D80" alt="MacBook Pro near white open book" title="By Nick Morrison" width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hello mates, &lt;/p&gt;

&lt;p&gt;I want to share my journey of becoming an AWS Certified Cloud Practitioner with all of you. A certification can open up opportunities, and I hope my experience can inspire and guide others on their path to Cloud success.&lt;/p&gt;

&lt;h3&gt;
  
  
  Taking a Course
&lt;/h3&gt;

&lt;p&gt;I took a couple of days researching for good courses on the topic. I'm a great fan of FreeCodeCamp, it was my starting point in learning Web Development. In their YouTube channel I found a good course in AWS CCP, presented by Andrew Brown. Andrew covered all the exam topics comprehensively and introduced me to his teaching platform, Exam Pro. Intrigued by the content and resources, I opted for his AWS CCP course. It not only covered all the essential concepts but also provided practice exams, flashcards, and cheat sheets, elevating my learning experience.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.exampro.co/clf-c01"&gt;Exampro link&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Doing Labs
&lt;/h3&gt;

&lt;p&gt;In order to get used with new technologies or tools you have to get hands-on with them. When you register in AWS, it provides you with a 12 months free trial in selected products, there are different product tiers that are eligible to be free to use during the 12 months under certain conditions. (Configure alarms to be notified if you exceed a condition of free use).&lt;/p&gt;

&lt;p&gt;Additionally, I discovered AWS Cloud Quest, an engaging Online RPG where I could act as a cloud specialist and solve problems using AWS products. This game enabled me to test various services like AWS S3, AWS EC2, AWS VPC, and AWS RDS. From deploying a static website on AWS S3 to setting up a load balancer for a fleet of EC2 instances, I embarked on a range of projects that provided invaluable practical knowledge in AWS.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://aws.amazon.com/training/digital/aws-cloud-quest/"&gt;Join Cloud Quest&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Retaining Information
&lt;/h3&gt;

&lt;p&gt;After concluding with the labs and finishing the course by Andrew. I created an appointment  for the exam where I had 3 weeks to prepare for the exam. Beside knowing how to use the services, there are multiple concepts of the cloud ecosystem that you have to get used to. After taking a test in ExamPro, I highlighted the questions that I failed and I made emphasis in rereading that topic. &lt;/p&gt;

&lt;p&gt;To improve, I used a tool called Anki. It's a flashcard program that uses spaced repetition for memorization. Space repetition is a learning technique that helps you retain information in long-term memory by spacing out the reviews of the cards. So,basically, information is better retained when it is reviewed multiple times at spaced intervals rather than through massed repetition or cramming. You create multiple cards and the algorithm makes emphasis on the cards in order of their urgency&lt;/p&gt;

&lt;p&gt;&lt;a href="https://apps.ankiweb.net/"&gt;Anki website&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;Becoming an AWS Certified Cloud Practitioner was an enriching experience that opened doors to endless possibilities. By selecting the right course, diving into hands-on labs, and leveraging tools like Anki, I not only gained the certification but also developed valuable skills for a successful career in the cloud computing world.&lt;/p&gt;

&lt;p&gt;I encourage everyone to embark on this journey, as AWS certifications hold immense value in today's technology-driven landscape.&lt;/p&gt;

&lt;p&gt;Best of luck on your AWS certification journey!&lt;/p&gt;

</description>
      <category>aws</category>
      <category>certification</category>
      <category>cloudcomputing</category>
      <category>clouddoses</category>
    </item>
    <item>
      <title>Things I Learned in the Hard Way in Software</title>
      <dc:creator>Cristhian Ferreira </dc:creator>
      <pubDate>Sun, 31 Jul 2022 01:47:30 +0000</pubDate>
      <link>https://dev.to/cferreirasuazo/things-i-learned-in-the-hard-way-in-software-38ec</link>
      <guid>https://dev.to/cferreirasuazo/things-i-learned-in-the-hard-way-in-software-38ec</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--aWa_vkra--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wdj9tlcg7x8vk8e20xkm.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--aWa_vkra--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wdj9tlcg7x8vk8e20xkm.jpg" alt="cover_image" width="880" height="587"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When you write code on your own, either to learn, for university or for a personal project, it is very different from writing code at work. When writing code for a client or for a company, certain guidelines, principles or patterns are usually followed so that the code is clean, error-proof or so that others can contribute to it.&lt;/p&gt;

&lt;p&gt;Working with projects at the work level, I have learned certain principles that are not taught in the university nor in courses, rather they are learned when you have the project in front of you and you have to take care of completing the tasks. &lt;/p&gt;

&lt;p&gt;I want to summarize some concepts and practices that I learned the hard way while implementing new features, debugging code that I wrote or developing new applications from the bottom-up. &lt;/p&gt;

&lt;h2&gt;
  
  
  Think for the long term.
&lt;/h2&gt;

&lt;p&gt;When you start working on an application, you have to think that over time this application is going to grow, its modules are going to change, new features are going to be added, some features are going to disappear and some features for which you have to think about what to have. Consider the following principles when writing code: &lt;strong&gt;reusability&lt;/strong&gt;, &lt;strong&gt;flexibility&lt;/strong&gt;, and &lt;strong&gt;maintainability&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Reusability: This means that you have to make the modules you create usable in many parts of the code and avoid having to repeat the same statements in your code. This is related to the DRY Principle or Don’t Repeat Yourself,  It states that you have to avoid redundancy in your software. &lt;/p&gt;

&lt;p&gt;Flexibility: your code has to be able to switch on and off without having to make many changes to your code and be able to be adapted in different parts over time.&lt;/p&gt;

&lt;p&gt;Maintainability: It refers to the ability of the code to be modified over time, to improve the flow, make some changes and that it can be adapted in different places making the smallest amount.&lt;/p&gt;

&lt;h2&gt;
  
  
  SOLID Principles
&lt;/h2&gt;

&lt;p&gt;SOLID principles are well known when working with object-oriented languages. They are a series of rules for writing clean code that also allow you to understand certain design patterns. These are:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;S&lt;/strong&gt; - Single Responsibility Principle (known as SRP): it states that a module should do one thing &lt;br&gt;
&lt;strong&gt;O&lt;/strong&gt; - Open/Closed Principle: A software artifact should be open for extension but closed for modification.&lt;br&gt;
&lt;strong&gt;L&lt;/strong&gt; - Liskov’s Substitution Principle: An entity can be substitute by another without breaking the existing system&lt;br&gt;
&lt;strong&gt;I&lt;/strong&gt; - Interface Segregation Principle: Prevent entities to use things that they don't need.&lt;br&gt;
&lt;strong&gt;D&lt;/strong&gt; - Dependency Inversion Principle: Abstractions should not depend on details. Details should depend on abstractions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Black Box
&lt;/h2&gt;

&lt;p&gt;This encapsulation principle has to do with data input and output. A module never has to know how another module is composed, this allows it to reduce its complexity.&lt;/p&gt;

&lt;p&gt;I was once tasked with working with a React component which made a request to an API. At that time I had the bad practice of writing inside the component line by line how the API call is executed, that is, I declared the fetch statement in the component, what values ​​make up the request and what values ​​it returns. This had been done in multiple other components.&lt;/p&gt;

&lt;p&gt;Over time the components got bigger and bigger and more logic was added and there was some that was related to these API calls. Over time this became tedious as I had to make changes to 6 different components.&lt;/p&gt;

&lt;p&gt;After a while I started to do some research regarding refactoring the code and came across an interesting article that talked about the Result-Error Pattern, a pattern that simplified async calls. So I made my React component not know how the API calls are made.&lt;/p&gt;

&lt;h2&gt;
  
  
  Separation of Concerns
&lt;/h2&gt;

&lt;p&gt;This design principle goes hand in hand with the term divide and conquer. An issue refers to a solution to a problem which means keeping the issues separate at the design level. This allows your code to be more flexible, reusable and maintainable. By having a module that does only one thing, you can make the changes you want without having to worry that something unexpected might happen.&lt;/p&gt;

&lt;h2&gt;
  
  
  Set your dependencies to a specific version
&lt;/h2&gt;

&lt;p&gt;When starting a new project or implementing a feature that requires a dependency, make sure that you are using a specific version of that dependency or have in a range of 2 versions (&amp;gt;= 5, &amp;lt;5.9). So at any moment you would have to reinstall the dependencies. It won't cause trouble like a method was deprecated or the whole library or framework changed. &lt;/p&gt;

&lt;h2&gt;
  
  
  Do maintenance, at least every 3 months
&lt;/h2&gt;

&lt;p&gt;Give periodic maintenance to your projects. Both the language and the frameworks and libraries are constantly being updated. Some methods are improved, some methods become obsolete or security changes are applied in the worst case, said library is discontinued and when you want to use it it is already obsolete.&lt;/p&gt;

&lt;p&gt;Periodically increment minor versions. These updates include minor code changes or enhancements so you can upgrade to a higher version over time.&lt;/p&gt;

&lt;p&gt;When you go to update the dependencies do it one by one. I had a situation where I wanted to upgrade from a version 2.5 to 4.6 in which everything exploded, there were many changes in the framework, many methods were deprecated, some changed their parameters, etc.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summarize
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Think for the long term. Make sure your code is flexible, reusable and maintainable &lt;/li&gt;
&lt;li&gt;Don’t repeat yourself&lt;/li&gt;
&lt;li&gt;Follow the SOLID Principles &lt;/li&gt;
&lt;li&gt;Divide and Conquer&lt;/li&gt;
&lt;li&gt;Set your dependencies to a specific version&lt;/li&gt;
&lt;li&gt;Do maintenance, at least every 3 months&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You must be willing to learn new things while transitioning in the software development industry. New things like methodologies, techniques, tools, etc. are learned, which increases our toolbox when we get our hands on a project. It is always good to accept the advice of the most experienced programmers or also see code from other projects. There is always something new that one can learn from others.&lt;/p&gt;

</description>
      <category>softwaredevelopment</category>
      <category>devjournal</category>
    </item>
    <item>
      <title>Open Web Intent to Tweet #100DaysOfCode Progress</title>
      <dc:creator>Cristhian Ferreira </dc:creator>
      <pubDate>Sun, 06 Jan 2019 02:19:01 +0000</pubDate>
      <link>https://dev.to/cferreirasuazo/open-web-intent-to-tweet-100daysofcode-progress-3hob</link>
      <guid>https://dev.to/cferreirasuazo/open-web-intent-to-tweet-100daysofcode-progress-3hob</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--O40BANW9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/tcf7v4vrz7ki59urwkjl.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--O40BANW9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/tcf7v4vrz7ki59urwkjl.jpeg" alt=""&gt;&lt;/a&gt;&lt;br&gt;
A friend and I, were talking about a problem he had when he was doing #100DaysOfCode Challenge. After a couple of days he’d forget to tweet his progress. He asked me if there is a way to open twitter and post his progress in a specific time. I came with the idea of using NodeJs and create a script and a cron job in Linux to open tweeter in a specific time but we leave that project forgotten.&lt;/p&gt;

&lt;p&gt;3 months later I made a script but using python. Here is what it does: &lt;/p&gt;

&lt;p&gt;1 - It loads a .json file containing the counter representing your days in the challenge, If it doesn’t exit, It’ll create a new one and started with 1.&lt;/p&gt;

&lt;p&gt;2- Gets current date using datetime module &lt;/p&gt;

&lt;p&gt;3- creates a URL containing the actual date, #100DaysOfCode hashtag,the current day in the challenge and the increase in one for the next day. Using webbrowser module, opens a web intent in your default browser.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--OAn8dDDu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/yajadix8zi2pqonjw0jm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--OAn8dDDu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/yajadix8zi2pqonjw0jm.png" alt="It will opens something like this"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
"""Opens a new Web Intent from Twitter to tweet your #100Daysofcode progress"""

import webbrowser 
from datetime import datetime
import os
import json

def save_day_count(file,count):
#Saves count for the next day
    try:
        with open(file,"w") as file_json:
            json.dump(count,file_json)
    except Exception as e:
        print(e)

def getting_day_count(file):
        #Check if file with current day exist
    if os.path.isfile(file):
        try:
            with open(file) as f_obj:
                #loads current day
                days = json.load(f_obj)
        except FileNotFoundError as ex :
                print(ex)
        else:   
        #Incriases one and saves for the next day
            days += 1
            save_day_count(file,days)
            return days    
    else:
        #Creates a new file if it doesn't exist and starts the counter in 1
        days = 1
        save_day_count(file,days)
        return days


days = getting_day_count("counter.json")
date = str(datetime.now().date()) #Gets current date
url = "https://twitter.com/intent/tweet?hashtags=100DaysofCode%0A" + date + "[Day " +  str(days) +"]"
webbrowser.open_new_tab(url)


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



&lt;p&gt;If you are like me, you don't have to forget again to tweet your progress &lt;/p&gt;

&lt;p&gt;Like to the &lt;a href="https://github.com/cferreirasuazo/tweet-100days"&gt;CODE&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If your liked it share it or if didn't leave a feedback, I'll appreciate it.&lt;/p&gt;

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

</description>
      <category>python</category>
      <category>100daysofcode</category>
    </item>
  </channel>
</rss>
