teleren/devto huggingface dataset:
Go Vuln the Golang Vulnerability Database
Tags: todayilearned, go, security
Published: 2022-11-09 13:33:04

## What is govuln?

govuln is a new vulnerability database for looking your code for vulnerable packages and prevent supply chain attacks

## How to install the `govulncheck` cli

`govulncheck` is the command line inferface for interacting with the database and checking your code against it, install it with the following command:

```bash
go install golang.org/x/vuln/cmd/govulncheck@latest
```

Then run it in your project as follows:

```bash
govulncheck .
```

It will search in your dependencies for vulnerable packages. Here is an example of the output: 

```bash
govulncheck is an experimental tool. Share feedback at https://go.dev/s/govulncheck-feedback.

Scanning for dependencies with known vulnerabilities...
No vulnerabilities found.

=== Informational ===

The vulnerabilities below are in packages that you import, but your code
doesn't appear to call any vulnerable functions. You may not need to take any
action. See https://pkg.go.dev/golang.org/x/vuln/cmd/govulncheck
for details.

Vulnerability #1: GO-2022-1095
  Due to unsanitized NUL values, attackers may be able to maliciously set environment variables on Windows.

  In syscall.StartProcess and os/exec.Cmd, invalid environment variable values containing NUL values are not properly checked for. A malicious environment variable value can exploit this behavior to set a value for a different environment variable. For example, the environment variable string "A=B\x00C=D" sets the variables "A=B" and "C=D".
  Found in: syscall@go1.19.1
  Fixed in: syscall@go1.19.3
  More info: https://pkg.go.dev/vuln/GO-2022-1095
```

For more details check the official doc: [https://go.dev/security/vuln/](https://go.dev/security/vuln/) and the talk given during the 2022 go day titled [
Writing your Applications Faster and More Securely with Go
](https://www.youtube.com/watch?v=aw7lFSFGKZs) which also covers Fuzzy Testing but that is for another TIL
Breaking Down ViteConf
Tags: webdev, javascript, beginners, podcast
Published: 2022-11-09 13:24:02


Original: https://codingcat.dev/podcast/2-46-Breaking-Down-ViteConf

{% youtube https://youtu.be/b0-dmL7jP88 %}

## Questions

1. Can you tell us more about yourself?
2. What is Vite?
3. Why and how did Vite Conf become a thing?
4. [https://viteconf.org/schedule](https://viteconf.org/schedule)
5. Codeflow
Non-relational Database
Tags: database, nonrelationaldatabase, beginners, tutorial
Published: 2022-11-09 13:14:30

We discussed relational databases in my previous article [here](https://dev.to/pragyasapkota/relational-database-43l4). And as we know there is one other type of database — a non-relational database. Let’s take this blog to understand the basic concept of a non-relational database.

A non-relational database is a less rigid database that provides more flexibility to the structure of data stored. The operations to store the data in a non-relational database present the data as ‘key-value’ pairs. Let’s see an example of data stored in a non-relational database as an array of ‘key-value’ pair objects.

```
[ {
    name: 'Pragya',
    rank: '1',
    gender: 'F',
    year: 2056,
  },
  {
    name: 'Dipen',
    rank: '3',
    gender: 'M',
    year: 2072,
  },
  {
   ........
  },
  ............
]
```

As we talked about how and why the [relational database](https://dev.to/pragyasapkota/relational-database-43l4) is called a SQL database, the non-relational is by default the “NoSQL” database. There are some great benefits of not needing to consistently structure data under the NoSQL database.

## BASE Transaction

Like the ACID (Atomicity, Consistency, Isolation, Durability) in the [relational database](https://dev.to/pragyasapkota/relational-database-43l4) — non-relational database or the NoSQL database has BASE transactions.

BA = Basically Available

S = Soft State

E = Eventual Consistency

Let’s explore them individually,

### Basically Available

The first feature Basically Available promises us that the system will be highly available at any time of need.

### Soft State

Likewise, the soft state tells us that the state of the system may change over time — sometimes even without input.

### Eventual Consistency

The system can be consistent for a certain and short time unless other inputs are fed to it.

## Conclusion

The non-relational database uses a hash-table-like structure whose concepts have been discussed [here](https://dev.to/pragyasapkota/hashing-5bi7). This leads to fast and simple operations that are perfect for [caching](https://dev.to/pragyasapkota/caching-200e), environment variables, configuration files, session states, etc. Unlike relational databases, it can be used in both memory and persistent storage.

We have heard of some other “JSON-like” databases that are document databases among which we might have heard the most-loved one — MongoDB (Technically a BSON database). However, at the core, all of these are the ‘key-value’ stores too.

{% embed https://github.com/Pragya2056/System-Design-Concepts %}

**_I hope this article was helpful to you._**

**_Please don’t forget to follow me!!!_**

**_Any kind of feedback or comment is welcome!!!_**

**_Thank you for your time and support!!!!_**

**_Keep Reading!! Keep Learning!!!_**
Functions In JavaScript
Tags: webdev, javascript, beginners, tutorial
Published: 2022-11-09 13:13:59

## Functions in JavaScript

 Functions are one of the fundamental elements of JavaScript. A function in JavaScript is similar to a procedure in that it is a group of statements that perform an action or compute a value. However, a process must accept an input and create an output with a clear connection between the input and the outcome in order to be termed a function.
A function in JavaScript enables you to name a piece of code, define it, and then execute it as many times as you like.
Reusing a function eliminates the need for repetitive code because it can be called as many times as needed within a program.

## Types of functions in Javascript

**How to use function**

 Prior to delving deeply into functions, we must first understand how to use functions.
The function keyword is used to define a JavaScript function, which is then followed by the function's name and parenthesis ().
Function names may also include underscores, dollar signs, and other characters (same rules as variables).
Names of parameters may be included in parenthesis and separated by commas: (parameter1, parameter2, ...)
Curly brackets enclose the code that the function will execute: {}

**_Function Expression_**

JavaScript allows us to assign a function to a variable and then use that variable as a function. It is called function expression.

**_Anonymous Function_**

JavaScript allows us to define a function without any name. This unnamed function is called anonymous function. Anonymous function must be assigned to a variable.

**_Nested Functions_**

 A function in JavaScript may have one or more inner functions. The outer function's scope includes these nested functions. Variables and parameters of the outer function are accessible to the inner function. However, variables specified within inner functions cannot be accessed by outer functions.

**_Function Scope_**

JavaScript has function scope: Each function creates a new scope.


 A function's declared variables cannot be accessed or seen from outside the function.
When declared inside a function, variables declared using var, let, and const are quite similar to one another.

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

## How they are checking for variables

 The **_typeof_** operator in JavaScript is used to determine the type of a variable, object, or method. The number, boolean, object, string, undefined, and function types are among those that are returned by the typeof operator. You only need to write typeof > a space " " > and the variable or object whose type you want to check in order to determine the type of any variable.
Javascript Functions
Published: 2022-11-09 13:02:19


A JavaScript function is a block of code designed to perform a particular task. A JavaScript function is executed when "something" calls it. For example,
function Function1(number1, number2) {
  return number1 + number2;
}
And this is how we would calculate the sum of number1 and number2. As we just saw the Javascript function is defined by the keyword function. It also uses parentheses. Function names can contain letters, digits, and underscores. The code to be executed, by the function, is placed inside curly brackets. When JavaScript reaches a return statement, the function will stop executing. If the function was invoked from a statement, JavaScript will "return" to execute the code after the invoking statement. Functions are the main “building blocks” of the program. They allow the code to be called many times without repetition. 
Function scope is one of the scopes of Javascript which is included in a local scope. Variables defined inside a function are not accessible (visible) from outside the function. Variables declared with var, let and const all have a function scope. Variables defined inside a function cannot be accessed from anywhere outside the function, because the variable is defined only in the scope of the function. A function can have one or more parameters, which will be supplied by the calling code and can be used inside a function. JavaScript is a dynamic type scripting language, so a function parameter can have a value of any data type.
Fast Forward: Let's build the good internet together
Tags: opensource, news, community, fastforward
Published: 2022-11-09 13:01:41

## We have big news to share! ⏩

In three years of managing Fastly's open source program, I've met so many incredible, creative people - developers in our open source program, colleagues, friends - working on many impactful projects. They're solving fundamental flaws with the internet's infrastructure, improving people's lives, and giving us all a sense of wonder and whimsy. I'm inspired by them.

Open source is software and a social contract. To use it is to agree to build according to a set of values and to give back to it in whatever way you can.

We believe it's imperative to build openly, transparently, and collaboratively to make the internet a better place. We apply these values to the way we work with others and the technologies we build. You can read more about what these values mean to us in [this post by Anil Dash](https://www.fastly.com/blog/a-better-internet-needs-us-all-to-build-openly-transparently-and-most).

Today we're talking about how we contribute to the open internet. We believe that every contribution counts: code, community, and good conduct. With that said, I'm really excited to announce our expanded support for open source and the open internet - Fast Forward.

## Here's what it means.

Fast Forward represents several different programs supporting the systems making the internet safer, faster, and more engaging. We want to make the experience of being online better for everyone, from protecting your data and identity online to making sure shows stream smoothly and apps download fast, even in rural areas. And we want to build and be a part of communities that are inclusive and friendly because we believe that's when we build the best stuff. You can read more about the ways we contribute to the [open internet from Artur Bergman and me](fastly.com/blog/fast-forward-lets-build-the-good-internet-together).

I want to give special space to the Fast Forward Program here - we've made a huge commitment to supporting the open source community, and I want to make sure you know about it. Since 2014, Fastly has donated free services to open source projects like Rust, Apache, and Scratch. And we want to support you too! You can read more about how we support, eligibility, and [apply on our site](https://www.fastly.com/fast-forward).

Let's build the good internet. Together.
what is yahoo mail
Tags: yahoo, ymail, webdev
Published: 2022-11-09 12:55:45

Ymail or Yahoo As a resident of the 21st century, you’ve most likely read about or heard people mention Yahoo (aka Yahoo!) at least once in your life. But even though this company has been a leader on the internet since its early days (1995 to be exact), you may not know exactly what Yahoo is or what it’s for. Frankly, even people who already use Yahoo may not be aware of all the options they have! So let’s get everyone up to speed and answer those two fundamental questions: What is Yahoo and how to use it in the right way to benefit.

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

If you want to be able to access some of the best features Yahoo has to offer, you’ll have to first register on Yahoo and open a Yahoo account. You can do a few things on Yahoo without signing up, like read the news, check the weather and monitor stock prices, but everything gets better and more personalized when you have your own Yahoo account.

Source: [Ymail](https://ymail.info/)
Wednesday Links - Edition 2022-11-09
Tags: java, jvm, postgres, spring
Published: 2022-11-09 12:52:22

http://crt.sh allows direct postgresql access (30 sec)🔌
https://twitter.com/jschauma/status/1587601339072249856

How Postgres sequences issues can impact your messaging guarantees (6 min)🔢
https://event-driven.io/en/ordering_in_postgres_outbox/

Why do domain names sometimes end with a dot? (7 min)💠
https://jvns.ca/blog/2022/09/12/why-do-domain-names-end-with-a-dot-/

Stop requiring only one assertion per unit test: Multiple assertions are fine (6 min)🛋️
https://stackoverflow.blog/2022/11/03/multiple-assertions-per-test-are-fine

Current State of Spring Boot 2.7 GraalVM Native with Kotlin (5 min)🏆
https://medium.com/javarevisited/current-state-of-spring-boot-native-with-kotlin-graalvm-699b1812cc65

Spring Boot 3 Observability with Grafana (10 min)🐚
https://piotrminkowski.com/2022/11/03/spring-boot-3-observability-with-grafana

Understanding Java’s Project Loom (4 min)🧵
https://www.marcobehler.com/guides/java-project-loom

Add Import Statement Automatically For Unambiguous Java And Kotlin Classes In IntelliJ IDEA (1 min)📸
https://blog.mrhaki.com/2022/11/add-import-statement-automatically-for.html

Gradle Goodness: Defining Plugin Versions Using Version Catalog (2 min)📚
https://blog.mrhaki.com/2022/11/gradle-goodness-defining-plugin.html

SpringOne is going virtual (30 sec)💻
https://twitter.com/VMwareTanzu/status/1589672833923559424
React must have basic setup
Tags: react, javascript, webdev, architecture
Published: 2022-11-09 12:46:39

### Installation

```
npx create-react-app appName
```
OR with typescript
```
npx create-react-app appName --template typescript
```

### Absolute path
Absolute path help us to not care about the folder structure changes even in the middle of development or frequent folder structure changes as it can access files from the root or `src` folder

Create a file as `jsconfig.json` in the root of application and paste the code below:
```
{
  "compilerOptions": {
    "baseUrl": "src"
  },
  "include": ["src"]
}
```


### Don't go with CSS

`SCSS` instead of inbuilt `CSS`

Just include the below line in the `dependencies` inside the `package.json` file

```
"node-sass": "npm:sass@^1.49.9"
```
Ignore the above if you are using any style system

### Choose any UI library like bootstrap
Make page attractive even if its a assignment or learning based project
Paste it inside `index.html`
```
 <!-- CSS only -->
    <link
      href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/css/bootstrap.min.css"
      rel="stylesheet"
      integrity="sha384-Zenh87qX5JnK2Jl0vWa8Ck2rdkQ2Bzep5IDxbcnCeuOxjzrPF/et3URy9Bv1WTRi"
      crossorigin="anonymous"
    />
```

---

## optional


### Router Config

```
import { BrowserRouter, Routes, Route, NavLink } from "react-router-dom";
```
Set the config of path
```
<BrowserRouter>
        <div className="container">
            <Nav />
            <Routes>
              <Route index path="/" element={<Landing />} />
              <Route path="about" element={<About />} />
              <Route path="profile" element={<Profile />} />
            </Routes>
       
        </div>
 </BrowserRouter>
```
Use them
```
 <NavLink to="/" className="nav-link"> Home </NavLink>
```
How to check IntegrationHub Usage
Tags: servicenow, integrationhub, integrations
Published: 2022-11-09 12:34:04

You can find a detailed breakdown in the table 'ua_ih_usage'.

There you can see nicely how many transaction where consumed by which spoke. 
Its split up by month and you can drill in and see which action the call came from. Super handy to drill in and find out more.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eyiix3hpx72njzvf6jll.png)
JavaScript Variables
Tags: javascript, variables, programming
Published: 2022-11-09 12:30:16

To start with, a variable in JavaScript serves as a container for a strong data, like a number we might use in a multiplication, or a string that we might use as part of a sentence. 

There are two types of variables in JavaScript : local variable(is visible only within a function where it is defined and accessible within the function) and global variable(can be defines anywhere in the code).

While declaring a JavaScript variable, there are some rules.

1. Name of the variable must start with a letter, underscore( _ ), or dollar( $ ) sign.
2. After first letter we can use digits (0 to 9), for example variable123.
3. JavaScript variables are case sensitive, for example a and A are distinct variables.
4. Reserved words (like JavaScript keywords) cannot be used as names.

Below you can see a simple example of JavaScript variable. 
var m = 1;  
var k = 4;  
var z=m+k;  
console.log(z);  


VAR, LET, CONST

A little about the history.
The var keyword is used in all JavaScript code from 1995 to 2015.

The let and const keywords were added to JavaScript in 2015, therefore if you want your JavaScript code to run in older browsers, you must use var.

The difference between let and car
let allows to declare variables that are limited to the scope of a block statement, or expression on which it is used. 
The var keyword declares a variable globally, or locally to an entire function regardless of block scope.

We use const when we know that the value should not be changed and is a general rule(moreover, when someone will look at our code and see const, they will immediately understand that this name will never be assigned to a different value. Any time they see this name, they will know what it refers to.).

"Use const when you can, and use let when you have to."

JavaScript Scope
Scope determines the accessibility of variables, there are 3 types of Scopes - Block scope, Function scope and Global scope.

Block Scope
let and const keywords provide Block Scope in JavaScript. (you can see that var is not included, the reason I will explain later)
Variables declared inside a { } block cannot be accessed from outside the block:
Example

{
  let x = 6575;
}
// x can NOT be used here

var cannot have block scope, because var declares variable globally, for the whole code.
Example

{
  var a = 111;
}
// a CAN be used here

Function Scope
- var, let and const have function scope.
- each function creates a new scope.
- variables defined inside a function are not visible when we get out of function.
Example

function ourFunction() {
  let countryName = "Armenia";   // Function Scope
}

Global Scope
(a variable is global when it is defined outside a function)

Variables declared Globally have Global Scope.

In a JavaScript program, global variables can be accessed from anywhere.

Example

let bookName = "Xenty";
// code here can use bookName

function theFunction() {
// code here can also use bookName
}
The Dark side of social media
Tags: socialmedia
Published: 2022-11-09 12:21:38

On some level, most of us can admit that too much exposure to social media is unhealthy but when it comes to our personal lives, we often assume that we are not as affected as the rest of the world. The problem with this assumption, aside from it being wrong, is that as a result of our dismissive arrogance, we fail to work on the problem in our own lives. If you’re not sure whether you’re addicted to social networks, I dare you to remember the last time you went a full week without checking any of your social media accounts...
It is important that you realize the extent to which our continued exposure takes a toll on our physical and mental wellbeing. The more frequently we use social media, the more likely we are to grapple with poor mental health, anxiety and depression. One of the reasons for this is that social media apps are designed to fuel unrealistic comparisons. By allow you to see the carefully selected and beautifully captured best parts of everyone else’s lives, you can’t help but form unrealistic expectations of a “happy” and “successful” life. The result is that you will compare these curated and airbrushed versions of other people’s lives with the ‘negatives’ in your own life, become consumed by it and remain trapped in chasing the mirage that is a farce.
Ultimately, you need to understand that it is up to you to figure out how to use social media without causing yourself any psychological distress. If you aren’t paying for the products, realize that 
you are the product
 I had been taking steps towards reducing my social media usage and curbing the general screen time for my devices. Now, having realized more deeply this need to reduce my screen exposure, I have doubled down on my conscious efforts and have made immense progress so far.