teleren/devto huggingface dataset:
Day 753 : Move On
Tags: hiphop, code, coding, lifelongdev
Published: 2023-05-18 22:01:37

_liner notes_:
- Professional : Helped out with a community question. Had a couple of meetings. Good to see everyone in one place. Went over some implementation details for a feature in a demo I've been working on. Worked on slides for my next talk. Pretty much it.

- Personal : Last night, I went through tracks for the radio show and worked on my slides. Didn't get to watch any anime though.

![View from the bank of Tipsoo Lake in Washington State at sunset looking across the late at the other shore, a forest and a large mountain in the distance with the peak covered in a cloud](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ks112jpnkn88qu0zbblq.jpg)

Going to go through Bandcamp and pick up some projects so I can post tomorrow. Maybe put together some tracks for the radio show. Definitely want to work on my slides. The thing I need to work on is just finish a slide and move on. Stop trying to make everything perfect the first time. I'll have time to revise later. Let's see if I can fit in some anime. Last night I realized that there are new seasons of anime released that I watched a few years ago and forgot about them. haha

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube moo_OoC3mwU %}
Dia 18/05/2023- Artigo
Published: 2023-05-18 21:49:51

Hoje foi um dia de muitos aprendizados. Aprendi  a:
 usar o "useState"
Colocar uma data relativa  de hoje do post que foi criado usando bibliotecas do React.
 Usar o ".map" para criar as funcionalidades de comentários do post. 
Diferença entre um forEach e um .map.
A "percorrer um array".
Aprendi sobre imutabilidades.

useState:
Pelo o que eu aprendi, o useState é uma função que existe na biblioteca React. Essa função retornam basicamente 2 valores: valor do estado atual e o valor da nova função quando atualizado. (Lembrando que o primeiro valor é sempre o valor atual e o segundo é sempre o valor atualizado.).

Olha esse exemplo:

```
import React, { useState } from 'react';

function Counter() {
  const [count, setCount] = useState(0);

  return (
    <div>
      <p>Contagem: {count}</p>
      <button onClick={() => setCount(count + 1)}>Incrementar</button>
    </div>
  );
}
```
Nesse exemplo, o estado atual é definido como 0. A função useState retorna um array com dois elementos: count e setCount. O count é o valor atual do estado e setCount é uma função que permite atualizar esse valor. O botão "Incrementar" chama a função setCount para incrementar o valor do estado.

Cada vez que o estado é atualizado usando setCount, o React atualiza o componente para refletir a mudança no estado. Dessa forma, o componente funcional pode ter um estado interno que pode ser atualizado e renderizado de forma reativa.

Percorrer arrays:

Percorrer array significa dar uma funcionalidade para cada elemento array dali. Seria mais ou menos assim (usando o método forEach):

```
const array = [1, 2, 3, 4, 5];

array.forEach(element => {
  console.log(element);
});
```
Ali ele está percorrendo cada elemento.

Qual a diferença de um forEach e de um .map?

o forEach executa uma função para cada elemento mas não retorna um novo array.Única coisa que ele faz é iterar sobre os elementos que já estão ali e aplicar funcionalidade, sem fazer nada com o array original.

Já o .map multiplica cada elemento do array por 2 e retorna um novo array com os resultados. o .map é usado para criar um novo array com base nos elementos do array original.

O que seria imutabilidade?

De forma simples, a imutabilidade no JavaScript seria uma string, number ou object que não podem ser alterados. Veja esse exemplo que achei:

```
let x = 5;
let y = x; // y recebe o valor de x (5)

x = 10; // x é atribuído como 10

console.log(x); // 10
console.log(y); // 5 (o valor de y não foi alterado)

```
 
Nesse exemplo, quando atribuímos x a y, o valor atual de x (5) é copiado para y. Mesmo que x seja alterado posteriormente, y mantém seu valor original.
What is your favorite easy meal to cook when you are working a long day?
Tags: watercooler, discuss
Published: 2023-05-18 21:29:41

Hey y'all! I recently saw a post by one of my team members...
{% embed https://dev.to/codenewbieteam/if-coding-languages-were-ice-cream-flavors-9l9 %}

...on our CodeNewbie Team page and it drew up so many feelings and associations to food and work. 


Recently, one of my favorite things to listen to during my days of making content for y'all over here at [CodeNewbie Team](https://dev.to/codenewbieteam) is cooking podcasts. I found this show by Samin Nosrat (creator of Salt, Fat, Acid Heat!) and Hrishikesh Hirway called [Home Cooking](https://open.spotify.com/show/1K6SiDxdGacAmhMQIvdJUL?si=78f2d7e89baa407e) that got me thinking... I should really try to make a meal using all of the ingredients in my cabinet to have something cook something while I work (ideally in my crock pot), so that I don't have to focus on it while I work, can be super nourished once I finish work, and don't have to think about purchasing a meal for the day. _(Note: I definitely do this every once and a while, but I forgot it was even an option as my crock pot is stashed away in a cabinet right now!)_

So, this was my 15 minute mission at the end of my lunch break today— I decided to throw a bunch of veggies in the crock pot, add some things to make a pseudo pozole veggie soup, and called it an afternoon (will update to see how it goes!). 

---

## All said, I realize I am not alone in this quest to find easy meals while I am working that make me excited to eat, but aren't too stressful or mess-making to cook.

## So, help me out— what do you find yourself cooking, craving, or ordering when you have a long workday and you can't be bothered?
Ray Software Solution - Services
Tags: raysoftwaresolution, webdev, development, services
Published: 2023-05-18 21:18:31


[Ray Software Solution](https://www.raysoftwaresolution.com/) do not confine our IT [services](https://www.raysoftwaresolution.com/services/) to [Web development](https://bit.ly/3dVtITJ), rather we deliver various other [services](https://bit.ly/3wurgd2) which include [web design](https://bit.ly/3AV9F1E), [web development](https://bit.ly/3dVtITJ), [wordpress development](https://bit.ly/3kCxrcB), [digital marketing, SEO](https://bit.ly/3ADHd3v) and a lot more.
How to edit FilamentPHP Relation Manager Table Query
Tags: php, filamentphp, webdev, laravel
Published: 2023-05-18 20:48:12

You have to use `getTableQuery` method for that. This method returns Eloquent Builder or Relation class but for our situation it's going to return Builder class. So we can use that builder to add our queries. 

For example i have a relation manager that must be ordered by order_column.
- Open your relation manager file.
- Then add this code:
```php
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Relations\Relation;

protected function getTableQuery(): Builder|Relation
{
    return parent::getTableQuery()->orderBy('order_column');
}
```

- Save and check.
Perform Dynamic Execution of an npm Package
Tags: pnpm, node, tooling
Published: 2023-05-18 20:34:42

Sometimes, all you want to do is grab an npm package and execute a command with it, without having to install it (whether globally or as a dependency).

That's what you can do with [`pnpm dlx`](https://pnpm.io/cli/dlx).

## An example

```bash
pnpm dlx vercel deploy
```

This example shows how to use the [vercel CLI package](https://vercel.com/docs/cli) without having to install it thanks to `pnpm dlx`.

In this example, pnpm downloads the vercel package, and executes it with the command `deploy` (that deploys a project to the Vercel platform).

## Some use cases

* You don't want to install globally a package because you only need to execute its binary script once
    
* You don't want a package to be a dev dependency of your project, or you are not using it in the context of a Node project
    
* You need to execute a CLI package command from a CI pipeline
    
* You want to ensure you use the latest version of a package (useful for starter kits like `create-vite`, or `create-vue`)
    

## Good to know

For starter kits, you can use [`pnpm create`](https://pnpm.io/cli/create) instead of `pnpm dlx`. For instance, executing `pnpm create vue` is equivalent to executing `pnpm dlx create-vue`.
AWS Landing Zones
Tags: aws, security, cloud, devops
Published: 2023-05-18 20:08:31

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

[1/30] #30DaysOfAWS Today, AWS Landing Zones.

**AWS Landing Zones** is a solution offered by Amazon Web Services (AWS) that provides a prescriptive approach for setting up a secure, multi-account AWS environment. It is designed to help organizations quickly set up and govern a secure, scalable, and well-architected multi-account AWS environment.

**AWS Landing Zones** provides a set of predefined templates, called landing zone blueprints, that enable organizations to quickly and easily set up a multi-account AWS environment that conforms to AWS best practices and compliance requirements. These templates include pre-configured security, networking, and identity and access management (IAM) settings, which can be customized to meet the specific needs of an organization.

**AWS Landing Zones** also provides a set of automation tools, such as AWS CloudFormation, AWS Config, and AWS Service Catalog, that enable organizations to automate the setup and management of their multi-account AWS environment. This helps organizations reduce the time and effort required to set up and maintain their AWS environment, while also improving security and compliance.

In summary, AWS Landing Zones is a solution that helps organizations quickly and easily set up a secure, scalable, and well-architected multi-account AWS environment that conforms to AWS best practices and compliance requirements.

Learn More - [URL](https://docs.aws.amazon.com/prescriptive-guidance/latest/migration-aws-environment/welcome.html)

Thanks for reading the Article.
Old PHP 5, cURL, and TLS 1.2 = SSL connect error
Published: 2023-05-18 20:01:41


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

You have good and old PHP projects that never crack, work well and you don't have anything to worry about it. But you are using cURL to API connections, and suddenly receive the error:

```
SSL connect error
```

Immediately you think… it'll be easy to fix. Just force cURL to ignore SSL checks:

```
CURLOPT_SSL_VERIFYPEER    => false,
CURLOPT_SSL_VERIFYHOST    => false,
```

Now, just relax and test:

```
SSL connect error
```

At that moment you start to be afraid about how to fix it. When you got an idea. Force the TLS version and cross your fingers to work

```
$ch = curl_init('https://google.com/');

//Force requsts to use TLS 1.2
curl_setopt ($ch, CURLOPT_SSLVERSION, 6);

$result = curl_exec($ch);
curl_close($ch);
```

And again :

```
SSL connect error
```

Ok, maybe now is a good time to start crying.

## The solution

Keeping the jokes aside, what happens is the cURL can't really force the TLS even if set to ignore SSL or to use TLS version X.
On the other hand, could be impossible to update the infrastructure from some systems, furthermore if they are isolated and designed a long time ago using old versions of Apache and PHP.
But for our luck, we have stream_context 👏👏👏
The stream_context creates and returns a stream with any options supplied.

```
stream_context_create(?array $options = null, ?array $params = null): resource
```

Same as cURL, using stream context you can set headers, methods, and pass parameters. Like this :

```
$opts = array(
  'http'=>array(
    'method'=>"GET",
    'header'=>"Accept-language: en\r\n" .
              "Cookie: foo=bar\r\n"
  )
);

$context = stream_context_create($opts);

/* Sends an http request to www.example.com 
   with additional headers shown above */
$fp = fopen('http://www.example.com', 'r', false, $context);
fpassthru($fp);
fclose($fp); 
```

One reason why stream_context_create might work when cURL does not is thatstream_context_create may be more forgiving of server or network issues that can cause cURL to fail. For example, if a server certificate is invalid or expired, cURL may fail to connect, whereas stream_context_create may still establish a connection if the verify_peer option is set to false.
Wow, that was close!

Finally, we have a solution and I wanna share it with you. Maybe it can help you to sleep better :)

```
// Requiring TLS 1.2:
$ctx = stream_context_create([
    'ssl' => [
        'crypto_method' => STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT
    ]
]);
$html = file_get_contents('https://google.com/', false, $ctx);
```

Hope it helps you!
Cheers, and let's stay connected on [Linkedin](https://www.linkedin.com/in/olavo-mello/) !
Nodejs Asynchronous Multithreading Web Scraping
Tags: node, javascript, scraping, programming
Published: 2023-05-18 19:57:01


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


Nodejs Asynchronous Multithreading Web Scraping
Reading online data multiple times faster ;)


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


## What is Web Scraping?

Web scraping is the process of extracting data from websites. In today’s world, web scraping has become an essential technique for businesses and organizations to gather valuable data for their research and analysis. Node.js is a powerful platform that enables developers to perform web scraping in an efficient and scalable manner.

## What is Multithreaded Web Scraping?

Multithreaded web scraping is a technique that involves dividing the web scraping task into multiple threads. Each thread performs a specific part of the scraping process, such as downloading web pages, parsing HTML, or saving data to a database. By using multiple threads, the scraping process can be performed in parallel, which can significantly improve the speed and efficiency of the scraping task.

## Why use Multithreaded Web Scraping?

There are several reasons why multithreaded web scraping is beneficial. Firstly, it can significantly reduce the time required to scrape large amounts of data from multiple websites. Secondly, it can improve the performance of the scraping process by utilizing the resources of the machine more efficiently. Lastly, it can help avoid potential roadblocks like getting blocked by a website due to the overloading of requests from a single IP address.

## How to implement Multithreaded Web Scraping in Node.js?

To implement multithreaded web scraping in Node.js, we can use a library called “cluster”. The cluster library enables the creation of child processes that can run in parallel and communicate with each other through a shared memory space. By creating multiple child processes, we can distribute the scraping task across all available cores of the CPU.

Running the code
In this code example, we use `tabnews.com.br` as a target. The objective is to generate the JSON files listing the article’s title and URL to each page.

## Our code will :

1 — Start the master process and fork each cluster process based on CPUs available;

2 — Apply the Web Scraping engine to each cluster;

3 — Read the page, generate de screenshot, and breakdown content in the article list;

4 — Save a .json file with the article’s title and URL;

5 — Finish the process and restart another;

## The Code !
Get all code on [GitHub](https://github.com/olavomello/node-multithreading-webscraping).

Let’s stay connected

Hope be useful and you enjoy it!

Connect me on [Linkedin](https://www.linkedin.com/in/olavo-mello/) and follow me to see what comes next ;)

Cya ! :)
3 Best Woodworking Techniques
Tags: woodworking
Published: 2023-05-18 15:24:19

Woodworking is a timeless craft that combines artistry, precision, and skill to create beautiful and functional pieces. Whether you're a beginner or a seasoned craftsman, mastering essential woodworking techniques is crucial for bringing your woodworking projects to life. In this article, we will explore three of the best woodworking techniques that every woodworker should strive to master. These techniques will not only enhance the quality of your work but also expand your creative possibilities in the world of woodworking.

Dovetail Joinery:
Dovetail joinery is a classic woodworking technique that creates strong and visually appealing joints. This method involves interlocking trapezoidal-shaped tails and pins, creating a tight connection that resists pulling apart. Dovetail joints are commonly used in constructing drawers, cabinets, and boxes. Not only do they provide exceptional strength, but they also add an aesthetic appeal to the overall design of the piece. Mastering the art of dovetail joinery requires patience, precision, and the use of specialized hand tools or router jigs. Once perfected, this technique will elevate your woodworking projects to the next level.

Mortise and Tenon Joints:
The mortise and tenon joint is another fundamental technique widely used in woodworking. This technique involves creating a rectangular hole (mortise) in one piece of wood and a corresponding projecting tongue (tenon) on another piece. When fitted together, they form a strong and durable joint. Mortise and tenon joints are often employed in constructing furniture frames, tables, chairs, and doors. This technique offers excellent structural integrity and can withstand the test of time. There are various types of mortise and tenon joints, such as through mortise and tenon, blind mortise and tenon, and haunched mortise and tenon. By mastering this technique, you can ensure the longevity and stability of your woodworking projects.

Hand Planing and Shaping:
While power tools have become prevalent in modern woodworking, the art of hand planing and shaping is a skill that every woodworker should develop. Hand planes allow craftsmen to smooth and shape wood surfaces with precision and control, creating a beautiful finish. Additionally, hand tools such as chisels, rasps, and spokeshaves provide the ability to shape intricate details and contours that may be challenging to achieve with power tools alone. The tactile experience of working with hand tools adds a unique connection to the wood and allows for greater finesse in the final result. Incorporating hand planing and shaping techniques into your woodworking repertoire will enhance your craftsmanship and enable you to create truly personalized and refined pieces.

3D Woodworking is a great tool for woodworkers. Using particular 3D Woodworking Plan you can take exact measurements, view project parts, have better insight and build your project easily. 
https://3dwoodworking.org/
Creating a Google Chrome Extension using HTML + CSS + Javascript
Tags: javascript, chrome, development
Published: 2023-05-18 19:50:23


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



An extension can be useful for several projects and specific situations, so I decided to make it available to you so that you understand a little more about how an extension for Google Chrome can be useful and simple to implement. In addition, you who are probably a regular reader of TabNews, will have an easy way to follow the articles.

You can check this out on [GitHub](https://github.com/olavomello/google-chrome-extension).

Feel free to send your PR and improve the implementation of this small project. Below I describe a little more how it is and some challenges to implementing it.

## TabNews Reader

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



TabNews RSS reader with recent article listing function and Dark Mode option enabled according to user’s default selection.

Challenges
Logically, this is not an official TabNews project, so access to RSS is blocked via CORS. To get around reading the data, I used a free routing proxy that basically loads the data and returns it to the application.

Usage
Sign in on Google Chrome
More Tools;
Extensions;
Activate “Developer Mode” at the top right;
“Load without compression” top left button;
Ready. The TabNews Reader extension will be installed in your browser. Just access it along with the other extensions.

Google Chrome Store
It is possible to package and submit the extension to the Chrome Store, but at a one-time cost for extension developers. As this is not my case, I will not go up to the store (for now) ;)

For those who want to know more about uploading their extension to the Google Chrome Store: https://developer.chrome.com/docs/webstore/register/

Finishing
Well, that’s it. I hope this material is useful to you and your projects. Follow me on [Linkedin](https://www.linkedin.com/in/olavo-mello/) and stay on top of many things to come ;)
Is a project really Open Source without a public VCS?
Tags: opensource, discuss, programming
Published: 2023-05-18 19:22:31

---
title: Is a project really Open Source without a public VCS?
published: true
description: Are projects that are only available on PyPI, npm, RubyGems, PEAR, CPAN really open source?
tags: opensource, discuss, programming
series: opensource
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2023-05-18 19:05 +0000
---

I am working on several projects monitoring recent uploads [PyPI](https://pydigger.com/), [RubyGems](https://ruby-digger.code-maven.com/), and [CPAN](https://cpan-digger.perlmaven.com/) and analyzing them.

One of the most basic items I am looking for is a link to their public VCS on GitHub, GitLab, or elsewhere.

It turns out that a large percentage of them do NOT link to their public VCS.

When I have time I try to track down the repository and either open an issue or send a Pull-Request to change the meta-data of the project to include the link.

Sometimes I even send an e-mail to the authors asking if they have public VCS.

Some tell me they either don't have a public VCS (or no VCS at all). For some I find out that the repository is not up-to-date. eg. in [this project](https://github.com/zezim/sticapi_client/issues/1) I was told the project is internal to some organization.

## Are they Open Source?

I wonder, are such project still open source? They might have an [OSI approved license](https://opensource.org/licenses/), but can someone really access the source code and make changes to the project in a reasonable way?

See point 2. in the [Open Source definition](https://opensource.org/osd/) 

Strictly speaking there is no requirement to have a public VCS, but there is a requirement to have easy access to the source code and to make it possible to change the source code. Do these distribute packages satisfy this requirement?
How I can verify that an incomming http body is multipart/form-data using regex and nodejs?
Tags: howto, http, programming, node
Published: 2023-05-18 19:06:54

In my [project](https://github.com/pc-magas/http-manipulator) I need to detect the content-type of http bodies ignoring the `Content-Type` header.

And I was stuck upon detecting multipart/form-data ones. After some tests, I used the regex in the question bellow:

{% stackoverflow 76283735 %}