teleren/devto huggingface dataset:
What's new in Node.js version 19?
Tags: node, javascript, webdev, news
Published: 2022-11-25 14:06:58

[![Watch the video](https://img.youtube.com/vi/jaZNHsbYnHQ/0.jpg)](https://youtu.be/jaZNHsbYnHQ?autoplay=1)

### What's new in Node.js 19?

A week ago, Node.js 19 was released Which includes the update of the V8 JavaScript engine to 10.7, and HTTP 1.1 KeepAlive enabled by default.

Important features of the release::

#### Watch mode

This is an experimental feature. It allows you to run node application with the --watch flag, which will restart the node process when it detects changes in the directory. This feature is useful for development. It is similar to the nodemon.

---

#### HTTP 1.1 KeepAlive enabled by default

HTTP 1.1 KeepAlive is enabled by default. This feature is useful for performance. It allows the TCP connection to remain open for multiple requests. This reduces the time required to set up new TCP connections. The default keep-alive duration is 5 seconds.

---

#### Stable WebCrypto

Stable WebCrypto is now available in Node.js. It is a standard cryptographic API for the web platform. It provides a secure and performant way to handle cryptographic operations. The WebCrypto API is available globally in Node.js. It can be accessed using crypto.webcrypto global object.

---

#### V8 JavaScript engine update to 10.7

The V8 engine is updated to version 10.7, which is part of Chromium 107. This version includes a new feature to the Javascript API.

---

Also, Node 14 is now in maintenance mode. It will be supported until April 2023. If you are using Node 14, you should upgrade to Node 16. Node 16 is the current LTS version. It will be supported until April 2024.

---

Thank you for reading 😊

Got any additional questions? please leave a comment.
---

##### Must Read If you haven't

###### [3 steps to create custom state management library with React and Context API](https://dev.to/devsmitra/3-steps-to-create-custom-state-management-library-with-react-hooks-and-context-api-1bfh)

###### [How to cancel Javascript API request with AbortController](https://dev.to/devsmitra/how-to-cancel-javascript-api-request-with-abortcontroller-36cm)

###### [Getting started with SolidJs – A Beginner's Guide](https://dev.to/devsmitra/getting-started-with-solidjs-a-beginners-guide-5af4)

---

###### More content at [Dev.to](https://dev.to/devsmitra "Rahul Sharma(DevsMitra)").

###### Catch me on [YouTube](https://www.youtube.com/channel/UCQkvNcHN5vg3jEoeOb9Tdrw?sub_confirmation=1 "Rahul Sharma(DevsMitra)"), [Github](https://github.com/devsmitra "Rahul Sharma(DevsMitra)"), [Twitter](https://twitter.com/devsmitraa "Rahul Sharma(DevsMitra)"), [LinkedIn](https://www.linkedin.com/in/rahul-sharma-18b8b374 "Rahul Sharma(DevsMitra)"), [Medium](https://devsmitra.medium.com "Rahul Sharma(DevsMitra)"), [Stackblitz](https://stackblitz.com/@devsmitra "Rahul Sharma(DevsMitra)"), [Hashnode](https://devsmitra.hashnode.dev "Rahul Sharma(DevsMitra)"), [HackerNoon] (https://hackernoon.com/u/devsmitra "Rahul Sharma(DevsMitra)"), and [Blogspot](https://devsmitra.blogspot.com "Rahul Sharma(DevsMitra)").
Order of __init__ and __del__
Tags: python
Published: 2022-11-25 14:02:34

The order of calls to `__del__` surprised me. In Python:
```python 
class A:
    def __init__ (self):
        print ("A.__init__")
    def __del__ (self):
        print("A.__del__")

class B:
    def __init__ (self):
        print ("B.__init__")
    def __del__ (self):
        print ("B.__del__")

def fn():
    a = A()
    b = B()

fn ()
"""
Produces this output:
A.__init__
B.__init__
A.__del__
B.__del__
"""
```

I expected `__del__` to be called in reverse order (ABBA). The reverse order matches [C++ behavior](https://isocpp.org/wiki/faq/dtors#order-dtors-for-locals).

An alternative to guarantee order is `__enter__` and `__exit__` and use of the `with` block:

```python
class A:
    def __enter__ (self):
        print ("A.__enter__")
    def __exit__ (self, exc_type, exc_val, exc_tb):
        print("A.__exit__")

class B:
    def __enter__ (self):
        print ("B.__enter__")
    def __exit__ (self, exc_type, exc_val, exc_tb):
        print ("B.__exit__")

def fn():
    with A() as a, B() as b:
        pass

fn ()

"""
Produces this output:
A.__enter__
B.__enter__
B.__exit__
A.__exit__
"""
```

The standard [guarantees the order](https://docs.python.org/dev/reference/compound_stmts.html#with):


> With more than one item, the context managers are processed as if multiple with statements were nested:
> 
> ```python
> with A() as a, B() as b:
>     SUITE
> ```
> is semantically equivalent to:
>
> ```python
> with A() as a:
>     with B() as b:
>         SUITE
> ```
Christmas Brownies Recipe: A Beautiful And Healthy Food For Christmas- Global Continent
Tags: webdev, javascript, beginners, programming
Published: 2022-11-25 14:01:10

**Christmas Brownies Recipe: A Beautiful And Healthy Food For Christmas**

**overview of Christmas Brownies Recipe;**

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


**What is Christmas Brownies Recipe?**
Adding green icing and candies transforms a straightforward brownie recipe into something extraordinary. We bake the brownies in circular cake pans to make cutting them into triangular shapes simple and waste-free.

Related [Salami Roll Recipe of Professional Style — Global Continent](https://globalcontinent.blogspot.com/2022/11/salami-roll-recipe-of-professional-style.html)

**Cook Time Detail of Christmas Brownies Recipe:**
Total cook time Prep Time Cook Time Recipe servings

1 hrs. 25 mins. 35 mins. 10

Related [New Orleans Muffuletta Sandwich Recipe With Professional Style — Global Continent](https://globalcontinent.blogspot.com/2022/11/new-orleans-muffuletta-sandwich-recipe.html)
**
Ingredients of Christmas Brownies Recipe:**

1. 200 gms dark chocolate (best quality, 70% cocoa solids))
2. 150 gms plain flour
3. 1 tsp baking powder
4. A pinch of salt
5. 120 gms soft butter, unsalted
6. 200 gms vanilla sugar
7. 2 Eggs
8. 1 Egg yolk
9. 4 tbsp coffee (freshly made, strong)
10. For buttercream:
11. 140 gms softened butter
12. 280 gms icing sugar
13. Edible green color (few drops)

Related Make “Roast Turkey with Cranberry Sauce” Recipe Eat and Enjoy — Global Continent

**How to Make Christmas Brownies Recipe**

- Set the oven to 180 ° C
- Use aluminum foil to line the bottom and edges of a 30 x 22 cm roasting pan or baking dish.
- Break the chocolate into pieces and melt it slowly over a pot of boiling water or in a double boiler.
- Combine the salt, baking soda, and flour in a bowl. [read more](https://globalcontinent.blogspot.com/2022/11/christmas-brownies-recipe-beautiful-and.html)
Send mail from Outlook using SmtpClient
Tags: csharp, smtp, mail
Published: 2022-11-25 13:56:01

From [James](https://dev.to/henryjs)' comment:
**DO NOT USE SMTPCLIENT IN PRODUCTION.** It doesn't support modern protocols and is now obsolete. Use Mailkit or FluentEmail instead.
[Read the Remarks section of Microsoft's docs for more info](https://learn.microsoft.com/en-us/dotnet/api/system.net.mail.smtpclient?view=net-7.0#remarks)

---

Execution environment: Windows 11, .NET 6.0

Create a console application, paste the code in `Program.cs` and replace the following strings:

- sender@outlook.com: The Outlook account to send the letter.
- 123abc!: Outlook account password.
- receiver@gmail.com: The email address of the recipient.

```csharp
using System.Net.Mail;
using System.Net;

var message = new MailMessage();
message.From = new MailAddress("sender@outlook.com");
message.To.Add(new MailAddress("receiver@gmail.com"));
message.IsBodyHtml = true;
message.Subject = "My first smtp email!";
message.Body =
@"
<!DOCTYPE html>
<html>
<body>
    <h3>Hello Jack:</h3>
    <p>This is a Hello World email!</p>
</body>
</html>
";

try
{
    var client = new SmtpClient("smtp-mail.outlook.com", 587);
    client.Credentials = new NetworkCredential("sender@outlook.com", "123abc!");
    client.EnableSsl = true;
    client.Send(message);
}
catch (Exception e)
{
    Console.WriteLine(e);
}
```

Note that the letter may be considered spam the first time it is sent, so it will need to be manually moved to the inbox. The letter looks like the following:


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8rjn8dfptioh1asy8af0.png)
REST API A11.2021.13640
Published: 2022-11-25 13:33:18

## What I built
<?php

$file_db = "curhat.db";

try {
    $pdo = new PDO("sqlite:$file_db");
    $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    $pdo->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);

    $sql_create = "CREATE TABLE IF NOT EXISTS 'curhat' (
        'id' integer NOT NULL PRIMARY KEY AUTOINCREMENT,
        'nama' text NOT NULL, 
        'konten' text NOT NULL,
        'created_at' datetime NOT NULL DEFAULT CURRENT_TIMESTAMP)";
    $pdo->exec($sql_create);
} catch (PDOException $e) {
    throw new PDOException($e->getMessage(), (int)$e->getCode());
}

header('Content-Type: application/json');

/**
 * Method REST:
 * 
 * - GET: untuk mendapatkan data dari server
 * - POST: untuk menginputkan data baru
 * - PUT: untuk mengupdate data yang sudah ada
 * - DELETE: untuk menghapus data
 */

 if ($_SERVER['REQUEST_METHOD'] === 'GET') {
     # untuk mengakses data dari server
    $query = 'select * from curhat order by created_at desc';
    $stmt = $pdo->prepare($query);
    $stmt->execute();
    $data = $stmt->fetchAll(PDO::FETCH_ASSOC);
    echo json_encode($data);
 } else if ($_SERVER['REQUEST_METHOD'] === 'POST') {
     # untuk menambahkan data baru dari server
     $nama = $_POST['nama'];
     $konten = $_POST['konten'];
     $query = "insert into curhat (nama, konten) values (?, ?)";
     $stmt = $pdo->prepare($query);
     $res = $stmt->execute([$nama, $konten]);
     if ($res){
         $data = ['nama'=>$nama, 'konten'=>$konten];
        echo json_encode($data);
     }else{
         echo json_encode(['error'=>$stmt->errorCode()]);
     }
 } else if ($_SERVER['REQUEST_METHOD'] === 'DELETE') {
     # untuk menghapus data dari server
     $id = $_GET['id'];
     $query = "delete from curhat where id = ?";
     $stmt = $pdo->prepare($query);
     $res = $stmt->execute([$id]);
     if ($res){
         $data = ['id'=>$id];
         echo json_encode($data);
     } else {
         echo json_encode(['error'=>$stmt->errorCode()]);
     }
 }

### Category Submission:


### App Link


### Screenshots


### Description
 

### Link to Source Code


### Permissive License


## Background
(What made you decide to build this particular app? What inspired you?)


### How I built it
(How did you utilize MongoDB Atlas? Did you learn something new along the way? Pick up a new skill?)


### Additional Resources/Info
aws course training online
Published: 2022-11-25 11:37:38

RH Soft Tech is India’s best sap online training and online professional IT courses training provider. Headquartered in Mumbai, we specializes in online training, corporate training on various Software courses. We are providing Online SAP training based on specific needs of the students and IT Professionals. We provide innovative one to one Online sap training in different modules of SAP which are having great opportunities in the present trend. We provide Online Training, Corporate Training or Classroom. Students can grasp the subject from our experienced and certified trainers who help the students to work in real time environment. We also conduct weekend’s classes. RH SOFT TECH online SAP training classes happens within a live environment, where the instructor and student interact Online using web conferencing tools like Gotomeeting, Zoom and WebEx connectivity which facilitates interactive learning sessions through both desktop sharing & audio sharing.

[aws course training online](https://rhsofttech.com/aws-online-training/)
I thought I'd share two dev wallpapers with you
Tags: webdev, javascript, showdev, watercooler
Published: 2022-11-25 13:24:34

Felt randomly inspired to create a couple of JavaScript-based wallpapers this evening, and I thought that I might post them here for you guys. I used the fantastic website https://ray.so/.

They're a bit on the philosophical side, a little bit whimsical, so take them as they are.

I hope your coding projects are inspiring you in new and wonderful ways ✌️


**practice-makes-better.js** [(Download hi-res)](https://imgur.com/a/HMzaHtI)

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


**life-event-handler.js** [(Download hi-res)](https://imgur.com/a/2Y9oqLT)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kdbyttf610bm9zicpmof.png)
How to use Redis with WordPress (docker-compose)
Tags: wordpress, redis, docker
Published: 2022-11-25 13:14:00

I'm putting this here because it took me a long while to figure this out.

I wanted to improve WordPress's performance by using Redis object caching. My environment is defined in a docker compose.

```yml
version: '3.6'
services:
  redis:
      image: 'redis:alpine'
      ports:
        - '6379:6379'
      restart: always
      expose:
        - '6379'

  wordpress:
      image: 'wordpress:latest'
```

There is a [handy WordPress plugin](https://fr.wordpress.org/plugins/redis-cache/) for that, but of course, it needs redis to be installed and configured properly. That's the part I struggled with as it could not connect to my redis container.

Normally, Redis should work out-of-the-box with WordPress as long as it is accessible via localhost:6379.

The thing is, in a docker setup the redis instance is accessible via its container name.

So in the above example, in order for WordPress to find it, you need to modify the constant `WP_REDIS_HOST` to "redis" in your wp-config.php file.

```php
define('WP_REDIS_HOST', 'redis');
define('WP_REDIS_PORT', '6379');
```
Additional constants are available. More information is available [here](https://github.com/rhubarbgroup/redis-cache/wiki/Connection-Parameters). 

That's it, really. I hope this helps someone.
Follow Friday: Vue Edition (25 November 2022)
Tags: meta, writing, vue
Published: 2022-11-25 13:08:00

_Happy Friday, friends! 🎉 Follow Friday is your weekly opportunity to shout out fellow DEV Community members doing awesome work. Check out the comments and follow someone new!_

[Vue.js](https://vuejs.org/) is a progressive JavaScript framework for building user interfaces. Its fans love it for its approachable, performant, and versatile nature.

So, devs: who are your favorite DEV community members sharing about Vue?

_**Formatting tip**: to populate a card with a follow button, use the liquid tag syntax `{% embed https://... %}` and insert the URL of your favorite author's profile._

Join in on the #FollowFriday fun by @mentioning your favorite author to follow on the topic of Vue (and letting us know why you love their posts!) ⤵️
Best Magento blogs for the latest Ecommerce news
Tags: magento, magentoblog, webdev, beginners
Published: 2022-11-25 13:05:18

Magento within reason sincere withinside the main – however like several complete featured platforms – it could get overwhelming. So the query is wherein do you switch whilst you get stuck? To assist with the ones moments, we gift a round-up of the most important and first-rate Magento blogs and assets out there.

[Magento Blog](https://business.adobe.com/blog/)
The latest perspectives and in-depth how-tos from the Adobe Experience Cloud teams. 

[MageComp Blog](https://magecomp.com/blog/)
Explore our Magecomp blogs & stay updated with Trending Magento and Ecommerce news, tips & tricks and how-to tutorials for enhancing both Magento & Ecommerce. Find more about latest developments, fixes and Magento 2 blog articles from experienced developers. You will love to read it.

[Inchoo](https://inchoo.net/blog/)
Read the blog to stay up to date with latest eCommerce (mostly Magento) design, development, and consulting techniques.

[Mageplaza](https://www.mageplaza.com/blog/)
Mageplaza • Blog: eCommerce, Marketing, Development, Magento.

[Amasty](https://blog.amasty.com/)
Magento blog from Amasty: useful articles, how-tos, tips and tricks on Magento and e-commerce.

[Magento DevBlog](https://community.magento.com/t5/Magento-DevBlog/bg-p/devblog)
The place for developer-focused news direct from the source.

[Aheadworks](https://aheadworks.com/blog)
Being a Premier Magento Extension Builder and an official Magento Enterprise Developer, Aheadworks is a go-to provider of products for Magento, offering a full range of solutions for eCommerce projects.

[BSSCommerce](https://bsscommerce.com/blog/)
Blog for all Magento merchants, developers, or consultants to update on the latest eCommerce trends, Magento tutorials, exclusive promotions, and many more!

[BelVG](https://belvg.com/blog/)
Discover BelVG Magento & PrestaShop ecommerce blog with step-by-step web development guides, web design trends, ecommerce tips and articles in our BelVG

[Simicart](https://www.simicart.com/blog/)
Keep up with the latest technology news & trends in eCommerce and Magento industry with our in-depth weekly posts.

[Mageants](https://www.mageants.com/blog)
MageAnts Provide Magento 2 blog: useful articles, how-to-use, tips and tricks on Magento2 and e-commerce

[Firebearstudio](https://firebearstudio.com/blog/)
Best extensions for Magento and Magento 2, development, tips, tricks, community, exchange of experience, research, fire!

[Emizentech](https://www.emizentech.com/blog/magento)
Access magento resources including magento news, development guides, magento Insight, magento Blogs and releases notes all in one place.
Typescript: El operador keyof
Published: 2022-11-25 12:47:50

---
cover_image: https://cdn.sanity.io/images/cyypawp1/production/ae5fd1ba135ac11917afd2a43c86e7389ad137c8-1280x710.png
keywords: 
- Typescript
title: "Typescript: El operador keyof"
description: "Algunos conceptos básicos de TypeScript lo ayudan a crear formularios de datos complejos. Uno de esos bloques de construcción es el operador keyof."
canonical_url: https://matiashernandez.dev/blog/post/typescript-el-operador-keyof
---
Algunos conceptos básicos sobre TypeScript te ayudarán a crear y manipular formas de datos más complejas. Uno de esos bloques de construcción es el operador `keyof`.

Este operador o palabra clave es la respuesta de Typescript al operador javascript `Object.keys`.



`Object.keys` devuelve una lista de las propiedades (las claves) de un objeto. `keyof` hace algo similar pero solo en el mundo de los tipos. Devolverá un tipo de unión literal que enumera las "propiedades" de un tipo similar a un objeto.

Este operador es el componente básico para la escritura avanzada, como los tipos asignados/mapeados y condicionales.

> El operador keyof toma un tipo de objeto y produce una cadena o unión literal numérica de sus claves. - [Manual de Typescript](https://www.typescriptlang.org/docs/handbook/2/keyof-types.html)



```typescript
type Colors = {
    primary: '#eee',
    primaryBorder: '#444',
    secondary: '#007bff'
    black: '#000',
    white: '#fff',
    whiteBorder: '#f2f2f7',
    green: '#53C497',
    darkGreen: '#43A17C',
    infoGreen: '#23AEB7',
    pastelLightGreen: '#F3FEFF',
}

type ColorKeys = keyof Colors; // "primary" | "primaryBorder" | "secondary" ....

function SomeComponent({ color }: { color: ColorKeys }) {
  return "Something"
}

SomeComponent({ color: "WhateverColor"})

SomeComponent({ color: "primary"})
```

El ejemplo de código anterior es un fragmento de una aplicación web real. El tipo `Colors` describe un conjunto de colores que se pueden usar en toda la aplicación.

El operador `keyof` se aplica al tipo `Colors` para recuperar una unión literal de todos los colores posibles.

> Unión literal significa que es un tipo de unión formado por valores literales como "primario" | "secundario"

Luego, la unión se usa para describir las props de `SomeComponent`, lo que permite que el argumento `color` sea uno de los colores definidos en el tipo.

También puede usar el operador `keyof` para crear tipos o restricciones más complejos junto con genéricos y literales de plantilla, pero eso será para otra publicación.

Ahí tienes; el operador `keyof` puede ser pequeño, pero es una pieza esencial en el gran esquema que desbloquea operaciones poderosas cuando se usa en el lugar correcto.
NU Life - Home Health Care Ltd
Published: 2022-11-25 12:45:05

<p>The best part the smart technologies offer today is the convenience to shop for home healthcare Equipments Canada at NULife. The online store offers a wide range of home healthcare medical supplies including positioning devices, daily living aids, home care products, and a lot more. All you have to do here is to get in touch with NULife and gain access to a large selection of durable medical supplies at incredible prices</p>
<p><a href="https://nulifehealth.ca/">NU-Life</a> is a reliable home medical supplies distributor of all major vendors, providing online Home Healthcare Medical Supplies across Canada with quick shipping</p>
<p><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhoxy0-sPItxVEQW2qW00gnx9WLsH2izc6x5-JDjeIWEzLcRK0UQ2A9ICTjcmxPm0ph07brV3PkK-OvaMtIDjCyQxijjuKrSSLMkQbRe8_6cnlUELWool88P97N2eRAoGi2FgqZ7mP5hIybTDM84BFv-I15Hvfc-M9GyWcFVAkgljyuH46QUbC8V49B/s300/700-841-700-846_-300x300.jpg"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhoxy0-sPItxVEQW2qW00gnx9WLsH2izc6x5-JDjeIWEzLcRK0UQ2A9ICTjcmxPm0ph07brV3PkK-OvaMtIDjCyQxijjuKrSSLMkQbRe8_6cnlUELWool88P97N2eRAoGi2FgqZ7mP5hIybTDM84BFv-I15Hvfc-M9GyWcFVAkgljyuH46QUbC8V49B/s1600/700-841-700-846_-300x300.jpg" width="300" height="300" border="0" data-original-height="300" data-original-width="300" /></a></p>
<p><strong>Contact us:</strong></p>
<p>Address: 2801 Keele Street Unit #105 North York, ON M3M 2G6</p>
<p>+1 (416) 633-3457</p>
<p>info@nulifehealth.ca</p>
Should I learn Typescript?
Tags: help, typescript, webdev, react
Published: 2022-11-25 12:36:10

I work with React.js and I was thinking to learn React native. But I have a quick question **Should I learn Typescript or should I just go with React Native?**

The thing is I can do pretty much everything with Javascript that's why I am little confuse about Typescript. Does it worth giving time or should I just go to mobile development?
This Week In Python
Tags: python, discuss, thisweekinpython
Published: 2022-11-25 12:13:43


**Fri, November 25, 2022**


This Week in Python is a concise reading list about what happened in the past week in the Python universe. 

**I have received some good suggestions for this week's content. Thank you.**

**Did I miss anything from the Python universe this week? What did you read or tried out?**



## Python Articles

- [How many snakes do you need?](https://atmamani.github.io/blog/how-many-snakes-python-concurrency-1/) – An introduction to concurrency and parallelism in Python
- [A Look on Python Web Performance at the end of 2022](https://dev.to/cirospaciari/a-look-on-python-web-performance-at-the-end-of-2022-3i02) 
- [The last Python Architecture you will ever need?](https://davidvujic.blogspot.com/2022/11/the-last-python-architecture-you-will-ever-need.html) 
- [Python Type Hints: case study on parsy](https://lukeplant.me.uk/blog/posts/python-type-hints-parsy-case-study/) 
- [How we run our Python tests in hundreds of environments really fast](https://blog.sentry.io/2022/11/14/how-we-run-our-python-tests-in-hundreds-of-environments-really-fast/) 






## Projects



- [imaginAIry](https://github.com/brycedrennan/imaginAIry) – AI imagined images. Pythonic generation of stable diffusion images
- [quickadd](https://github.com/Acreom/quickadd) – Parse natural language time and date expressions in Python
- [QuickSQLConnector](https://github.com/Anas-Dew/QuickSQLConnector) – SQL in one line 
- [pyjanitor](https://github.com/pyjanitor-devs/pyjanitor) – Clean APIs for data cleaning. Python implementation of R package Janitor 
- [yapsl](https://github.com/kutoga/yapsl) – Yet another python sms library


**Did I miss anything from the Python universe this week? What did you read or tried out?**