teleren/devto huggingface dataset:
Como e por que usar o axios?
Published: 2023-01-02 12:47:17

---
title: Como e por que usar o axios?
published: true
description: 
tags: 
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wi656wrs8i3grr3tb1wo.png
# Use a ratio of 100:42 for best results.
# published_at: 2022-12-27 12:34 +0000
---

O Axios é uma biblioteca de cliente HTTP para JavaScript que permite fazer solicitações HTTP de maneira fácil e eficiente. Ele é compatível com a maioria dos navegadores e também pode ser usado em aplicativos móveis com React Native.

Ao usar o Axios com React Native, você pode facilmente fazer solicitações HTTP para consumir APIs REST, enviar dados para um servidor ou realizar qualquer outra operação de rede. Além disso, o Axios oferece recursos como interceptadores de solicitação e resposta, que permitem manipular solicitações e respostas de maneira fácil e consistente.

Um dos principais benefícios de usar o Axios com React Native é que ele é compatível com a maioria dos navegadores, o que significa que você pode reutilizar código de rede entre aplicativos da Web e móveis. Além disso, o Axios é fácil de usar e oferece uma sintaxe intuitiva para fazer solicitações HTTP.

Em resumo, o Axios é uma ótima opção para fazer solicitações HTTP em aplicativos móveis com React Native devido à sua compatibilidade com a maioria dos navegadores, facilidade de uso e recursos avançados como interceptadores de solicitação e resposta.

## Como adicionar o pacote axios a minha aplicação?
Para adicionar o pacote axios a sua aplicação, você pode usar o gerenciador de pacotes npm ou yarn.

Abra o terminal e vá para o diretório da sua aplicação
Digite o comando `npm install axios` ou `yarn add axios`
Isso instalará o pacote axios na sua aplicação e você pode começar a usá-lo.

Para usar o axios em seu código, basta importá-lo da seguinte maneira:
```
import axios from 'axios';
```
Ou, se você prefere a sintaxe de require:
```
const axios = require('axios');
```
## Exemplo de uma requisição: GET, POST, PUT, DELETE
### GET: Obter um recurso específico.
```
axios.get('/user?ID=12345')
  .then(function (response) {
    console.log(response);
  })
  .catch(function (error) {
    console.log(error);
  });
```
### POST: Criar um novo recurso.
```
axios.post('/user', {
    firstName: 'Fred',
    lastName: 'Flintstone'
  })
  .then(function (response) {
    console.log(response);
  })
  .catch(function (error) {
    console.log(error);
  });

```
### PUT: Atualizar um recurso existente.
```
axios.put('/user/12345', {
    firstName: 'Barney',
    lastName: 'Rubble'
  })
  .then(function (response) {
    console.log(response);
  })
  .catch(function (error) {
    console.log(error);
  });

```
### DELETE: Excluir um recurso existente.
```
axios.delete('/user/12345')
  .then(function (response) {
    console.log(response);
  })
  .catch(function (error) {
    console.log(error);
  });
```
Esses são apenas alguns exemplos básicos. O axios tem muitas outras opções e configurações disponíveis que você pode explorar na [documentação do axios](https://github.com/axios/axios).
Monolithic and Distributed Monolith Applications: Understanding the Pros and Cons
Tags: monolithic, distributedsystems, softwaredesign, architecture
Published: 2023-01-02 11:50:34

In the world of software development, there are many approaches to designing and building applications. One commonly used approach is the monolithic architecture, in which the application is built as a single, self-contained unit. While monolithic architectures have some advantages, such as ease of development and testing, they can become difficult to maintain and scale as the application grows in size and complexity.

To address these issues, some organizations have turned to distributed monolith architectures, which involve decomposing the monolithic application into smaller, independent components that can be developed and deployed separately. There are two main approaches to implementing a distributed monolith: microservices and modular monoliths.

Microservices involve dividing the application into self-contained services that communicate with each other through well-defined interfaces. This approach offers more flexibility and scalability than a monolithic architecture, as individual components can be developed, deployed, and scaled independently. However, microservices can be more complex to develop and maintain due to the need to coordinate and manage the interactions between the various components.

Modular monoliths involve dividing the application into logical modules that can be developed and deployed independently, but are more closely integrated than microservices. This approach offers a balance between simplicity and flexibility, but may be less scalable than microservices.

Both microservices and modular monoliths have their own set of trade-offs and challenges, and the best approach will depend on the specific needs and constraints of the application and organization.

In addition to these architectural approaches, there are also software development practices such as continuous integration (CI) and continuous delivery (CD) that can be used to streamline the development and deployment process for, both, monoliths and microservices. CI involves regularly integrating code changes and automatically building and testing the code, while CD automates the process of delivering code changes to production/staging/development environments. These practices can help organizations to deploy updates and new features faster and more reliably, and can be particularly beneficial for distributed monoliths and microservices.
This article is published to Dev.to with github Action
Tags: todayilearned, web, devjournal, showdev
Published: 2023-01-02 11:50:27

Happy New year!

I have been writing "Today I learned (TIL)" article for a while. These are short note about
development things that I learned and stored as a collection of [markdown file in GitHub](https://github.com/yulrizka/til).
I hosted it with [GitBook](https://www.gitbook.com/) on [https://til.yulrizka.com](https://til.yulrizka.com)

As articles are already written in Markdown, I would like to have this synchronized to my [Dev.to](https://dev.to/yulrizka) 
whenever there is update to the contents. The idea is to run a script on new commit that sync the change to Dev.to.

So, I have created a small [golang script](https://github.com/yulrizka/til/blob/master/.scripts/main.go) that triggered
in a GitHub action workflow that does:
1. Figure out markdown file that added or changed in the current commit.
2. Fetch all articles from _Dev.to_ via an API.
3. For each local article, compare it to Dev.to (using a canonical URL).
4. Create or Update the article accordingly via the API.

This is an example of the pipeline running [https://github.com/yulrizka/til/actions/runs/3812108410](https://github.com/yulrizka/til/actions/runs/3812108410)

I wrote stuff about cli tricks, git, network, go, etc. Check out the full list on [https://til.yulrizka.com](https://til.yulrizka.com)
Earning way more with Code!: What ChatGPT says and my opinions
Tags: developers, entepreneurship, fintec, newyear
Published: 2023-01-02 11:50:04

Are you tired of the 9-to-5 grind and looking for a way to increase your income while also finding a sense of purpose in your work? Starting a business with code can potentially earn you even more than finding a job as a software developer. Not only does it allow you to create your own products or services and sell them to a larger market, but it also gives you the opportunity to work on projects that you are passionate about and that align with your personal values and goals. This can give you a sense of fulfillment and make your work feel like something that is not just a means to an end, but something that is truly meaningful and fulfilling. While starting a business with code does come with its own set of challenges and risks, the rewards can far outweigh them with hard work and determination.

Well well well, step aside Chat GPT time for my insights, so people I'm not going to go far from what ChatGPT mentioned but I want to emphasize on this thing called "_work feeling like not work_". Well what I mean is when working to grow a business you'll not need to read articles to motivate you or even watch motivational videos because the sense of attachment itself will generate a level of motivation and work ethic you usually get to when trying to save yourself from danger and this is not all.

##Napoleon Hill Concurs##
For anyone who's ever read the Napoleon Hill book called **Think and Grow rich** , the second chapter is about the thing he calls desire, and this is no ordinary desire it's a very burning desire you have to achieve something and that's only what you need to accomplish it , because with a burning desire you'll find yourself coming across realizations you've never had before because of the laser focus level you'll be having.

I can spend at least 24 hours talking about how this and can give you a lot of examples but let me stop for now this was just a small article to share to you fellow devs and maybe come back to it in later articles. Thanks for reading don't forget to like and add your opinion!

Happy New Year !!
Semantic HTML Not <div></div> Soup
Tags: html, webdev, beginners, seo
Published: 2023-01-02 11:50:00

Semantic HTML elements are elements that have a specific meaning to both the browser and the developer. They allow developers to structure the content of a webpage in a meaningful way, and they also provide information to browsers and other web tools about the meaning and purpose of that content.

Some examples of semantic HTML elements are:

- `<header>`: used to contain the header of a webpage or section

- `<footer>`: used to contain the footer of a webpage or section

- `<article>`: used to contain a standalone piece of content, such as a blog post or news article

- `<section>`: used to contain a group of related content

- `<aside>`: used to contain content that is tangentially related to the main content of the page. 

Using semantic HTML elements is important because it helps to make the structure and meaning of a webpage more clear and understandable to both humans and machines. This can improve the user experience, as it makes it easier for users to find and understand the content they are looking for. 

It can also make it easier for search engines to crawl and index the content of a webpage, which can help to improve the search ranking of the webpage.
Why the Composition API?
Tags: vue, compositionapi, webdev
Published: 2023-01-02 11:43:57

> A short but concise note on why it is called or referred to as an Options API when you are torn apart on which of them to use.

Before we continue,  note that the Composition API however is not meant to replace the Options API completely but rather, purely additive and only an alternative syntax for writing components in Vue.

- They perform the same function

- and can both be used concurrently in the same project.

> **[Vue 3](https://blog.vuejs.org/posts/vue-3-as-the-new-default.html)** is introduced as the New Default

## But why was it introduced?

**1. TypeScript Support**
If you're gonna use TypeScript out of the box, then you are sure to leverage the Composition API instead.

**2. Better Organization**
Composition API provides better code layout and organization for our components than the Options API, if you're working on a more larger project.
remember the Composition API uses the setup() hook.

**3. Better reusability**
The Composition API offers a better code reusability than the mixins alternative the options API offers to handle the same logic. You can checkout [mixins ](https://vuejs.org/api/options-composition.html#mixins)if you aren't familiar with it yet.

And that is it,

> Though the Options API is completely optional, it can/or cannot be used per your preference and expert experience in writing Vue applications.

But I will advice as well to know how to use more the Options API by heart, so you better know when you're confident to go full Composition API in your next big project to clear any before doubts.

**Happy Coding, Happy New Year!!!**
How much salary does a Kubernetes engineer get?
Tags: kubernetes, devops, career, docker
Published: 2023-01-02 11:28:28

**_$250,000 is the maximum salary offered for a Kubernetes job in our dataset!_**

Then, what is the average salary for a Kubernetes Engineer? Are the metrics vastly different between the US and Europe?

Let's try to find the answers to the above questions (and perhaps more) with [Kube Careers](https://kube.careers) job listings data for Q3 2022 (July to September).

Before you read further, know that:
- At Kube Careers, we only include job listings with a clear salary range, and which have *Kubernetes* as a requirement and not a *nice to have/plus*.
- Our dataset is small, with **86** job listings from July to September 2022.
- We have divided the salary ranges into two categories: North American Kubernetes jobs (normalised to be in USD), and
European Kubernetes jobs (normalised to be in EUR).

## Salary ranges for American jobs in USD

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4vasl5oh1jlpl6g3kq09.png)

The minimum salary offered in America, on average, stands at **$139,269**, while the maximum salary (on average) offered stands at **$174,246**.

The minimum average salary has increased by **13%**, while the maximum average salary has increased by **12%** over Q3 of 2021, which is a definite positive sign.

The highest salary range for Q3 2022 is between **$200,000-250,000**, which is also a whopping **25%** increase over the highest salary range for Q3 2021.

Overall, it's good to see that the average minimum salaries are increasing at a reasonable rate so that not only the positions at the top but the entry-level positions also seem desirable.

## Salary ranges for European jobs in Euros


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ejvmsmqlytq3sy0093sy.png)

The minimum salary offered in Europe, on average, stands at **€89,729**, while the maximum salary (on average) is at **€114,337**.

We have recently started analysing the salary ranges for Europe and America differently, so we can't compare these numbers with Q3 2021.

However, the minimum salary range has increased more than **7%** over the last quarter, i.e., Q2 2022, which is encouraging.

**Note:** Europe is a vast, diverse continent with varied living costs, economies, and technological status. Thus, we can't be conclusive with these numbers, but we can get a decent representation of the state of salaries in Europe.

Like what you read?

Click [here](https://kube.careers/kubernetes-trend-report-2022-q3) if you'd like to read our detailed job trends report for Q3 2022, which includes salary ranges, popular technologies, popular skills listed in job descriptions, and much more.
Overcoming Procrastination: The Key to Success for Developers
Tags: computerscience, codenewbie, motivation, melbite
Published: 2023-01-02 11:28:27


Procrastination is a common problem among developers, and it can have serious consequences for both individuals and organizations. When developers put off important tasks or delay starting a project, it can lead to missed deadlines, poor-quality work, and increased stress. In this article, we will explore the causes of procrastination in developers and the effects it can have on individuals and teams.


There are several reasons why developers may find themselves procrastinating. One common cause is perfectionism. Developers may be hesitant to start on a task because they want to ensure that they do it perfectly, which can be an unrealistic and intimidating goal. Other causes of procrastination may include a lack of motivation, fear of failure, and an overwhelming workload.


The effects of procrastination can be significant. When developers put off important tasks, they may find themselves under more pressure to complete them in a shorter amount of time, leading to increased stress and possibly even burnout. This can also lead to rushed and lower-quality work, as there may not be enough time to thoroughly test and debug code. Additionally, missed deadlines can have serious consequences for both the developer and the organization. This can lead to missed opportunities, damaged relationships with clients or stakeholders, and decreased productivity and profitability.


So, what can be done to address procrastination in developers? One solution is to break tasks down into smaller, more manageable chunks. This can help developers feel more confident and motivated to tackle a project. Setting clear goals and deadlines can also help developers stay on track and avoid getting overwhelmed. Additionally, providing support and resources, such as access to training or mentors, can help developers feel more equipped to handle their workload.


In conclusion, procrastination can be a major problem for developers and can have serious consequences for both individuals and organizations. By addressing the causes of procrastination and implementing strategies to overcome it, developers can improve their productivity and quality of work, ultimately leading to success in their careers.

This article was originally published at [https://overcoming-procrastination](https://melbite.com/Dedan-Okware/dojoGVJ5IXTe83fbpXPX )
Which programming language(s) are important for a Kubernetes job?
Tags: kubernetes, devops, docker, career
Published: 2023-01-02 11:28:07

***74% of the job descriptions mentioned at least one programming language as their requirement!***

Sounds logical, but what about specifics? Which language is the most popular among the mentions? And which aren't so popular?

Let's try to answer some of the above questions (and perhaps more) with [Kube Careers](https://kube.careers) job listings data for Q3 2022 (July to September).

Before you read further, know that:

- At Kube Careers, we only include job listings with a clear salary range, which have Kubernetes as a requirement and not a nice to have/plus.
- Our dataset is small, with 86 job listings from July to September 2022.

## Are programming languages mentioned regularly in job descriptions?


_Yes. It's almost a usual affair._

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/atjlowy73x3i9gwn4wry.png)

Of the **86** jobs we listed in Q3 2022, **71** mentioned at least one programming language in the job descriptions.


### How often does a single job description mention more than one programming language?

**Quite often.**

In fact, of the 71 job descriptions (that cite programming languages), there were 206 instances of programming language mentions.

Meaning most of the job descriptions cite more than one programming language.

**_That's an average of almost 3 programming language mentions per job description!_**

## Which are the popular programming languages mentioned in job descriptions?


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a109ctasc6wcw87uronx.png)

Here are the takeaways from our Programming languages analysis:
1. **Python** is the undisputed programming language King. It has topped all of the quarterly charts we have published.
2. Go is a close second in demand, and it has also been reflected in the last four quarters that we analysed.
3. Other important programming languages are: **Java, Shell, Javascript, Rust, and Ruby.**

Did you like what you read?

Click [here](https://kube.careers/kubernetes-trend-report-2022-q3) if you'd like to read our detailed job trends report for Q3 2022, which includes salary ranges, popular technologies, popular skills listed in job descriptions, and much more.
Microservice Based Architecture
Tags: architecture, softwareengineering, softwaredevelopment, microservices
Published: 2023-01-02 11:19:36

Microservice-based architecture is a design approach in which a large software application is built as a suite of small, independent services that communicate with each other using well-defined interfaces. This approach has gained popularity in recent years due to its ability to improve the scalability and maintainability of complex software systems.

One of the key benefits of microservices is that they allow teams to work independently and in parallel on different parts of the system. This can lead to faster development cycles and a more flexible codebase. However, building a successful microservice-based system requires careful planning and the use of design patterns and clean architectural standards.

One of the key design patterns used in microservice-based architecture is the API Gateway pattern. This pattern involves the creation of a central gateway that sits in front of the individual microservices and exposes a single, unified API to the outside world. The API Gateway is responsible for routing requests to the appropriate microservice, handling authentication and authorization, and providing other security and monitoring features.

Another important design pattern is the Circuit Breaker pattern, which is used to prevent cascading failures in a microservice-based system. This pattern involves the creation of a circuit breaker that sits between the client and the microservice. If the microservice fails to respond within a certain time period, the circuit breaker will automatically open and prevent further requests from being sent to the service. This can help to prevent a single point of failure from taking down the entire system.

In order to ensure that a microservice-based system is maintainable and scalable, it is important to follow clean architectural standards. One such standard is the Single Responsibility Principle, which states that every module or class in a system should have a single, well-defined responsibility. This helps to keep the codebase modular and easy to understand, as each service has a clear purpose and is not cluttered with unnecessary functionality.

Another important architectural standard is the Dependency Inversion Principle, which states that high-level modules should not depend on low-level modules, but rather both should depend on abstractions. This helps to reduce the coupling between different parts of the system and makes it easier to change or replace individual microservices without affecting the rest of the system.

In summary, microservice-based architecture is a powerful design approach that can improve the scalability and maintainability of complex software systems. By using design patterns such as the API Gateway and Circuit Breaker patterns and following clean architectural standards, it is possible to build a robust and reliable system that is easy to maintain and evolve over time.