teleren/devto huggingface dataset:
100 Articles 🥳
Tags: developer, 100daysofcode
Published: 2020-06-26 06:50:22

Wow, 100 days fly by so quickly! Can you imagine I've written 100 articles in 100 days already?

I've started this challenge just before lockdown to keep me busy and sane, and so far it's been working very well.

Also, of course, it's hard some days to find a fresh topic to write about, but the bigger the audience, the more input I'm receiving, which makes it easier to write.

## Some Statistics

I like to show you guys some statistics, and then blogging doesn't make you instantly famous or makes you any money

> Disclaimer: This blog only costs me a lot of money 😂

- 100 Articles in 100 days!
- 54 people subscribed to my [daily newsletter](http://eepurl.com/gXF0LP)
- 3.7K Visitors
- 4.5K Sessions
- Average 44s Session
- 826 [Twitter](https://twitter.com/DailyDevTips1) Followers
- 420 [Instagram](https://www.instagram.com/dailydevtipsblog/) Followers
- Still, a lot of fun to write and receive comments!

## Top posts

I thought it would also be cool to show you guys the top 10 posts in visits:

1. [How to use Google Fonts](https://daily-dev-tips.com/posts/how-to-use-google-fonts/)
2. [CSS keyframe animation floating blocks](https://daily-dev-tips.com/posts/css-keyframe-animation-floating-blocks/)
3. [CSS only expanding slider 😲](https://daily-dev-tips.com/posts/css-only-expanding-slider-%F0%9F%98%B2/)
4. [Building a Static Blog with 11ty](https://daily-dev-tips.com/posts/building-a-static-blog-with-11ty/)
5. [CSS Flip Cards](https://daily-dev-tips.com/posts/css-flip-cards/)
6. [Vanilla JavaScript event listener on Multiple elements](https://daily-dev-tips.com/posts/vanilla-javascript-event-listener-on-multiple-elements/)
7. [Fontawesome SVG Alternative](https://daily-dev-tips.com/posts/fontawesome-svg-alternative/)
8. [Hosting a Static Blog on Netlify](https://daily-dev-tips.com/posts/hosting-a-static-blog-on-netlify/)
9. [Vanilla JavaScript Scroll to Top](https://daily-dev-tips.com/posts/vanilla-javascript-scroll-to-top/)
10. [HTML Input Types](https://daily-dev-tips.com/posts/html-input-types/)

## Future Plans

I hope to stick to my everyday article, like mentioned some days it gets a bit tricky finding a topic to write about.

With the awesome dev community, I'm sure there's so much to write about, and the site will keep growing!

## How you can help!

I don't want to earn money with this blog; it's a project to help new developers getting better, and maybe teach a thing or two to the advanced ones.

What you can do to help me!

- Give me a follow on [Twitter](https://twitter.com/DailyDevTips1) and [Instagram](https://www.instagram.com/dailydevtipsblog/)
- [Subscribe](http://eepurl.com/gXF0LP) to my Mailchimp list
- Visit my blog!
- Spread the word
- Ask me questions on topics your struggling with

Again, Thank you so much for all your support so far, and let's keep the site growing.

### Thank you for reading, and let's connect!

Thank you for reading my blog. Feel free to subscribe to my email newsletter and connect on [Facebook](https://www.facebook.com/DailyDevTipsBlog) or [Twitter](https://twitter.com/DailyDevTips1)
Benefits of using cloud hosting for your e-commerce website.
Tags: cloudhosting, ecommerce, webhosting, scaling
Published: 2020-06-26 06:33:03

When it comes to an e-commerce website, there are a lot of aspects to be taken care of, and you need to make suitable decisions and investments for your business to flourish and get well established as a brand name. Cloud hosting is one such platform that offers the perfect framework for developing a full fledged ecommerce website.

I’ve listed the main benefits which come along when we choose Cloud hosting for your e-commerce business:

Dealing With Customer peak times becomes easy-
High or automated scaling assists your business in dealing with a large number of customer visits and increased user activity in an effective way. With increased customer activity, one can effortlessly scale up the resources in active sessions.

Increased Accessibility-
When your ecommerce business is hosted on a Cloud server, users can get easy access to their important business information via any standard web browser, thus reducing the additional cost for setting up an in-house system.

Security-
For an ecommerce business, it is necessary to secure the important business files, applications and networks. Along with end-to-end data encryption, Cloud hosting also provides dedicated software firewalls, SSL certificate, DDoS protection and multi-level authentication processes that ensures ultimate protection of sensitive business data.

Full Root Access-
With cloud hosting, customers are provided with total control over their hosting platform. You can install softwares and applications and do much more with full root access. You can make use of this feature to enhance the activities of your e-commerce business and ensure the smooth running of your website.

A cloud hosting solution provides you with a full fledged framework for setting up and developing your e-commerce business.

If you have not hosted on cloud yet, I suggest you check out the economically priced cloud hosting solutions offered by CloudJiffy. I have been associated with them for a couple of years now, and being a satisfied customer, I would recommend you to make use of their services. 
To know more about them- https://cloudjiffy.com/

All the best!
Current Weather Forecasting
Tags: html, javascript, css
Published: 2020-06-26 05:58:44

A web application which detects current weather conditions around the globe.

This web application uses OpenWeatherMap API which provides current weather conditions around the globe.
HOW TO USE THIS WEB APPLICATION?

Simply you have to enter a city name and search.
You will get current weather data as well as it will show you next 5 days weather conditions.
Also there are two graphs which shows next 5 days temperature and humidity in graphical format.
This graphs are CanvasJS simple graph JAVASCRIPT API.
You can visit following link for live demo :

https://shubham-gomdhare.github.io/
One domain - multiple service-worker up
Tags: javascript, webdev, pwa
Published: 2020-06-26 05:48:09

###What dilemma i faced?

I usually keep working on multiple projects but with full attention on one project at a specific time(Week, Month). But for a minimal update, I usually follow the same procedure that keeps an offline app with a service worker.
If you are a **soloprenuer** and have a cash crunch at an early stage, you have to deal with multiple apps under one domain.

like I am doing multiple apps(Total 10) with jswalker.in under /its/ tag and 7 with a subdomain.

If you follow approach from this [URL](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers#Deleting_old_caches).You will get few gotchas in work-cycle.

###Service worker activate event
```

var staticCacheName="appname_version_1";
self.addEventListener('activate', function(event) {
  var cacheWhitelist = [staticCacheName];

  event.waitUntil(
    caches.keys().then(function(keyList) {
      return Promise.all(keyList.map(function(key) {
        if (cacheWhitelist.indexOf(key) === -1) {
           console.log("Cache delete : "+key);
           return caches.delete(key);
        }

      }));

    })
  );
  
```
###Root Cause of problem
If we use previous approach We will face no problem and no other cache version will be affected of sub domain's service worker.

But if you use the same domain with dynamic URLs like: /its/amazing and its/sweeper as different Progressive web app.Previous service-worker strategy makes your Eco-System a little bit vulnerable at the offline stage.

>It will clear every cache-list except current app-version.In that case if one of your app got update it will remove all caches(10 APP cache) it means /first-app,/second-app cache will also got removed.But service worker still not Unregister from browser so now network request of PWA not found in **caches.keys()** and make request over Network not from Service-Worker.

###How to resolve?
```
var staticCacheName='appname_version_2';
self.addEventListener('activate', function(event) {
  
  var static_cache_prefix = staticCacheName.substring(0,staticCacheName.indexOf("_"));
  
  event.waitUntil(
    caches.keys().then(function(keyList) {
      return Promise.all(keyList.map(function(key) {
        
        if (key.indexOf(static_cache_prefix) > -1 && key!=staticCacheName) { 
           console.log("Cache delete : "+key);
           return caches.delete(key);
        }

      }));

    })
  );
});

```
###What you will achieve?

The above strategy will check appname in cache list AKA **caches.keys()**.Now it will only remove cache of specific app(separated by URL) with old version and all other related app cache will intact along with new version of updated PWA.
#024 Docker with microservices
Tags: docker, devops, tutorial
Published: 2020-06-26 05:29:38

# Introduction

this is part 24 from the journey it's a long journey(360 day) so go please check previous parts , and if you need to walk in the journey with me please make sure to follow because I may post more than once in 1 Day but surely I will post daily at least one 😍.

And I will cover lot of tools as we move on.
***
# What is microservices
basically microservices is dividing our big application to small apps , each app can have his own front-end and backend but they can communicate with each other.
***
# Architecture
![architecture](https://raw.githubusercontent.com/dockersamples/example-voting-app/master/architecture.png)

This image explain how this project work .

.A front-end web app in Python or ASP.NET Core which lets you vote between two options
.A Redis or NATS queue which collects new votes
.A .NET Core, Java or .NET Core 2.1 worker which consumes votes and stores them in…
.A Postgres or TiDB database backed by a Docker volume
.A Node.js or ASP.NET Core SignalR webapp which shows the results of the voting in real time

***
# Example
we are going to use docker official example go to [this link](https://github.com/dockersamples/example-voting-app) and copy link to clone it locally
![link](https://dev-to-uploads.s3.amazonaws.com/i/4clgo57660uvddkampif.png)
go the the terminal and type
![clone](https://dev-to-uploads.s3.amazonaws.com/i/e5f772wcg2i8zvnfcan3.png)
```bash
git clone https://github.com/dockersamples/example-voting-app.git
cd example-voting-app
```
now the project is ready to build , we can see many docker-compose files run what ever is compatible with your machine.
I am going to use docker-compose-javaworker.yml
javaworker will use the java version not dotnet

![up-java](https://dev-to-uploads.s3.amazonaws.com/i/fcxrdu4nh9rla8ld8znr.png)

```bash
docker-compose -f docker-compose-javaworker.yml up
```

after finish building it's time to take a look at it
head in your browser to [127.0.0.1:5000](127.0.0.1:5000) and in another window to [127.0.0.1:5001](127.0.0.1:5000)

![browser](https://dev-to-uploads.s3.amazonaws.com/i/obhgpwgl971q453awo2x.png)

have fun with it try to vote and see change live !
***

# docker-compose

![compose](https://dev-to-uploads.s3.amazonaws.com/i/ocisudre5gjj6pulbnnu.png)

if you see they are using different services each use it's own front-end and back-end , and they are connected together using docker network you can see that vote and result connected to both networks back and front , but redis and worker and postgres are only to back-end.

that's a real example of power of docker how it's connected together to make a complete microservice app.

Also There is a deployment stack , it will be later later in the end when we cover all the tools , I will try to make an app contain all what we learn together :)
C++ stuck inside while-loop?
Tags: cpp, loops
Published: 2020-06-26 05:06:43

I am trying to learn C++ and so far it has been fairly straightforward. I have been following a course on YouTube and I'm about halfway through.

So I decided that I wanted to make a BMI calculator, simple enough right? I decided I wanted to use while loops when reading different values from the user and it works for the most part. The problem comes when the user enters something other than a number, the program gets stuck inside an if-statement and doesn't seem to be able to break out and I don't know how to handle it. 

In a language like Python or even C#, while-loops work as I expect them to but in c++ they seem to be somewhat different or maybe there is something strange with using cin, I am still pretty new c++.

Here's my code:

```
#include <iostream>
#include <conio.h>

using namespace std;


int main()
{
    //Keep track of the data we need and the
    //data we want to calculate later
    float bmi = 0;
    float weight = 0;
    float height = 0;

    //Keep track of which while loop we should
    //be inside.
    //0 = weight loop,
    //1 = height loop
    int loopCount = 0;

    
    while(loopCount == 0)
    {   
        cout << "Enter your weight in kgs: ";
        cin >> weight;

        if(weight <= 0)
        {
            cout << loopCount << " ERROR: Please enter a valid weight in kgs" << endl;
        }

        else
        {
            loopCount = 1;
        }         
    }

    
    while(loopCount == 1)
    {    
        cout << endl;
        cout << "Press any key to continue...";
        getch();

        return 0;
    }

    return 0;

}
```

To clarify, when a user inputs a number everything works fine. When the user doesn't input a number the program freaks out and it gets stuck printing the error message over and over again. I tried using cin.fail() but that produced the same results so I am really clueless here.
The Rest Operator
Tags: javascript, typescript
Published: 2020-06-26 04:28:56

I had never heard of the Rest Operator until today, but it's a wonderful inverse twist on the Spread Operator. Let's say you need to add up a series of numbers, but you don't know how many numbers your function needs to take in. The Rest Operator is a great way to take every function argument after the first and combine them (the rest) into an array. This is so great because arrays are nice and easy to operate on. Here's an example:

```typescript
const add = (param1, ...rest) => {
  let sum = param1;
  rest.forEach(arg => sum += arg);
  return sum;
};

console.log(add(2, 3, 4));
// 9
```
What can cause `new Date()` to return incorrect dates?
Tags: javascript, mongodb, help
Published: 2020-06-26 04:19:03

I am trying to solve a problem in which I have found date values in my MongoDB database to be inaccurate.

For example, in my database, I have a list of tokens that are set to be deleted by the database 12 hours after they're created. I noticed some of my tokens were missing so I disabled the expiration function. It turns out some of these tokens have inaccurate creation dates. The worst case was a token that was created on June 25th but has an creation date value of '2020-06-03T09:00:29.506+00:00'. That's a 22 day difference!

I use JavaScript's `new Date()` method to create the dates. MongoDB by default will convert a date object created by JavaScript's `new Date()` to UTC.

I have ensured my system's built-in time synchronization is activated. What else can I do to make `new Date()` return correct dates?
June 26th, 2020: What did you learn this week?
Tags: weeklylearn, discuss, weeklyretro
Published: 2020-06-26 04:13:58

It's that time of the week again.

So wonderful devs, what did you learn this week? It could be programming tips, career advice etc.

<center>

![PSA "Learn to use the Internet Level II](https://media.giphy.com/media/yDYAHbqe5DfyM/giphy.gif)

</center>

Feel free to comment with what you learnt and/or reference your TIL post to give it some more exposure.

{%tag todayilearned %}

And remember, if something you learnt was a big win for you, then you know where to drop it as well.👇👇🏻👇🏼👇🏽👇🏾👇🏿

{% link https://dev.to/graciegregory/what-was-your-win-this-week-12aj %}

<center>

![Toddler making a fist as if to say "Yes!"](https://media.giphy.com/media/6brH8dM3zeMyA/giphy.gif)

</center>
React Redux Video | Create Youtube Player -3
Tags: react, redux, webdev, showdev
Published: 2020-06-26 04:11:10

I had recently started my YouTube channel — The Web Dev. I had decided to start putting all my blogs into the YouTube channel.

We had earlier converted the YouTube player to use flux. I decided to convert it using Redux.
As redux is still very popular and used in enterprises a lot, decided to convert the simple app to use Redux.

And here is my third YouTube video.

{% youtube WvtfqDJklmo %}

Please do like it and [Subscribe](https://www.youtube.com/channel/UCRf7mazcufqZxd2pR3oQJuQ?sub_confirmation=1) to my channel for more videos.

You can also read the complete blog here -

https://thewebdev.tech/youtube-redux-3
So you want to be a developer?
Tags: roadmap, developer, beginners, webdev
Published: 2020-06-26 03:55:38

---
published: true
title: "So you want to be a developer?"
cover_image: "https://raw.githubusercontent.com/gcaducci/dev.to/master/blog-posts/so-you-want-to-be-a-developer/assets/cover-image.png"
description: "An introduction on the series Beginners Guide to Coding"
tags: roadmap, developer, beginners, webdev
series: [Beginners Guide To Coding]
canonical_url:
---

# Who am I and what my goal is?

I have been a software developer for 10+ years, I started my career as a web developer in late 2000, and currently, I am working for almost a year as an IT Team Leader at EBANX.

Writing articles was something that I wanted to do for a long time but always had some excuse to not do it. A couple of days ago, in the middle of the COVID-19 lockdown, one of my cousins asked me to teach him how to code. So this is the beginning of my path as a writer, it will help me to grow as a developer and in meanwhile, I believe, that this can also help others seeking to start coding.

# What we are about to do

To help me fulfill the task given to me by my cousin, I started to do some research on what to teach first. Should I start on how to create a web site? or how to create a simple software? How to do a calculator? HTML, CSS and JavaScript combo?

After a while searching in what to do first, I came across with the [Web Developer Roadmap 2020](https://github.com/kamranahmedse/developer-roadmap) from [Kamran Ahmed](https://twitter.com/kamranahmedse) and I think that it is a great starting point.

![Web Developer Roadmap Introduction - Next Step: Data Structures and Alrorithms](https://raw.githubusercontent.com/gcaducci/dev.to/master/blog-posts/so-you-want-to-be-a-developer/assets/web-developer-roadmap-data-structures-algorithms.png 'Web Developer Roadmap Introduction - Next Step: Data Structures and Algorithms')

In the next post, we are going to see **Data Structures and Algorithms**.

# Found a typo?

If you've found a typo, a sentence that could be improved, or anything else that should be updated on this blog post, you can access it through a git repository and make a pull request. Instead of posting a comment, please go directly to [my dev.to repository](https://github.com/gcaducci/dev.to) and open a new pull request with your changes.
It's OK to Not Be Perfect
Published: 2020-06-26 03:49:00

Lowe's Customer Support had something to teach me today about perfection.

![Installation Manual Photo](https://dev-to-uploads.s3.amazonaws.com/i/gbz89ix3rpyi12scnleu.jpg)
Having had a very poor experience recently with a different big box store when trying to purchase a different appliance, my wife and I were a little skeptical about picking up our new dishwasher. With the prior retailer (let's call them "Sub-Optimal Purchase"), our delivery date came and went with a confused local delivery driver calling us to report that he had no information, an hour on hold with multiple transfers, another hour on hold via their chat on their web site. This was a process that ended with no appliance.

With the dishwasher, we also ordered online, and I made the questionable choice of heading to pick up the appliance within 30 minutes of close. In a panic, I called the store. No one picked up. I called again, chose different menus. No answer. Shoot, I figured. Another store that simply doesn't care about their customers. Another poor shopping experience. Sigh.

When I walked in the store, however, nothing could be further from the truth. After one short (socially-distant, mask-wearing) conversation with the knowledgeable staff member, the box was in the back of our vehicle and I was driving home. Done!

I puzzled at the stark contrast between my expectations based on the failed phone calls and the smooth checkout. How could Lowe's do such a dumpy job with picking up the phone and then just absolutely kill it at their front desk game? It's simple. The front desk people were serving the people who were on site before picking up their phones. Boom! Mind blown. They weren't perfect, and that's okay!

At home and at work, I see the same struggle again and again for many people. It's hard, in challenging times, to choose what to fail at. But you will definitely not be perfect at everything. And if you try, you will barely even be good at any of it. What the staff at Lowe's Home Improvement taught me is, to understand what is key - what is the most important thing - and focus on that.

In Lean methodologies, they call the act of spreading oneself too thin, a failure to limit "WIP," or Work In Progress. Indeed, I can't tell you how many times I have failed to deliver anything because I was trying to deliver everything. It is such a basic and beautiful concept, that I have considered getting it tattooed on me.

The Voltaire quote I love along these lines reportedly goes, "Le mieux est l'ennemi du bien," or "the perfect is the enemy of the good."

The dishwasher got installed. It's not bolted down completely yet, and it's not as quiet as the one that broke earlier this week, but we are back in the business of getting dishes washed quickly. It'll do.

So. Go forth, folks, and be good.