teleren/devto huggingface dataset:
Node.js 20: What's New and Exciting Features in the Latest Release
Tags: node, javascript, webdev, news
Published: 2023-04-18 19:40:24

## Latest Node.js 20 Release and Features

Node.js 20 is the latest version of the popular JavaScript runtime environment, and it is packed with exciting new features. Node.js 20 is the first major release of the platform since the Node.js 12 LTS was released in 2019.

### Key Features

#### 1. Improved performance

Node.js 20 has improved performance over previous versions, with better support for modern JavaScript features and faster startup times.

#### 2. Improved security

Node.js 20 comes with enhanced security features such as improved support for TLS 1.3, and stronger cryptography for secure communications.

#### 3. Improved TypeScript support

Node.js 20 provides improved support for TypeScript, making it easier to use the popular TypeScript language for developing Node.js applications.

#### 4. Improved debugging experience

Node.js 20 comes with a new debugging experience, making it easier to debug and troubleshoot Node.js applications.

#### 5. Improved error handling

Node.js 20 has improved error handling, making it easier for developers to catch and handle errors in their applications.

### Conclusion

Node.js 20 is an exciting new version of the popular JavaScript runtime environment. It comes with a range of new features and improvements, including improved performance, security, TypeScript support, debugging experience, and error handling.
How to install Java in Pop!_Os
Tags: java, jdk, linux, beginners
Published: 2023-04-18 19:21:35

Java is a programming language that is widely used in the development of software applications, particularly for web and mobile platforms. Pop!_OS, on the other hand, is a Linux distribution that is based on Ubuntu and is designed to be user-friendly for developers and power users.

Java can be used on Pop!_OS, just like any other operating system. You can install the Java Development Kit (JDK) on Pop!_OS, which includes the Java Virtual Machine (JVM) and other tools necessary for Java development. There are also several integrated development environments (IDEs) available for Java development on Pop!_OS, such as Eclipse, IntelliJ IDEA, and NetBeans.

To install Java on Pop!_OS using apt, you can follow these steps:

1. Open the terminal by pressing Ctrl+Alt+T on your keyboard.

2. Update the package list by running the following command:

```
sudo apt update
```

3. Install the default-jdk package, which includes the Java Development Kit, by running the following command:


```
sudo apt install default-jdk
```


4. This command will only install the default JRE – Java Runtime Environment from OpenJDK 11. To install the default JDK – Java Development Kit from OpenJDK 11, you will need to enter another command:

```
sudo apt install default-jdk
```

Verify that Java is installed correctly by checking the version number. You can do this by running the following command:

```
java -version
```


![java -version](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7inyxwefn4ayz9c35o73.png)




This should output information about the version of Java that is installed on your system. Congrats!.
Explain Coding Like I'm Five
Tags: explainlikeimfive, beginners, productivity, discuss
Published: 2023-04-18 19:20:44

I just started a coding program and I am slowly discovering more and more. How should I manage my focus down to what is important in transition from a boot camp to the work field. The program is a 6 month online course with Berkeley extension program. It will teach me full stack development after I finish, I want to hit the ground running and would love to hear guidance on how to accomplish that! As I type I have little to no knowledge on coding or programming. Thanks if you read this and good luck on your journey!
Delete Edges from Apache AGE
Tags: apacheage, graphdatabase, database, postgres
Published: 2023-04-18 19:20:11

In Apache AGE, we can delete any edge by using `DELETE` command. 

**Query:**
`SELECT * 
FROM cypher('graph_name', $$
	MATCH (n {name: 'Andres'})-[r:KNOWS]->()
	DELETE r
$$) as (v agtype);`

Explanation:
Firstly, we find the edge we want to delete by using `MATCH` for instance, `MATCH (n {name: 'Andres'})-[r:KNOWS]->()`. Then, we delete that edge by using, `DELETE r`.


For more details visit: https://age.apache.org/overview/

**AGE Github Link:** https://github.com/apache/age

**AGE Viewer Github Link:** https://github.com/apache/age-viewer
Switching Between camelCase and snake_case in Neovim using Lua
Tags: neovim, camelcase, snakecase, lua
Published: 2023-04-18 19:19:42

## Introduction:
In this blog post, we'll demonstrate how to create a custom Lua function for Neovim that allows you to switch between `camelCase` and `snake_case` for variable names. This can be quite useful when you're working with different programming languages or projects that follow different naming conventions. We'll also show you how to create a key binding for this function, allowing you to quickly toggle between the two cases with a simple key combination.

</br>
![Demo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m8s3tsnr6mtd93r2klog.gif)
</br>

## Step 1: Create the Lua Function
To get started, create a new Lua file called `switch_case.lua` in your Neovim configuration directory (typically `~/.config/nvim/` or `~/.config/nvim/lua/`). Add the following code to this file:

```lua
local function switch_case()
  local line, col = unpack(vim.api.nvim_win_get_cursor(0))
  local word = vim.fn.expand('<cword>')
  local word_start = vim.fn.matchstrpos(vim.fn.getline('.'), '\\k*\\%' .. (col+1) .. 'c\\k*')[2]

  -- Detect camelCase
  if word:find('[a-z][A-Z]') then
    -- Convert camelCase to snake_case
    local snake_case_word = word:gsub('([a-z])([A-Z])', '%1_%2'):lower()
    vim.api.nvim_buf_set_text(0, line - 1, word_start, line - 1, word_start + #word, {snake_case_word})
  -- Detect snake_case
  elseif word:find('_[a-z]') then
    -- Convert snake_case to camelCase
    local camel_case_word = word:gsub('(_)([a-z])', function(_, l) return l:upper() end)
    vim.api.nvim_buf_set_text(0, line - 1, word_start, line - 1, word_start + #word, {camel_case_word})
  else
    print("Not a snake_case or camelCase word")
  end
end

return { switch_case = switch_case }
```

This function detects the case of the word under the cursor and converts it to the other case. The word's starting position within the line is calculated using the `matchstrpos` function, ensuring accurate replacement even if the cursor is in the middle of the word.

## Step 2: Add the Function to Your Neovim Configuration
Now, let's add the Lua function to your Neovim configuration file (`init.vim` or `init.lua`). You'll also create a key binding for the function, allowing you to switch between `camelCase` and `snake_case` with a key combination. In this example, we'll use the `<Leader>s` key combination.

For `init.vim`:

```vim
luafile ~/.config/nvim/switch_case.lua
nnoremap <Leader>s :lua require'switch_case'.switch_case()<CR>
```

For `init.lua`:

```lua
require'switch_case'
vim.api.nvim_set_keymap('n', '<Leader>s', '<cmd>lua require("switch_case").switch_case()<CR>', {noremap = true, silent = true})
```

## Step 3: Test Your New Function
With the function and key binding in place, open a file in Neovim and test it out. Place the cursor on a word in `camelCase` or `snake_case`, and press `<Leader>s`. The word should be converted to the other case.

## Conclusion:
This blog post has demonstrated how to create a custom Lua function for Neovim to switch between `camelCase` and `snake_case` naming conventions. By incorporating this
Laravel Invokable Controllers: Simplify Route Handling for Faster Development
Tags: laravel, php, tutorial, productivity
Published: 2023-04-18 19:03:18


## What are invokable controllers?

Invokable controllers are a special type of controller in Laravel that allow you to define a single  `__invoke()`  method to handle a route instead of defining multiple action methods.

In Laravel, a controller is a PHP class that handles HTTP requests and manages the application's response. An invokable controller is a special type of controller in Laravel that allows you to define a single  `__invoke()` the method instead of defining multiple action methods like  `index()`,  `store()`,  `show()`  etc.

Invokable controllers are supported in Laravel 5.3 or later versions. So, if you're using a version of Laravel earlier than 5.3, you won't be able to use invokable controllers.

Using an invokable controller, you can define a single action for a particular route, and Laravel will automatically call the  `__invoke()`  method when that route is requested. This can be useful when you have a simple action to perform, and you don't want to create a separate method in your controller for it.

To create an invokable controller, you need to define a class with a  `__invoke()`  method. Here's an example:

```php
<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class ExampleController extends Controller
{
    public function __invoke(Request $request)
    {
        return "Hello, World!";
    }
}
```

In the example above, we have created an invokable controller called  `ExampleController`. It has a single  `__invoke()`  method that returns the string "Hello, World!".

To use this controller, you can define a route like this:

```php
Route::get('/example', ExampleController::class);
```

In this route definition, we have specified the  `ExampleController`  class as the controller for the  `/example`  route. When a user visits this route, Laravel will automatically call the  `__invoke()`  method on the  `ExampleController`  class and return the "Hello, World!" string.

In conclusion, an invokable controller in Laravel is a convenient way to define a single action for a particular route, without having to create multiple methods in your controller. It can make your code more concise and easier to read, and can help you build applications more quickly.
Expose Child Component Methods to Parent Components with Vue 3 defineExpose
Tags: vue, javascript
Published: 2023-04-18 18:55:01

Vue 3's Composition API introduces a new method for exposing components' public methods and properties to their parent components called **`defineExpose`**. This method allows you to define what parts of your component should be publicly accessible, making it easier to use child components in parent components.

To use `defineExpose`, you need to **define it in your child component** and use it to **expose the methods or properties** you want to make public. Here's an example with **Vue 3 (script setup)**:

`childComponent.vue`

```js 
<template>
  <div>
    <button @click="increment">{{ count }}</button>
  </div>
</template>

<script setup>
  import { ref } from 'vue'

  const count = ref(0)

  const increment = () => {
    count.value++
  }

  const double = () => {
    count.value *= 2
  }

  defineExpose({
    increment,
    count
  })
</script>
```

In this example, we have a child component that has a `count` ref and two methods: `increment` and `double`. We want to expose the `increment` method and the `count` ref to the parent component using `defineExpose`.

Now let's see how to use this child component in a parent component and access its public methods and properties:

`parentComponent.vue`

```js
<template>
  <div>
    <ChildComponent ref="child" />
    <button @click="onChildClick">Call Child's Increment Method</button>
    <p>Child's Count: {{ childCount }}</p>
  </div>
</template>

<script setup>
  import ChildComponent from './ChildComponent.vue'
  import { ref } from 'vue'

  const child = ref(null)
  const childCount = ref(0)

  const onChildClick = () => {
    child.value.increment()
  }

  onMounted(() => {
    childCount.value = child.value.count
  })
</script>
```

In this parent component, we import the child component and use a ref to access its methods and properties. We can call the child component's increment method by calling `child.value.increment()`, and we can access its `count` ref by calling `child.value.count`.

Using `defineExpose` can make it much easier to work with child components in parent components because you can control what parts of the child component are accessible and avoid accidentally accessing private methods or properties.

That's it! With defineExpose, you can expose public methods and properties of your child components to their parent components and make your code more organized and easier to use.

**Futher Reading:**
https://vuejs.org/api/sfc-script-setup.html#defineexpose
Phind: The AI search engine for developers.
Tags: searchengine, developer, ai, learning
Published: 2023-04-18 18:39:26

Great news for developers! There is a new AI-powered search engine made specifically for developers called Phind. 

One of the significant benefits of using Phind is its capability to provide the latest updates on APIs, libraries, and frameworks. Since it regularly extracts the most recent information from the internet, you can be assured that you are receiving the most up-to-date information that is available. Unlike other language models, such as ChatGPT, which has a limited knowledge capacity, Phind is consistently learning and enhancing. Therefore, as new information emerges, Phind will continue to provide precise and relevant information to your questions.

Give Phind a try. https://www.phind.com/
Linked In profile Scraping
Tags: puppette, node, scraping, linkedin
Published: 2023-04-18 18:35:59

Hello everyOne 
I am trying to scrape a user's LinkedIn profile, but when the page opens in Chrome, it redirects to the login page. However, I want to scrape the user's information without logging in. Can someone help me with how to scrape the user's profile using node.js and puppeteer?
`const browser = await puppeteer.launch({
        // timeout: 30000,
        args: ['--no-sandbox'],
        headless: true,
        // devtools: false
    });
    const page = await browser.newPage();
    await page.goto('https://www.linkedin.com/in/ishaqbhojani', {
        waitUntil: ['domcontentloaded', 'load', 'networkidle0', 'networkidle2']
    })
    // await page.goto()
    await delay(800)
    let profile = await page.evaluate(() => {
        const name = document.querySelector('.pv-top-card--list > li:first-child')?.innerText;
        const title = document.querySelector('.pv-top-card--list > li:nth-child(2)')?.innerText;
        const location = document.querySelector('.pv-top-card--list > li:nth-child(3)')?.innerText;
        const summary = document.querySelector('.pv-about-section .pv-about__summary-text')?.innerText;
        const experience = Array.from(document.querySelectorAll('.pv-profile-section__card-item-v2')).map(item => ({
            title: item.querySelector('.pv-entity__summary-info > h3')?.innerText,
            company: item.querySelector('.pv-entity__secondary-title')?.innerText,
            date: item.querySelector('.pv-entity__date-range > span:last-child')?.innerText,
            description: item.querySelector('.pv-entity__description')?.innerText,
        }));
        return { name, title, location, summary, experience };
    })
    console.log(profile)
    await browser.close()   `
How to use SVGs in React Native.
Tags: reactnative, react, javascript, mobile
Published: 2023-04-18 18:27:02

In this post we will see how you can use SVG images in a react native application.

In React Native, normal images can be rendered without any additional changes, rendering an SVG requires additional configurations.

In your react native application, first install the following packages to use SVG images.

```jsx
npm i react-native-svg
npm i react-native-svg-transformer
```

Enter into the `android folder -> app folder -> build.gradle` and add the following line at the end of the file.

```jsx
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
```

Go inside the iOS folder and run pod install.

After installing the packages and implementing the above steps, enter into this `metro.config.js` file and copy and paste the below code to make sure SVG files are rendered properly.

```jsx
const {getDefaultConfig} = require('metro-config');

module.exports = (async () => {
  const {
    resolver: {sourceExts, assetExts},
  } = await getDefaultConfig();

  return {
    transformer: {
      babelTransformerPath: require.resolve('react-native-svg-transformer'),
      getTransformOptions: async () => ({
        transform: {
          experimentalImportSupport: false,
          inlineRequires: true,
        },
      }),
    },
    resolver: {
      assetExts: assetExts.filter(ext => ext !== 'svg'),
      sourceExts: [...sourceExts, 'svg'],
    },
  };
})();

```

Lets take you have a SVG called logo.svg, what we have to do is we have to import it in your file and use it as a normal tag with height and width as a prop. You can see the code example below.

```jsx
import {View} from 'react-native';
import React from 'react';
import Logo from './logo.svg';

const App = () => {
  return (
    <View>
      <Logo height={45} width={45} />
    </View>
  );
};

export default App;
```

You should be able to see your SVG rendered in your screen. This is how you use SVGs in your react native application.

To know more about React & React Native you can checkout my courses in Udemy.

https://www.udemy.com/course/react-native-for-absolute-beginners-with-react-hooks/
which github-tools do you use for your project mgmt. ?
Published: 2023-04-18 17:59:44


which github-tools do you use for your project mgmt?


which github-tools do you use for your project mgmt.

Organizations have been using GitHub Issues for project management for some time. GitHub Issues is essentially a system for describing issues,for tracking their progress and communicating around them.

**Milestones:** These can be used, for example, to track the progress of groups of issues or simply track them via pull requests in a project. When you create a milestone, effectively sets a "due date" for any issues/pull requests you associate with it.

**Wikis**: Every GitHub repository has a section for hosting dateb and also documentation called a wiki.

**Automated triggers:** A success factor of the GitHub project management system is that it also contains so-called triggers that automatically move tasks.

**Issues**: this is mainly used for bug tracking, but its core functionality means that it is also a useful tool for more general project management purposes.

which github-tools do you use for your project mgmt. Are there some tools out there that work like trello for example?

i want to get to know more github-tools.
41 berufliches Vorwärtskommen: Wie einige zu Einflüsterern werden.
Tags: deutsch, career, motivation, discuss
Published: 2023-04-18 17:59:00

Moin Moin,

wie kommt es dazu, dass einige Arbeitskollegen über einen anderen Lügen verbreiten, ihn „kritisieren“ und regelmäßig Fehlbewertungen über ihn anstellen, und dies auch noch heimlich?

Sicherlich kann es sein, dass diese neidisch auf die Leistungen ihres Kollegen sind. Möglich ist auch, dass sie ihm einfach etwas missgönnen. Es gibt jedoch noch einen weiteren möglichen Zustand in dem sich die Einflüsterer befinden können.
> Dünkel := übertrieben hohe Meinung von sich selbst, Hochmut

( Quelle: [dwds.de↗](https://www.dwds.de/wb/D%C3%BCnkel) )

Wenn jemand, weshalb auch immer, übertrieben viel von sich hält, so kann es ihm schwerfallen, ähnlich gute oder bessere Leistungen anderer anzuerkennen. Um seine Übertreibung fortführen zu können, müssen andere deutlich schlechter dastehen. Ansonsten könnte so einer sich nicht einreden besonders zu sein und hätte daher auch keine _übertrieben hohe Meinung von sich selbst_.

1. Meinst du, dass Rückmeldegespräche am Arbeitsplatz dem Dünkel vorbeugen können?
2. Was sind deine Erfahrungen zu Rückmeldegesprächen und Dünkel?

Beste Grüße,
Mustafa

Austausch mittels E-Mail: mustafa.kevin.dwenger@posteo.de
Betreff: Austausch
HOW TO CREATE TAGS IN MICROSOFT AZURE AND HOW TO DELETE THEM.
Tags: beginners, azure, cloud
Published: 2023-04-18 17:15:13

**STEP1**
1a: In your azure portal, search and select "Policy"

Step 1a image: ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/84jn0p28n3v4vttw9t64.png)

**STEP 2**
2a: Click on "Assignments"

Step 2a image![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7ny733p1ochuxjww4l4t.png)

**STEP 3**
3a: Click on "Assign Policy"

**STEP 4**
4a: Click on policy definitions"
4b: Search for "Tag" in the search bar then choose "Require a tag and it’s value on resources" from the options.
4c: Click on Add"
 
Step 4a image ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yjtr0pnf4xhqm4plzhnz.png)
Step 4b ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o0x1wur9ce1j1scfl34d.png)

**STEP 5**
5a: Click on parameters" to input your Tag name and Tag value (Tag name can be a name of the environment while Tag value or the specifics of the environment).
5b: Click on review+create
5c: Click on create 

Step 5a images![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q2cqwi40c72tzfk2fka0.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qu4wpi0xe48e8k50y2ti.png)

**STEP 6** -Creating a storage account to add the tag we just created.
6a: Go back to your Home page" and click on "storage account"
6b: Click on create
6c: Choose your subscription, choose a resource group or create a new one. Give your storage account a name, choose a region.
6d: Click on Tag" heading.
6e: Add the name and value you used in step 5.
6f: Click on review then click on create.

Step 6a image ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hhsopivmwdj9g1kbrtbi.png) 
Step 6d and 6e image 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/31vi3adb4qmmc73v111b.png) 


**STEP 7** Deleting the tag we just created 
7a: Go back to the Home page, On the search bar, search and select 'Policy
7b: Click  on "Require a tag and it’s value on resource"
7c: Click on "Delete Assignment"