teleren/devto huggingface dataset:
How to use find(), filter(), map() and reduce() in JavaScript
Published: 2023-07-14 00:32:55

In JavaScript we have two types of array methods:
The first array methods allow us to modify arrays by adding and removing elements (push(), slice(), etc). These methods operate on the array as a whole.
The second one includes methods that assist us in iterating through an array and interacting with each individual element in some way.
Find, filter, map and reduce are the four we'll learn where we'll want to use them and how to use them.
The find method will return the first element that satisfies the condition defined by the callback function. It is looking for a simple true/false answer and once it finds a single true, it returns that true, and then exits out.
Find() takes three arguments , which are the current element of the array, the index of the current element, and the array itself.
Suppose I have an array1 where I’ve stored the numbers and I would like to find the first element that is larger than 9.

Here is the code to do that:
const array1 = [4, 9, 10, 25, 29];
const found = array1.find(element => element > 9);
console.log(found);

The filter method is used to filter the array based on conditions you provide. The filter() method also creates a new array.
Suppose I have an array2 where I’ve stored the words and I would like to filter the words that are their length less than 7.

Here is the code to do that:
const array2 = ['spray', 'school', 'hospital', 'exuberant', 'destruction', 'present'];
const result = array2.filter(array2 => array2.length < 7);
console.log(result);

The map method takes in an array and then manipulates in it some way and returns a new array.
Suppose I have an array3 where I’ve stored the numbers and I would like  to perform some calculations on each of them.

Here is the code to do that:
const array3 = [3, 7, 10, 9, 16];
const map1 = array3.map(x => x - 2);
console.log(map1);

The reduce method reduces an array to a single value by performing the desired operation on the elements collectively.
Suppose I have an array4 where I’ve stored the numbers and I would like to find the sum of all elements of array4.

Here is the code to do that:
const array4 = [1, 2, 3, 4, 5,6,7,8];
const initialValue = 0;
const sumWithInitial = array4.reduce(
  (accumulator, currentValue) => accumulator + currentValue,
  initialValue
);
console.log(sumWithInitial);
Crea alarmas con SNS y Lambda para tus ejecuciones en CodeBuild
Published: 2023-07-13 23:30:53

Cómo sabemos CodeBuild es un servicio de compilación completamente administrado que nos permite compilar código fuente, ejecutar pruebas y producir paquetes de software.

De acuerdo con las necesidades de la organización, CodeBuild se puede utilizar junto con diferentes estrategias, sin embargo, cual sea su función dentro del negocio hay algo que debemos resaltar, y es siempre mantener visibilidad de los procesos y mantener una alta disponibilidad de nuestros aplicativos.

Por eso, es recomendable mantener un monitoreo de las ejecuciones que se realizan en CodeBuild de ser posible, en caso de que alguna falle y comprometa el funcionamiento del negocio. 

Para aplicar este monitoreo, es posible aplicar configuraciones que nos notifiquen cuando estas ejecuciones lleguen a fallar. Esto puede lograrse añadiendo notificaciones con Amazon SNS y adjuntando un disparador por medio de AWS Lambda.

Amazon SNS nos permitirá mandar notificaciones por medio de correo electrónico, SMS o notificaciones push. Si requiere integrarlo con alguna plataforma como Slack será necesario utilizar una función Lambda. 

Dentro de una función Lambda podemos crear la estructura del mensaje que debemos mandar al canal de Slack especificado.

Si quieres echar un vistazo sobre como conectar tu espacio de Slack con tu función Lambda te dejo esta [publicación](https://serverlessrepo.aws.amazon.com/applications/us-east-1/289559741701/lambda-to-slack)

Para realizar las notificaciones con SNS, puedes echar un ojo a esta [documentación](https://docs.aws.amazon.com/es_es/sns/latest/dg/sns-create-topic.html)

Para conectar el evento SNS con una función lambda te dejo aca la [documentación](https://docs.aws.amazon.com/es_es/lambda/latest/dg/with-sns.html) oficial de AWS

Si te interesa que realice un tutorial sobre este tema, házmelo saber en los comentarios :)
Content & Tooling Team Status Update
Tags: puppet, community
Published: 2023-07-20 21:53:49

---
title: Content & Tooling Team Status Update
published: true
date: 2023-07-14 00:00:00 UTC
tags: puppet, community
canonical_url: https://puppetlabs.github.io/content-and-tooling-team/blog/updates/2023-07-14-status-update/
---

## Happy Friday!

Happy Friday everyone! Another week done and dusted here for the CAT Team in Belfast and Pune. Plenty of work is going on behind the scenes to keep everything ticking..

## CI Improvements

You may have noticed [Ramesh](https://github.com/ramesh7) generating some noise on our modules with PRs in regards to CI Updates. This maintenance was carried out to help improve the resiliance of our CI pipelines for some of our supported modules. Some modules that received these updates are [puppetlabs-docker](https://github.com/puppetlabs/puppetlabs-docker), [puppetlabs-mysql](https://github.com/puppetlabs/puppetlabs-mysql) and [puppetlabs-satellite\_pe\_tools](https://github.com/puppetlabs/puppetlabs-satellite_pe_tools).

Thanks to Ramesh, our nightly report status is looking a whole lot more green these days.

## That’s all folks!

That’s all for this week Im afraid, this week was quieter than usual with a bank holiday here in the Belfast Office. See you all next week!

![thats-all-folks](https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExa3JjZmtid2d4aXZ6dm05YjFkMzlhcThhOGdieXcyMDQ0NHk0dDl1cyZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/7yojoQtevjOCI/giphy.gif)

## Community Contributions

We’d like to thank the following people in the Puppet Community for their contributions over this past week:

- [`puppetlabs-lvm#305`](https://github.com/puppetlabs/puppetlabs-lvm/pull/305): “remove puppetlabs/mount\_core from metadata.json”, thanks to [bastelfreak](https://github.com/bastelfreak)
- [`puppetlabs-lvm#301`](https://github.com/puppetlabs/puppetlabs-lvm/pull/301): “[GH-298] fix lvm\_vg\_\* facts”, thanks to [rtib](https://github.com/rtib)

## New Module / Gem Releases

The following modules were released this week:

- [`puppetlabs-lvm`](https://github.com/puppetlabs/puppetlabs-lvm) (`2.0.3`)
Te invito a visitar mi canal
Tags: youtube, channel, tutorial
Published: 2023-07-13 23:55:46

Hola a todos, espero que esten haciendo cursos y aprendiendo mas...

Hoy los invito a pasarse por mi canal de youtube, en realidad tengo dos, pero en uno les estoy dejando mas material...


- Slider: https://youtube.com/@slidertucuman
- Juan Chehin: https://youtube.com/@JuanChehin


Dejen sus comentarios (positivos o negativos son bienvenidos) y por que no, lo que desean aprender y formarse...

!!!Saludos
TIL Blog Day 1
Tags: webdev, beginners, programming, ruby
Published: 2023-07-13 23:28:40

Today I worked on the 'Getting Started' module of the Tech Prep course. 

I'm excited to start using the 'Ask' question forum. I'm sure that it will be an indispensable tool as we progress through Tech Prep and hopefully the fall program/bootcamp. I have used ChatGPT in the past whenever I ran into issues with writing JavaScript code and it has helped tremendously. 

I was also able to complete the 'Hello, World!' module today.
It was great to learn how to use Github Codespaces and deploying a simple page to the internet. In the past I have used Github Pages and Netlify so it's good to learn about another service like Fly.io

I'm extremely grateful and excited to participate in Tech Prep. While I do have some experience with JavaScript, I am looking forward to adding Ruby and Ruby on Rails to my tool belt. 

Lastly, one last comment to anyone reading this. Definitely take breaks from coding. It can be tempting to grind away for hours without a break but I have found the stepping away from the computer when you are stumped/tired is a great way to clear your mind. When you come back you will feel even better and can continue coding feeling refreshed. I try to stick to the Pomodoro technique(25 minutes of work, 5 minute break, repeat) and have had great success with it!
¿Cómo iniciar con la nube de AWS jugando?
Tags: aws, cloudskills, cloudpractitioner
Published: 2023-07-13 23:10:41

_By Ana Cifuentes_

Si estás interesada en aprender sobre la nube o ya tienes conocimientos básicos y buscas obtener la certificación Cloud Practitioner te recomiendo aventurarte en **AWS Cloud Quest Cloud Practitioner** 

**AWS Cloud Quest Practitioner** es un juego de rol que te ayudará a adquirir habilidades prácticas de la nube de AWS, es totalmente gratis y te va a resultar muy divertido aprender mientrar juegas.

![Cloud-quest-cloud-practitioner](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d0r80t7keiqvfanuo8r9.png)

Lo único que necesitas es registrarte en la plataforma de skillbuilder (que si ya tienes cuenta de Amazon, con la que compras en el Prime Day o Buen Fin puedes ingresar con esa cuenta)

[Acá ](https://explore.skillbuilder.aws/learn/course/external/view/elearning/11458/aws-cloud-quest-cloud-practitioner)puedes ingresar a la plataforma
The Career-Defining Power of Prioritizing Problem-Solving Skills Before Coding
Tags: codenewbie, coding, programming, devto
Published: 2023-07-13 22:57:57

**Introduction:**
Making the decision to prioritize problem-solving skills before diving into coding can have a profound impact on your career trajectory. By understanding the problem at hand and developing effective problem-solving techniques, you lay a strong foundation for successful coding and meaningful solutions. In this article, we will explore why learning problem-solving skills before learning to code can be a career-changing decision.

**1. Problem Awareness:**
Before writing a single line of code, it is crucial to fully comprehend the problem you are trying to solve. Taking the time to deeply understand the nuances, requirements, and desired outcomes ensures that your coding efforts are focused and aligned with the actual problem.

**2. Effective Solution Design:**
Once you grasp the problem, the next step is to devise an effective solution strategy. Problem-solving skills enable you to break down complex challenges into manageable components and formulate a logical plan of action. This approach allows you to approach coding with clarity and purpose, resulting in more efficient and successful solutions.

**3. Efficient Resource Utilization:**
By emphasizing problem-solving skills, you learn to identify the essential resources and tools needed to tackle a problem. This approach helps avoid unnecessary code complexity, saves time and effort, and improves overall efficiency in the development process. Understanding the problem thoroughly empowers you to utilize resources optimally and deliver elegant solutions.

**4. Adaptability and Versatility:**
Effective problem-solving skills foster adaptability and versatility. By focusing on problem-solving before coding, you develop a mindset that transcends specific programming languages or frameworks. This flexibility allows you to apply your skills to a wide range of challenges, adapt to new technologies, and continually enhance your expertise.

**5. Collaboration and Communication:**
Problem-solving skills are not limited to technical aspects but also involve collaboration and communication. When you prioritize problem-solving, you cultivate the ability to work effectively with others, seek input, and express ideas clearly. These skills enhance your professional interactions, making you a valuable team member and improving the overall success of your projects.

**Conclusion:**
Learning problem-solving skills before diving into coding is a pivotal decision that can shape the trajectory of your career. By thoroughly understanding the problem, developing effective solution strategies, and cultivating adaptability, you set a solid foundation for successful coding and meaningful solutions. Furthermore, efficient resource utilization and improved collaboration and communication skills further enhance your capabilities as a software engineer. Embrace the power of problem-solving and witness the transformative impact it has on your coding journey.
Episode 23/27: NgRx 16.1 & Signal Store, Jest, Cypress, Nx
Tags: angular, webdev, javascript, programming
Published: 2023-07-13 22:51:51

NgRx was released in 16.1, and its upcoming Signal Store starts to gain attention. Furthermore, we had minor releases for Cypress, Jest and nx.

{% embed https://youtu.be/AzwT_nfDYFk %}

## NgRx

NgRx, a state management library, was released in v16.1. The component store accepts a custom equal function in its select method. Until now, it used only strict equality operator.

[ChangeLog 16.1](https://github.com/ngrx/platform/blob/main/CHANGELOG.md#1610-2023-07-06)

Next to the component and global store, NgRx, and there especially Marko Staminirovic, is working on a third store with the name SignalStore. Manfred Steyer wrote an article on its current state and what we can expect for its upcoming release.


He showcased the two types. The first one is the `signalState`, which is the lightweight one, and then we have the `signalStore`, which also provides - kind of - preconfigured functionalities, for example, for managing entities or tracking network requests.


{% embed https://www.angulararchitects.io/aktuelles/the-new-ngrx-signal-store-for-angular-2-1-flavors/ %}

At the moment, the Signal Store is still in the RFC phase. So you can try it out and comment on it.

[RFC Signal Store](https://github.com/ngrx/platform/discussions/3796)

## Minor Releases

And in the testing world, we also had two new minor releases. One for Jest, which went up to 29.6 and Cypress to 12.17.

### Cypress 12.17

Cypress added a notification feature for their commercial product, which is the Cypress Cloud.

[Cypress Release Notes](https://github.com/cypress-io/cypress/releases)

### Jest 29.6

Jest had some fixes and added some features in the area of snapshot testing.

[Jest Release Notes](https://github.com/jestjs/jest/releases/tag/v29.6.0)

### Nx 16.5

Last but not least, Nx, an alternative to the Angular CLI, was released in version 16.5.

Since Nx also supports other frameworks, the list of new features is quite long. For details, please refer to the official changelog or the videos on their YouTube channel.

{% embed https://blog.nrwl.io/nx-16-5-release-7887a27cb5 %}

{% embed https://www.youtube.com/@nxdevtools %}
Essential Git Commands: A Comprehensive Guide for Version Control
Tags: git, github, development, contributorswanted
Published: 2023-07-13 22:43:00

# Git Commands
----------------------
### To initialize a repository:

- `git init`: Initialize a project as a Git repository.

----------------------
### To connect to a remote repository:
- Add or connect to a remote repository:
  ```
  git remote add origin <link-to-github-remote-repo>
  ```
- View connected remote repositories:
  ```
  git remote
  ```
----------------------
### To manage file status:
- View the status of files in your local repository (tracked, untracked, modified):
  ```
  git status
  ```
- Stage modified or untracked files:
  ```
  git add <file name>
  ```
  Use `git add .` to stage all unstaged files.
- Unstage files:
  ```
  git reset
  ```
----------------------
### To commit changes:
- Commit staged files:
  ```
  git commit
  ```
- Commit staged files with a commit message:
  ```
  git commit -m "<commit message>"
  ```
----------------------
### To push changes:
- Push committed files to the remote repository in the specified branch. Use this command for the first push:
  ```
  git push -u origin <branch-name>
  ```
- Push committed files to the remote repository:
  ```
  git push
  ```
----------------------
### To fetch and pull changes:
- Fetch the most updated version of your local repository:
  ```
  git fetch
  ```
- Pull the fetched information into your local repository, updating it to the most recent version of the remote repository:
  ```
  git pull
  ```
----------------------
How to search more efficiently?
Tags: webdev, productivity, machinelearning, frontend
Published: 2023-07-13 22:21:40

## 1. Use quotes to get an "EXACT" match

Using quotes in search queries allows you to obtain an "exact" match for specific phrases or words. When you enclose your search terms in quotation marks, search engines will only return results that include the exact phrase or word order you specified within the quotes. This can be particularly useful when you're looking for specific information, researching a specific topic, or trying to find an exact quote from a particular source. By using quotes effectively, you can narrow down your search results and obtain more precise and relevant information for your needs.


![Example of using the "Quotes"](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z105pkh8ci8sod1jzwbf.png)


## 2. Search within a specific site with 'site:'

The 'site:' operator in search queries allows you to narrow down your search results to a specific website or domain. By using the 'site:' operator followed by the website URL, you can instruct the search engine to only retrieve results from that particular site. This can be useful when you want to explore content within a specific website or when you're looking for information on a particular topic from a trusted source. By using 'site:' effectively, you can streamline your search process and focus on finding relevant information within a specific site or domain.


![Example of using the site: ](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qzsgt4jo1jydy5hpphxm.png)

## 3. Use the "Google alert" to get news about searchs you are interested in

Google Alerts is a valuable tool that allows you to receive customized updates and notifications about specific search queries or topics of interest. By setting up a Google Alert, you can stay informed and up-to-date on the latest news and information related to your chosen search terms. Whether it's tracking industry trends, monitoring competitors, or staying updated on a particular topic, Google Alerts sends you email notifications whenever new content matching your search criteria is indexed by Google. It's a convenient way to stay informed without constantly manually searching for information, enabling you to effortlessly keep track of subjects that matter to you.


![Using alert!](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o80i6ruekd2vdj0twiuw.png)


## 4. Use wildcard * to make searches

If you are unsure about or have forgotten any term in your search query/ question, then use the wildcard * charachter. Google will replace it for you with relevant terms.

For example, a search on => the * of money will populate the following results. It will be a bunch of pages that include the phrase such as "the exchange of money", "the use of money", "the role of money", "the psychology of money", and so on.


![I](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wblgmny1s8pzyz63bkab.png)
Mastering VS Code: Boost Your Productivity with Integrated Terminal Shortcuts on Window
Tags: vscode, productivity, terminal
Published: 2023-07-13 22:20:22

## Setup VS Code Terminal

- Change default terminal:
    - Step 1: Show the Command Palette by pressing `Ctrl + Shift + P` or `F1`.    
    - Step 2: Type `Terminal: Select Default Profile`    
    - Step 3: Select your default terminal profile.

## Summary of shortcuts for the Integrated Terminal

- Integrated Terminal
    
    
    | Hot Keys |  |
    | --- | --- |
    |  Ctrl + ` or Ctrl + J | Show integrated terminal |
    | Ctrl + Shift + ` | Create new terminal |
    | Ctrl + PgUp/PgDown | Move to top/bottom terminal (Mutiple terminals) |
    | Ctrl + ↑/↓ | Scroll up/down to command |
    | Ctrl + Home/End | Go to the start/end of the terminal |
    | Shift + PgUp/PgDown | Scroll page up/down |
    | $ cls | Clears the terminal  |

## Story

- How do you open the terminal while coding?
    
    You can use `Ctrl + J` to go the terminal workspace. 
    
- And after that, how do you switch back to the editor to continue coding?
    
    Let’s press `Ctrl + J` again. Here we go, you can continue coding.
    
- Working with multiple terminals
    
    If you have multi-terminals, how do you navigate between them? Use your mouse 😃 Yah! Of course, but if you don’t have a mouse or you don’t like to use touchpad like me. Use `Ctrl + PgUp/PgDown` ! This shortcut can be a great help.
    

## References

 [Keyboard shortcuts for Window](https://code.visualstudio.com/assets/docs/getstarted/tips-and-tricks/KeyboardReferenceSheet.png)
AWS: Top Always Free Services (2023)
Tags: aws, cloudcomputing, free
Published: 2023-07-13 16:44:14



![AWS: Top Always Free Services (2023)](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9168m31mwqkgl0bovi94.jpg)

Amazon Web Services (AWS) is a cloud computing platform that offers a wide range of services to its users. Some of these services are always free, meaning users can use them without incurring any cost. Here are some of the top always free services offered by AWS:


### 1. AWS Lambda

AWS Lambda is a serverless computing service that allows users to run code without having to manage servers. The free tier of AWS Lambda allows users to run up to 1 million requests per month for free.

### 2. Amazon DynamoDB

Amazon DynamoDB is a NoSQL database service that provides fast and predictable performance with seamless scalability. With the free tier of Amazon DynamoDB, users can store up to 25 GB of data and perform up to 200 million requests per month for free.

### 3. Amazon CloudFront

Amazon CloudFront is a content delivery network (CDN) that speeds up the delivery of static and dynamic web content, such as HTML, CSS, JavaScript, and images. With the free tier of Amazon CloudFront, users can deliver up to 50 GB of data transfer per month for free.

### 4. Amazon SES

Amazon SES (Simple Email Service) is an email-sending service that allows users to send and receive emails using their own email addresses and domains. With the free tier of Amazon SES, users can send up to 62,000 emails per month for free.

### 5. Amazon SNS

Amazon SNS (Simple Notification Service) is a messaging service that allows users to send messages and notifications to a variety of endpoints, including email, SMS, and HTTP. With the free tier of Amazon SNS, users can send up to 1 million mobile push notifications per month for free.

### 6. Amazon SQS

Amazon SQS (Simple Queue Service) is a fully-managed message queuing service that enables decoupling and scaling microservices, distributed systems, and serverless applications. With the free tier of Amazon SQS, users can send up to 1 million messages per month for free.

### 7. Amazon Cognito

Amazon Cognito is an identity management service that allows users to easily add user sign-up and sign-in to mobile and web apps. With the free tier of Amazon Cognito, users can store up to 50,000 monthly active users for free.

### Conclusion

These are just some of the top always free services offered by AWS. By taking advantage of these services, users can save costs while still enjoying the benefits of cloud computing.