teleren/devto huggingface dataset:
Updating Node.js to 16+ in Replit
Tags: node, replit, javascript, v16
Published: 2021-08-21 15:42:55

Hey There,
Welcome to my first post, today i'll tell you how can you update your [Replit](https://replit.com/)'s [Nodejs](https://nodejs.dev/) version to 16+, so lets get started. 

Many want to do that as to support [Discord](https://discordjs.guide/)'s latest v13 as it would only run on [Nodejs](https://nodejs.dev/) v16.6 or higher. But there maybe your own reasons (Nobody likes old versions 😅).

Here's our repl at version 12.x.x after this tutorial it will be updated to 16+
![Unupdated Repl](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fhti8xzbpzsujxceh32o.png)

At first go to your `repl` or if you don't have any just create one.

Go to the `shell prompt` and run the following code

```bash
npm init -y && npm i --save-dev node@16 && npm config set prefix=$(pwd)/node_modules/node && export PATH=$(pwd)/node_modules/node/bin:$PATH
```
![Shell with code](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/clhm66g6yv5dtli0mcer.png)

After running the code you would see the following output:

![Shell after Run](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cam7gfk1d86g38mcz8ot.png)

 
And congo 🎉 your repl's nodejs has been successfully updated to 16+. 
You could further confirm it by running `node -v` in the shell


![Success](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5ka4desxua80e6tokpz2.png)

**Update:** There's another better way to do this now just use the Node 16 template while creating the repl
https://replit.com/@RoBlockHead/NodeJS-16
What to write in a architecture detail document?
Tags: architecture
Published: 2021-08-21 15:39:07

You organization might have Technology Strategy, Technology Guidelines, Product standards, Product strategy. Each product or set of products might have architecture guidelines. You must ensure that your architecture is in line with those strategies and guidelines.
###### Architecture Concept Document(ACD)
According to the guidelines you prepare a document that represents all the concepts, the problem, the available solutions, the trade-offs and risks, the design of each solution, the execution plan etc. You can name it as Architecture Concept Document. It's a living document and should capture the current status of the software architecture.
###### Software Specification Document(SSD)
After you have taken the decision and defined the detail architecture, you create a Software Specification Document(SSD). And according to the SSD the development can start. 
#### Constant Upgradation is needed
During development you will come across issues that will result in adapting and refining the Architecture Concept Document. Thus, the Architecture is only final before you release your product. Even after that, during the maintenance period you might do major changes or add functionality. This should result in a change in architecture. You need to capture this in the architecture, otherwise your architecture becomes obsolete over time. You could maintain the document with versions. The versions before release, the final release version and the versions after release. You can prepare a short document that describes only the architecture of the finalized version for the product in another document as a bluebook.

Preparing an ACD or SSD is not the end of work for an architect, he needs to help forming teams who will implement the architecture according to the work package. He needs to outline the dependencies between the work packages or teams. He can also help provide an effort estimate and identify the skills needed for implementation. He often needs to lead various Proof of Concepts(PoCs) needs to be done.

#### What information should you write in that document? 
It should have an Executive Summary, a Preface section, an Overview section, an Introduction section, a Decision section. A section that addresses which components are being reused. How the software can be integrated with other software? How Security is ensured? How to Deploy, Migrate and Operation ? A Summary, few references and a Glossary.

Read details on the topic in the post [what to write in a architecture detail document](https://www.cloudnativemaster.com/post/what-to-write-in-a-architecture-detail-document).
Terraform datasources: http
Published: 2021-08-21 15:11:25

*Datasources* são recursos do Terraform que dão a possibilidade de buscar e usar informações definidas fora do Terraform (em outra configuração por exemplo) dentro do seu código.

Nesse post vou mostrar um pouco de um tipo de datasource que pode salvar bastante no dia a dia.

## Datasource `http`

Esse datasource basicamente faz uma requisição `GET` em uma dada URL e exporta o *body* e os *headers* da resposta como saída.
 
Exemplo:
Suponha que você precise criar um *security group* para uma EC2 na AWS e já adicionar seu endereço IP atual na lista de endereços permitidos, como poderíamos fazer?

Usando o datasource `http`:
```
data "http" "myip" {
  url = "https://api.ipify.org"

  # Opcional: header da requisição
  request_headers = {
    Accept = "application/text"
  }
}

output "myip" {
    description = "Endereço IP"
    value = data.http.myip.body
}
```
Nesse caso, foi feito um `GET` na URL https://api.ipify.org para buscar o IP atual com o *header* do tipo *text*, e a saída foi exposta via *output*.

É importante ressaltar que a URL consultada precisa responder `200 OK` e com um `Content-Type` do tipo `text/*` ou `application/json`.


## Referências
* https://registry.terraform.io/providers/hashicorp/http/latest/docs/data-sources/http
* https://www.terraform.io/docs/language/data-sources/index.html
HTML Tags, Attributes and Elements
Tags: html, webdev, codenewbie, beginners
Published: 2021-08-21 15:09:50

In this article, we will learn about **HTML tags, attributes, and elements**. If you are just starting with web development and HTML, you should be clear about these terms. 

## HTML Tags
> We have already covered tags in the article: [What is HTML - HyperText Markup Language](https://www.codingvarsity.com/articles/what-is-html---hypertext-markup-language). 

**Tags** give special meaning (semantics) to the text they enclose. 

To annotate a text as the most significant heading we can use the `<h1>` tag and annotate text as a paragraph we can use the `<p>` tag.

```html
<h1>I am the most significant heading</h1>

<p> I am a paragraph</p>
```

### Opening and closing tags

Tags that need to wrap the content have a **closing tag**. For example, paragraph `<p>` and headings `<h1> - <h6>`. 

```html
<p> I am a paragraph </p>

<h2> I am a heading </h2>
```

Tags that do not wrap the content, for them, the **closing tags** are not required. They are called **self-closing tags**. Examples are line break `<br/>` and horizontal rule `<hr/>`.

## HTML Attributes

**Attributes** are extra information about the tags. They are always specified in the opening tag. Attributes have a name and value. For example, for the `<img>` tag we need to specify the source (path of the image) which can be done using the `src` attribute. Same way for specifying the alternate text we use the `alt` attribute.

```html
<img src="/media/user/profile-pic.jpg" alt="profile pic"/>
```

## HTML Elements

The opening tag, closing tag, and content together create an **HTML Element**. For example, a paragraph element can be a simple `<p>` tag with some content or a nested element with other elements like `<a>` or `<span>`.  

```html
<p> I am a paragraph<p>

<p> 
  To read this article, visit 
   <a href=”/link-to-article”>coding varsity</a>
</p> 
```

> Tags, attributes, and elements are the foundation of any HTML document. 

## Summary

1. Tags give special meaning to the text they enclose in a document.
2. A **closing tag** is needed if the tag needs to wrap any content. Example of closing tags are `<p>`, `<h1>` etc. 
3. **Attributes** are extra information about tags. For example, the `<img>` tag has `src` and `alt` attributes. 
4. HTML tags along with the content they enclose are called **HTML elements**.
Day 179
Tags: 100daysofcode, programming
Published: 2021-08-21 15:08:00

Day 179/200 of  #100DaysOfCode 

- Solved three problems on Codewars.

1 -  Animals and Inheritance (7 kyu)
2 -  Cuboids, Cubes, and Getters (7 kyu)
3 -  Unlimited Sum (7 kyu)
Code Smell 85 - And Functions
Tags: oop, programming, webdev, codenewbie
Published: 2021-08-21 14:58:46

*Do not perform more than requested.*

> TL;DR: Unless you need atomicity, do not perform more than one task.

# Problems

- Coupling
- Single Responsibility Principle violation
- Readability
- Low Cohesion
- Testability

# Solutions

1. Break the function

# Sample Code

## Wrong

[Gist Url]: # (https://gist.github.com/mcsee/059b9deb2e9e13c94a724b82e54f6fda)
```python
def fetch_and_display_personnel():
  data = # ...
  
  for person in data:
    print(person)
```

## Right

[Gist Url]: # (https://gist.github.com/mcsee/47a1f8cd217afd58bc47b373b91593ef)
```python
def fetch_personnel():
  return # ...

def display_personnel(data):
  for person in data:
    print(person)
```

# Detection

Functions including "and" are candidates. However, we need to check them carefully since there might be false positives.

# Tags

- Readability
- Naming

# Conclusion

We should avoid doing more than needed, and our functions should be both minimal and atomic.

# More Info

- {% post https://dev.to/mcsee/what-exactly-is-a-name-part-ii-rehab-20gd %}

# Credits

Photo by <a href="https://unsplash.com/@causeimluap">Paul</a> on <a href="https://unsplash.com/s/photos/train">Unsplash</a>
  
This smell was inspired by

{% twitter 1428027665529769985 %}

* * *

> If it takes more than a sentence to explain what you are doing, it’s almost always a sign that what you are doing is too complicated.

_Sam Altman_

{% post https://dev.to/mcsee/software-engineering-great-quotes-26ci %}

* * *

This article is part of the CodeSmell Series.

{% post https://dev.to/mcsee/how-to-find-the-stinky-parts-of-your-code-1dbc %}
How to set up jest for es module
Tags: javascript, testing
Published: 2021-08-21 14:23:30

In this article, I will show a simple configuration to run jest tests for es module code.

# Jest
[Jest](https://jestjs.io/) is a test framework developed by Facebook & often used in applications that use React. It's simple to set up & can be used to test any JS application.

# Code
Simple code that uses export es module, `src/index.js`:
```JS
export function a() {
  return "function a";
}
```

# Test
Equally simple test, `src/index.spec.js`:
```JS
import { a } from "./index";

describe("function a", () => {
  it("should return expected value", () => {
    expect(a()).toEqual("function a");
  });
});
```

# Configuration
The default Jest configuration works fine with our example code. We need only one configuration file, `.babelrc`:
```JSON
{
  "env": {
    "test": {
      "plugins": ["@babel/plugin-transform-modules-commonjs"]
    }
  }
}
```

# Dependencies
We need to install the following depenendcies:
```shell
$ npm install --save-dev jest @babel/plugin-transform-modules-commonjs
```

# Execution
With all that in place, we can run our test:
```shell
npm run test

> es-module-jest@1.0.0 test /home/marcin/workspace/github/es-module-jest
> jest

 PASS  src/index.spec.js
  function a
    ✓ should return expected value (2 ms)

Test Suites: 1 passed, 1 total
Tests:       1 passed, 1 total
Snapshots:   0 total
Time:        0.329 s
Ran all test suites.
```

# Links
* [example repository](https://github.com/how-to-js/es-module-jest)

# Summary
In this article, we have seen a minimalistic setup to run Jest tests for es module code.
What I learned in 3 years of Web Dev?
Tags: javascript, career, webdev
Published: 2021-08-21 14:09:31

## 1. DSA is more important than learning any new framework.

## 2. Learn Javascript before learning any framework.

## 3. Learn how JS Engine works.

## 4. Always follow coding principles.

## 5. Make as many projects as you can.

Connect Me @ [Linkedin](https://www.linkedin.com/in/abhishekraj272/), [Github](https://github.com/abhishekraj272), [Twitter](https://twitter.com/abhishekraj272) 😇
ASP.NET Core Service Lifetimes (Infographic)
Tags: aspnetcore, infographic, services, lifetime
Published: 2021-08-21 13:44:30

ASP.NET Core supports the dependency injection (DI) software design pattern that allows us to register services and control how these services will be instantiated and injected in different components. Some services will be instantiated for a short time and will be available only in a particular component and request. Some will be instantiated just once and will be available throughout the application. Here are the service lifetimes available in ASP.NET Core.

## Singleton

A single instance of the service class is created, stored in memory and reused throughout the application. We can use Singleton for services that are expensive to instantiate. We can register Singleton service using the **AddSingleton** method as follows:
```
services.AddSingleton<IProductService, ProductService>();
```
## Scoped

The service instance will be created once per request. All middlewares, MVC controllers, etc. that participate in handling of a single request will get the same instance. A good candidate for a scoped service is an Entity Framework context. We can register Scoped service using the **AddScoped** method as follows:
```
services.AddScoped<IProductService, ProductService>();
```
## Transient

Transient lifetime services are created each time they're requested. This lifetime works best for lightweight, stateless services. We can register Transient service using the **AddTransient** method as follows:
```
services.AddTransient<IProductService, ProductService>();
```
If you want to visualize the above concepts then here is an infographic for your quick reference.

![ASP.NET Core Service Lifetimes Infographic](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r7i6rm0snbvjub4z3eo6.png)
13 Reasons to Learn ASP.NET Core in 2021 (Infographic)
Tags: aspnetcore, learn, infographic, aspnet
Published: 2021-08-21 13:41:30

ASP.NET Core is a new open-source framework from Microsoft and it allows you to build modern, cross-platform, high-performance cloud based, web apps and services. Millions of developers are using ASP.NET Core world wide to developer state of the art web applications and high performance cloud services. If you have not develop anything using this framework and you are confused then this infographic will give you plenty of reasons to start learning this framework in 2021.

![13 Reasons to Learn ASP.NET Core in 2021 (Infographic)](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i2tyhv5csaewecjeqjk8.png)
PyLadies Dublin Aug Meetup: HuggingFace Transformers || PySparks 101
Tags: pyladies, python, pysparks, video
Published: 2021-08-21 13:19:48

![thank you](https://media.giphy.com/media/5ArJanyCfxgiY/giphy.gif?cid=ecf05e471ccncoog9yzlyqb1ipzad15r7hud70kwtuffojfw&rid=giphy.gif&ct=g)

A huge thank you to all who attended or were interest in our recent [PyLadies Dublin meetup](https://www.meetup.com/PyLadiesDublin/events/279318562/) this month.

![clapping](https://media.giphy.com/media/DKqH1q9gN5AKA/giphy.gif?cid=ecf05e47iif01m572j9z819ajbva321f5hacebwylx8sjlz8&rid=giphy.gif&ct=g)

👏 To Olga, Sahana and Megan for speaking and [Optum](https://www.optum.com/) for sponsoring the prizes and being our community partner this month.

🌈 To [Imagi](https://imagilabs.com/) and [Coding Grace](https://codinggrace.com) as our community partners this month.

🎉 To Vikkas and Greg for winning the raffle (which were Chromecast and Google Assistant).

❤️ And a huge thanks to [Lei Shao](https://twitter.com/lei_shao1) and [Mick Twomey](https://twitter.com/micktwomey) for co-hosting, without your help, I'd be a mess. 😂 

![announcements](https://media.giphy.com/media/3vqFacjAkdZ71tTlUn/giphy.gif?cid=ecf05e47r8lhrhn0h2wfpvgq0nr6yg3zhahyfcag3y8cq688&rid=giphy.gif&ct=g)
## 📰 Announcements 
Here are the announcements from the event including the links to slides, notebooks: 

* https://twomeylee.notion.site/PyLadies-Dublin-August-2021-with-Optum-420c06d447264625befa701c9a5b7c07

---

### 🗓 Next PyLadies Dublin
* Sep 21, 18:30 - 19:30 (Irish Time)
* https://www.meetup.com/PyLadiesDublin/events/280237470/

📢 Call for Speakers (from Sep onwards)
Interested in speaking or know someone who has something awesome to show at our upcoming meetups, send them on via https://pyladiesdublin.typeform.com/to/VvW3iME6

🤔 If you have ideas for talks, workshops, something we haven't done before, or general questions of any kind, drop us an email at dublin@pyladies.com.

🍿 Finally, you can also find the live-streamed video with chapters at our Youtube channel, here's the direct link to the vid itself: https://youtu.be/FCpCBuIzGLY
![like and subscribe](https://media.giphy.com/media/73oSygWJFG9K1ha75z/giphy.gif?cid=ecf05e47nwg9avn1yvgq29xqv1idp3j9hjy7r28rg0fyoh82&rid=giphy.gif&ct=g)
And yes, please like and subscribe and hit that 🔔 to get notified of our next live-streams and videos.
What are the characteristics of a good software architecture?
Tags: architecture
Published: 2021-08-21 12:37:00

A good software product rarely has a bad or not so good architecture and a good architecture does not guarantee the product to be good. What do we mean when we say a software product is a good product ? What it takes to build a good software architecture ?

## What makes a piece of software good ?
To begin with, we can think of some software that we think is good , excellent, or best in breed. I leave that up to you, but as an example, you could nominate Google Maps, Microsoft Teams etc. The very next question you might already have guessed. Why do you think so? Then you start listing down its capabilities. Below I have listed a few of them that will come to your mind. Don't look at them. Prepare your pick, think what those architectural decisions could be.

It's not hard to guess even if you don't know the inner details on how the software works. The next questions will be why and how they are able to provide these capabilities. And if you think a bit more you will realize, they have taken few good architecture decisions that made the software usable, performant and loveable. If you look at all of the reasons that you like the software you will see the architecture has to address all of them from the very initial phase. The architecture has to incorporate these in itself to advocate these capabilities. Some of them are listed here
1. Standard
2. Extendable
3. Consistent
4. Documentation
5. Integration
6. Adapt changes
7. Ease of use and Configurable
8. Customizable
9. Performant
10. Scalable and resilient
11. Balancing trade-offs
12. Outage management
13. Cost effectiveness
14. Reliable and Secure
15. Robust
16. Agile

To read details read the post [what are the characteristics of a good software architecture](https://www.cloudnativemaster.com/post/what-are-the-characteristics-of-a-good-software-architecture)
delete all <none> image on docker with single command 🖥️
Published: 2021-08-21 12:14:14

Ciao!

If docker images being failed to run certain command, \<none> images will be generated and it can be very annoying.

This is how to easy delete it.

#### Delete Container.
If the \<none> images were used on container, active or not, you have to delete it first.

To list all containers, run this command on your terminal:
```sh
docker ps -a
``` 

To delete it, run this command. Make sure you delete container with \<none> image.
```sh
docker container rm <your-container-name>
```

#### Delete All \<none> Images.
You can delete all those images just with this single line command.

```sh
docker rmi $(docker images | grep "^<none>" | awk "{print $3}")
```

That's it. Thanks for reading!
Make Your WordPress Website Faster
Tags: wordpress, performance, webdev
Published: 2021-08-21 12:11:09

WordPress is very popular tool for website building. And the best tool for freelancers. All in all, 40% of all websites are built with WordPress.
But because it's easy to master, many people use it but not all of them built good websites.
Most of WordPress websites have speed and performance issues. But if you do everything correctly, you can build fast and lightweight websites with WP.
Here are some steps you should follow to create modern, clean, and fast WP websites.
## 1. Choose A Good Hosting
First and the most important thing for performance is hosting. It is critical to choose the best hosting platform you can find.
There are many great affordable hosting platforms. And almost all of them have specific hosting plans for WordPress.
Personally I recommend Cloudways. Its fast, affordable, and very easy to use.
## 2. Choose A Great Theme
Next, you need to choose a theme that is perfectly built for WP. There are tons of free or premium themes, but not every one of them performs well.
If you use Gutenberg, there are many [great templates](https://wpsum.com/best-gutenberg-themes/) you can use for free.
But if you want to build pages with Elementor, you can use the Hello theme.
## 3. Use Few Plugins
Plugins can cause not only bad performance, but also website hacking. So, you have to choose well-known plugins and as few as you can.
Use the plugin if you really need it. Must use plugins could be cache, SEO, security, and perhaps forms.
Do everything you can with your theme or page builder and try to avoid use of too many plugins.
## 4. Cache Is Mandatory
And one of the must use plugin is a caching plugin. Because WP is dynamic, you have to have cache installed to decrease page load speed.
There are great cache plugins like [WP Rocket](https://wp-rocket.me/), but also you can try some free plugins like [Hummingbird](https://wordpress.org/plugins/hummingbird-performance/) or [WP Optimize](https://wordpress.org/plugins/wp-optimize/).
Some hosting platforms suggest their own caching, but I don't like them.
Also, you can use some server side caching like Redis.
## 5. Optimize Images
And the last thing you can do for increasing the page load speed is to optimize images. Image optimization includes choosing the right dimensions and also compressing.
Because WordPress creates several image sizes when you upload them, you need to know which size you need to upload to make fewer image versions.
Also, compress them before uploading. You can use tools such as [TinyPNG](https://tinypng.com/) for image compression.
Also, since WordPress 5.8 supports WebP image format, you can convert JPEG to WebP and it will increase page speed a lot.
## Wrap Up
So, if you want to build websites with WordPress, you should consider this steps. No matter what kind of website you build - big or small - you need to have a fast website. Its crucial for user experience and also for Google. A website won't rank because of a bad performance.
Today's Daily Humor For Devs - Daily Developer Jokes
Tags: jokes, dailydeveloperjokes
Published: 2021-08-21 12:00:08

---
title: "Today's Daily Humor For Devs - Daily Developer Jokes"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
published: true
tags: #jokes, #dailydeveloperjokes
---

Hi there! Here's today's Daily Developer Joke. We hope you enjoy it; it's a good one.

![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e1259b9b89f4.png)

---

For more jokes, and to submit your own joke to get featured, check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/). We're also open sourced, so feel free to view [our GitHub Profile](https://github.com/dailydeveloperjokes).

### Leave this post a ❤️ if you liked today's joke, and stay tuned for tomorrow's joke too!

_This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit._

<!--
Joke text:
___Q:___ What do you call optimistic front-end developers?

___A:___ Stack half-full developers.
 -->