teleren/devto huggingface dataset:
Top 7 Featured DEV Posts from the Past Week
Tags: top7
Published: 2021-10-05 17:52:14

---
title: Top 7 Featured DEV Posts from the Past Week
published: true
description: A round up of the most-read and most-loved contributions from the community this past week.
tags: icymi
cover_image: https://thepracticaldev.s3.amazonaws.com/i/sfwcvweirpf2qka2lg2b.png
---
_Every Tuesday we round up the previous week's top posts based on traffic, engagement, and a hint of editorial curation. The typical week starts on Monday and ends on Sunday, but don't worry, we take into account posts that are published later in the week._ 


##  Happy Hacktoberfest!

Hacktoberfest is here and this post from @ayushi7rawat is a great primer on what it's all about. We hope all participants have a blast this month! _Pro tip; We're celebrating on DEV, too! Learn how to maximize your Hacktoberfest experience in partnership with this community [here](https://dev.to/devteam/hacktoberfest-2021-is-here-4a3l)._

{% link https://dev.to/ayushi7rawat/beginner-s-guide-to-hacktoberfest-2021-24d1 %}

## Mere Semantics (... are crucial!)

"A semantically correct HTML tag informs the browser and the developer about its content. It also helps keyboards and assistive technologies to navigate through a website." 

-@polgarj

I learned a lot from this article and I hope you do, too!

{% link https://dev.to/polgarj/a-short-guide-to-help-you-pick-the-correct-html-tag-56l9 %}

## Promises, Promises

A clear and concise explanation of promises and async/await in JavaScript — with a singing analogy 🎤 Thanks, @santan47

{% link https://dev.to/santan47/promise-async-await-in-javascript-mlb %}

## The Doppler Effect: Securing and Managing Your Facebook & Google API keys.

Following the widespread Facebook outage this week, proper organization and security of Facebook (and Google!) processes is top of mind. @zion delivers with this tutorial all about using Doppler to manage API keys securely and in a straightforward manner. 

{% link https://dev.to/zion/facebook-and-google-authentication-with-node-js-and-doppler-maf %}


## Mind = Blown 

@trekhleb shows us how train a car in a simulator to do self-parking using a genetic algorithm — need I say more? So cool.

{% link https://dev.to/trekhleb/self-parking-car-in-500-lines-of-code-58ea %}

## What it Means to Have Good Commits — and How to Accomplish It. 

Another super relevant guide for Hacktoberfest! @mishmanners reviews how to make good commits and how good commits make you a great team player in this article

{% link https://dev.to/mishmanners/how-to-make-a-good-git-commit-1ed7 %}

## How Chris Got the Job

HUGE congrats to @dailydevtips1 for landing a job at Daily.dev. Find out how he made it happen in this post. 

{% link https://dev.to/dailydevtips1/how-i-landed-a-job-at-daily-dev-50ii %}



_That's it for our weekly wrap up! Keep an eye on dev.to this week for daily content and discussions...and if you miss anything, we'll be sure to recap it next Tuesday!_
Intro to Blockchain: Providers
Published: 2021-10-05 17:26:45

What exactly is a provider? A provider is an instance of what we are using to connect to a node on a blockchain. To connect to a node, there are a couple of providers we can use. Lets just go over the basic ones like MetaMask and Infura. 

Lets go over Infura first. Infura can be used anywhere. From a local script to a website online. How it works is that you grab your infura API key and with that you can create a new provider instance. This works well because you just need to plug in and go with it.

With MetaMask, you actually have to be on a browser. Since MetaMask is a browser extension, to access its API, you need to be on a browser with MetaMask enabled. If MetaMask is enabled, MetaMask will inject it's API into the DOM, accessible to us with `window.ethereum`.
Intro to Blockchain: Ethers JS Contract Instances
Published: 2021-10-05 17:19:22

What is Ethers JS? Ethers JS is a Javascript library that serves to allow your webapp interact with the Ethereum Blockchain. Its competitor library is Web3 JS but here we will be talking about Ethers. 

To get started, lets get familiar with the top 3 things you will need to properly communicate with a smart contract. First you will need a Provider, second a Signer, and lastly, a Contract.

What are these things? Lets break it down.

A Provider is what actually connects us the nodes that are in the blockchain. With Ethers JS we would do this by 
`new ethers.providers.Web3Provider(INSERT_PROVIDER_HERE)`.
This is creating a new instance of a provider with Ethers JS.

A Signer is actually just an abstraction of the users wallet address. This is what actually allows us to send over a signed transaction by use of our wallets address. And to do this you simply grab the provider you just made, and call `provider.getSigner()` on it. This will return a new Signer instance that you can use to send over signed transactions.

A contract instance is the most important part. To create a new instance of a contract, you need to pass in a couple things. First pass in the address of where the contract is deployed, whether it be locally, on a testnet, or the actual mainnet. Second we need to pass in the contracts ABI. And lastly we need to either pass in a provider or a signer.

What can we do with a contract instance? With a contract instance, we can call all the functions that are stored on the smart contract. We can communicate with the smart contract anyway we want. Up next is should we pass in a provider or a signer? If you pass in a provider to this contract instance, that instance will only be able to perform read-only functions. Whereas if you pass in a signer, that instance will be able to run both read and write functions.
`new ethers.Contract(ADDRESS, ABI, SIGNER OR PROVIDER)`
Review Using Props with Stateless Functional Components

Tags: javascript, devops, beginners, react
Published: 2021-10-05 17:15:39

* We've been passing props to stateless functional components. These components act like pure functions. They accept props as input and return the same view every time they are passed the same props.

1. A stateless functional component is any function you write which accepts props and returns JSX. 
2. A stateless component, on the other hand, is a class that extends React.Component, but does not use internal state (covered in the next post).
3. A stateful component is a class component that does maintain its own internal state. You may see stateful components referred to simply as components or React components.

* FreeCodeCamp now shows us the code editor thas a `CampSite` component that renders a `Camper` component as a child. They want us to define the `Camper` component and assign it default props of `{ name: 'CamperBot' }`. We can render any code that we want but it has to have a p element that includes only the name value that is passed in as a prop. We should define propTypes on the Camper component to require name to be provided as a prop and verify that it is of type string.
```JSX
class CampSite extends React.Component {
  constructor(props) {
    super(props);
  }
  render() {
    return (
      <div>
        <Camper/>
      </div>
    );
  }
};
{/* Change code below this line*/}
```
Answer:
```JSX
{/* Change code below this line*/}
const Camper = (props) => {
  return <p>{props.name}</p>
}
Camper.defaultProps = {name: 'CamperBot'}
Camper.propTypes = { name: PropTypes.string.isRequired}
```


Larson, Q., 2019. Review Using Props with Stateless Functional Components. [online] Freecodecamp.org. Available at: <https://www.freecodecamp.org/learn/front-end-development-libraries/react/add-comments-in-jsx>
Technology List
Tags: b2b, technology, email, list
Published: 2021-10-05 16:46:20

Technology Users List from DataInfometrix can assist you to reach prospects and audiences. You would always want to consistently register profits through increased sales. Technology List makes this dream of business sustainability a reality amidst healthy competition, there arises an urgent got to stay in constant touch together with your customers. Bringing to the fore the advantage of professional networking for business expansion, your look for a business information provider ends with DataInfometrix. For more details call us at (786) 652 9092.                                                                                                                                      To know more visit: www.datainfometrix.com
https://www.datainfometrix.com/technology-users-list/
Tuesday’s Tip – Start Blogging
Tags: tuesdaystip, communication
Published: 2021-10-13 15:46:38

---
title: Tuesday’s Tip – Start Blogging
published: true
date: 2021-10-05 16:44:00 UTC
tags: TuesdaysTip,communication
canonical_url: https://www.30minuteproject.com/2021/10/05/tuesdays-tip-start-blogging/?utm_source=rss&utm_medium=rss&utm_campaign=tuesdays-tip-start-blogging
---

## Blogging will help improve your communication skills as well as start to get your name out there in the software development community.

What to blog about:

- Issues you've come across and fixed (ideally with links to StackOverflow questions)
- Industry trends you see happening
- New technologies or frameworks you've been playing with
- Things you don't fully understand (Other people may have the same issue!)

All of these things help you improve your critical thinking as well as your ability to teach things to your fellow developers. Getting your ideas across to others in a clear and concise way can also increase your visibility at work.

Popular blogging platforms to help you get started: [wordpress.org](https://wordpress.org) and [dev.to](https://dev.to)

![](http://www.30minuteproject.com/wp-content/uploads/2021/10/Tuesdays-Tip-October-5-2021-120x300.png)

Get your free ebook

"The 30-Minute Project: How to improve Your Side Project Game to Become a Better Developer"
at [30-Minute Project](https://www.30minuteproject.com/contact/)
How to schedule a task at a specific time in Go
Tags: cron, go, time, programming
Published: 2021-10-05 16:32:05

Looking at Google search traffic, I've seen an increase in queries for "_How to schedule task at specific time in Go_" leading to [my other article about scheduling in Go](https://stephenafamo.com/blog/posts/better-scheduling-in-go).

So I've decided to create this article to directly answer the question. You can read [the other article](https://stephenafamo.com/blog/posts/better-scheduling-in-go) for a more detailed look at scheduling in Go.

## The one\-liner

You can block until your specified time before continuing execution using this one\-liner.

```go
time.Sleep(time.Until(until))

```

For example:

```go
func main() {
	// when we want to wait till
	until, _ := time.Parse(time.RFC3339, "2023-06-22T15:04:05+02:00")

	// and now we wait
	time.Sleep(time.Until(until))

	// Do what ever we want..... 🎉
}

```

## Exiting early

In real world use, it is likely that there are cases where you want to stop the schedule prematurely, to do this, we can accept a `context.Context` and exit if the context is canceled.

This also has the benefit of properly stopping the timer if it is no longer needed

```go
func waitUntil(ctx context.Context, until time.Time) {
	timer := time.NewTimer(time.Until(until))
	defer timer.Stop()

	select {
	case <-timer.C:
		return
	case <-ctx.Done():
		return
	}
}
```

Example:

```go
func main() {
	// our context, for now we use context.Background()
	ctx := context.Background()

	// when we want to wait till
	until, _ := time.Parse(time.RFC3339, "2023-06-22T15:04:05+02:00")

	// and now we wait
	waitUntil(ctx, until)

	// Do what ever we want..... 🎉
}
```
Two ways to integrate Javadoc into IntelliJ IDEA
Tags: java, programming, beginners
Published: 2021-10-05 15:55:33

---
title: Two ways to integrate Javadoc into IntelliJ IDEA
published: true
description: Do you still Google for Javadoc? You can see actually see Javadoc any time you want just by hovering on any piece of code in IntelliJ!
series: IntelliJ Life Hacks
tags: java,programming,beginners
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/onwfyw57970drsygytnv.jpg
---

Do you Google for Javadoc? Isn't it annoying? Picture this: you're in a flow state, with a full stack on your mind, and a good couple dozen business concepts thrown in, and you just want to double-check the behavior of a given library method. Do you really want to stop what you're doing, open a browser, search for the library documentation, make sure you are looking at the right version, and then navigate to the class and method in question?

You don't have to!

Here are two fast and easy ways to add Javadoc to IntelliJ so you can see it using the "Quick Documentation" feature: simply hover your mouse on any piece of code or use the Quick Documentation shortcut key, Ctrl+Q for Linux or Windows and F1 on macOS!

Now, on to the first way.

## Using Maven

On Maven projects, run the `dependency:resolve` phase with `classifier=javadoc` and IntelliJ will automatically acquire documentation superpowers.

There are two ways to run this. First, you can run the following Maven command from the terminal inside the root directory for the project:

```shell
$ mvn dependency:resolve -Dclassifier=javadoc
```

You can also run that from the "Execute Maven goal" window, which appears when you open the Maven tool window (View > Tool windows > Maven) and press the "M" icon.

![The Execute Maven Goal window in IntelliJ](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wy9sigyoogrweb805bl3.png)

If you want, you can even tell Maven to _always_ download Javadoc when available. Navigate to Preferences > Build, Execution, Deployment > Build Tools > Maven > Importing and check the Automatically download documentation checkbox.

## With a URL or Jar file

Do you have a URL to some Javadoc on the web? Then open Project Structure, navigate to Libraries, and click the icon that combines a "+" and a globe.

![The Libraries UI in IntelliJ](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qo81b2lojco9tlki6uiv.png)

Paste the URL and save it.

If you happen to have the javadoc in a jar file instead, you can use the normal "+" icon you see in this same Project Structure > Libraries window.

## What it looks like

With any of those settings in place, you can simply hover your mouse on any piece of code and see the resulting Javadoc.

![Quick Documentation view in IntelliJ](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bhc7rtw2lqenng6174lo.png)

## Conclusion

With Javadoc just a mouse-hover away, you can remain focused on the task at hand rather than disrupting your flow and going on a wild goose chase.

> Photo by Miriam Espacio from Pexels
Kinesis 101
Published: 2021-10-05 15:52:17

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/icgo5d6o3sd9edobvrkr.png)
 

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h9ea6aaeb8qlu7x19ke4.png)


![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/21479gik34xcm2xjv4sr.png)

example -
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dg058giggb6mp5yxigke.png)
Test Optimized Development
Tags: testing, webdev, react, opinion
Published: 2021-10-05 15:30:38

As devs, we’re taught to write tests first, then refactor until the tests pass. This is difficult if you don’t know your design first and frustrating if you have the functionality, but the tests aren’t passing.

Which is why, if you write your code to where it can be tested easily, everyone wins.

## Using Functional Programming vs. Class-based components
The concept is not new. Writing functions vs. classes is much more efficient. While you can easily instantiate a class and have everything you need, they are hard to test when it comes to React. Breaking just about everything into functions and utilities allows your code to be tested with ease and code coverage is boiled up using abstract methods vs complex classes.

## Maps, ForEach, other loopy things? Use a function for that, too.
Unless the operation is super simple, define a named function for what happens within a map() or forEach() loop which can be isolated and tested.

## Quality over Quantity
It’s super easy to pad code coverage these days. Just test to see if something mounts without breaking and tada! You’ve got super high code coverage…but what did you test, really? TOD expects that your tests should be value over volume. If you have a lot of code that flows through a small area or maybe you already have methods that are shared throughout your code base. Start there. If there’s one small break in that code, it will wreck the most.

## Quality Multiplied
Now that we a test that adds value over volume, what other scenarios can we throw at it. Don’t settle for just one scenario. Cover multiple. Got several test cases you want to iron out? Write a function for it and make your tests DRY.
New in Devart Entity Developer 6.12: More Data Types and Template Improvements
Tags: entitydeveloper, entityframeworkcore
Published: 2021-10-05 15:24:10

---
title: New in Devart Entity Developer 6.12: More Data Types and Template Improvements
published: true
description: Devart released a new version of Entity Developer 6.12 which mainly focuses on Entity Framework Core support improvements. 
tags: entitydeveloper, entityframeworkcore
//cover_image: https://direct_url_to_image.jpg
---
Devart, a recognized vendor of world-class data connectivity solutions for various data connection technologies and frameworks, rolled out the new release of [Entity Developer 6.12](https://www.devart.com/entitydeveloper/?utm_source=devto &utm_medium=referral&utm_campaign=pr_entitydeveloper_05.10.2021) based on the users’ feedback. The main updates focus on Entity Framework Core support improvements. 

**The list of improvements includes:**

- The list of types becomes larger:

The new 6.12 version adds Uri type which is used for EF Core 3, EF Core 5, and EF Core 6 models.

.NET 6 also provides new DateOnly and TimeOnly types in addition to universal classical DateTime and TimeSpan types. 

- The new release has additional security features. Entity Developer supports storing connection strings in its storage. The strings are still linked to the EF Core models, but are stored separately, in the Entity Developer settings directory for the current user.
That’s why users can discard saving the connection string in the model file completely. 


- Meet Code Generation Template Improvements:

The new “Generate UnitOfWork Repository Properties” can now generate the IUnitOfWork interface with properties for accessing all the repositories.

The Data Transfer Object (DTO) template now allows generating DataAnnotation attributes for properties of DTO classes for all ORMs.

The new “Enum Output” property is available in the EF Core template which provides the opportunity to specify output for generated enums.

Entity Framework Core 6 has discontinued .NET 5 support and supports .NET 6 only. .NET 6 support has also been removed from Visual Studio 2019 Preview and is available only in Visual Studio 2022. Thus, Entity Developer supports EF Core 6 models only in the standalone and console versions, as it doesn’t yet support integration to Visual Studio 2022.

**Entity Developer** is a powerful ORM designer for ADO.NET Entity Framework, Entity Framework Core, NHibernate, LinqConnect, Telerik Data Access, and LINQ to SQL. It introduces new approaches for designing ORM models, boosts productivity, and facilitates the development of database applications.

To learn more about the recent release and download new products, visit: 
https://blog.devart.com/entity-developer-6-12-with-more-data-types-template-improvements-and-more.html


**About Devart** 
 
Devart is one of the leading developers of database tools and administration software, ALM solutions, data providers for various database servers, data integration, and backup solutions. The company also implements Web and Mobile development projects.
 
For additional information about Devart, visit https://www.devart.com/.
[TIP] - Laravel API Response Helpers
Tags: laravel, api, helpers, package
Published: 2021-10-05 15:17:44

Este artigo é uma dica para quem já trabalhou com API REST no Laravel ou irá precisar trabalhar. O objetivo desse pacote é garantir respostas consistentes e padronizadas em toda sua aplicação Laravel. 

Quem já trabalhou em projetos legados ou até mesmo novos se forem mal escritos, provavelmente já se deparou com uma infinidade de métodos usados para retornar um erro ou mensagem de sucesso. Além disso, não é difícil de encontrar problemas de retornar o status code errado, como por exemplo uma mensagem de erro que retorna 200, como mostra na imagem abaixo: 
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u144jp2mmlw9dh0c2h2t.png)

# Sobre o pacote 
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y60qrcikkq3soupnbsvc.png)
O pacote você pode encontrar a sua documentação nesse repositório https://github.com/f9webltd/laravel-api-response-helpers , a proposta é de fato ser simples e garantir respostas consistentes da API no seu projeto Laravel. Para utilizar é preciso ter as seguintes especificações:
- PHP `^7.4 | ^8.0`
- Laravel 6, 7 and 8


# Instalação
`composer require f9webltd/laravel-api-response-helpers`

# Exemplo de uso

```php
<?php

namespace App\Http\Api\Controllers;

use F9Web\ApiResponseHelpers;
use Illuminate\Http\JsonResponse;

class OrdersController
{
    use ApiResponseHelpers;

    public function index(): JsonResponse
    {
        return $this->respondWithSuccess();
    }
}
```
# Alguns métodos disponíveis 

#### `respondNotFound(string|Exception $message, ?string $key = 'error')`

Retorna o código de status HTTP  `404`, e opcionalmente pode receber um exceção personalizada. 

#### `respondWithSuccess(array|Arrayable|JsonSerializable|null $contents = [])`

 Retorna o código de status HTTP  `200` 

#### `respondUnAuthenticated(?string $message = null)`

Retorna o código de status HTTP  `401`

#### `respondForbidden(?string $message = null)`

Retorna o código de status HTTP  `403` 

#### `respondError(?string $message = null)`

Retorna o código de status HTTP  `400`

#### `respondCreated(array|Arrayable|JsonSerializable|null $data = [])`

Retorna o código de status HTTP  `201`, e como opcional você pode passar um `data` que é devolvido na resposta. 

Esse são alguns métodos mas você pode conferir mais explorando a [documentação oficial](https://github.com/f9webltd/laravel-api-response-helpers) do pacote. 

E ai, curtiram a dica?
 
# Fonte
- https://laravel-news.com/laravel-api-response-helpers
- https://github.com/f9webltd/laravel-api-response-helpers
Why typescript is needed? 
Tags: javascript, typescript
Published: 2021-10-05 15:09:23

Continuing on typescript, let's know why typescript is needed.Major two reasons are:
- Static Type checker
- Tooling

###### I will be referring to typescript as "TS" and javascript as "JS" from now on.  

### Static Type checker
Imagine what happens when we run the following code in JS 

```
function greet(person, date) {
    console.log(`Hello ${person}, today is ${date.toDateString()}!`);
}
greet("Abhirup");
```
It will throw a typeerror !!
```
console.log(`Hello ${person}, today is ${date.toDateString()}!`); 
                                              ^
TypeError: Cannot read property 'toDateString' of undefined
```
Why?  Because the date param of greet is undefined and so toDateString of undefined throws error.But we got to know of this error while running only.

Now if we paste the same code in the .ts file.

![typescript2](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2dtz26286r1ayank02tl.PNG)
Without running our file we got to know the error(red squiggly line 6) and hence we can quickly fix it.

### Tooling
It means first class support of typescript by the popular IDEs and code editors.
[Check this link for more](https://github.com/Microsoft/TypeScript/wiki/TypeScript-Editor-Support).
Whenever we hover mouse on the error "squiggly" lines, we get to know of the potential fix.Also we can "click" on the variable to check the reference etc.

------------------------------------------------------------------

Please do like and share this blog.