teleren/devto huggingface dataset:
Scaling Ethereum with Polygon: A Layer 2 Solution for High Throughput and Low Fees
Tags: blockchain, polygon, layer2, architecture
Published: 2023-01-20 16:14:44

As the popularity of Ethereum and decentralized applications continues to grow, the network has faced scalability issues with its current capacity of only 13-15 transactions per second (TPS). This has led to heavy network congestion and high gas fees. One solution to this problem is the use of layer 2 scaling solutions, such as Polygon.

Polygon, formerly known as Matic Network, is a layer 2 scaling solution that utilizes off-chain computation to achieve high throughput. The Polygon mainnet, which has recently launched, boasts a capacity of 10,000 TPS. Additionally, the Mumbai testnet has been used to showcase the potential of Polygon's technology.



![Polygon Architecture](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qzdt26yv2i9o6x7inv4p.png)



One of the key features of Polygon is the use of a Proof of Stake (PoS) mechanism, similar to Ethereum's Beacon Chain. This allows for staking, checkpointing, and rewards for validators. The Heimdall Layer is a PoS mechanism that also has checkpointing capabilities, ensuring that any particular checkpoint state is authentic.

The Bor Layer is responsible for adding new blocks to the Matic chain, with every block having its own block hash. The Heimdall chain acts as a PoS Verification Layer, with checkpointing of BOR block representations and the sending of Merkle Root to the Ethereum Blockchain. The Polygon PoS Engine handles the selection of validators, using a staking logic similar to that of the Ethereum Mainnet.

Checkpointing occurs every 10-20 minutes, and to become a validator on the Polygon network, one must run a Tendermint node. For every few BOR blocks, one validator (on the Heimdall Layer) is chosen to validate all blocks since the last checkpoint, creating a Merkle tree of the block hashes. These checkpointed blocks provide finality on the root chain, as well as proof of burn in asset withdrawal.

Polygon also enables seamless transfer of tokens between the Ethereum mainnet and the Polygon mainnet, allowing for the transfer of not only coins but also other assets. The use of Polygon can greatly improve the scalability and usability of the Ethereum network, and its SDK for mobile apps and matic.js library make it easy for developers to build Polygon-based apps.
Configure um cluster Kubernetes de vários nós localmente - usando o KinD
Tags: kubernetes, docker, devops, tutorial
Published: 2023-01-20 15:56:15

_Se você está iniciando agora os seus estudos sobre Kubernetes é importante ter um cluster para se familiarizar_ com os componentes, comandos e etc. Existem muitas plataformas que oferecem clusters kubernetes para experimentar, entre elas o minikube, k3s, microk8s e etc, não recomendadas para produção. Para isso você pode ir com GKE (Google Cloud), EKS (AWS).

Existem plataformas como o [Play with Kubernetes](https://labs.play-with-k8s.com) que oferecem ambientes temporários, com isso você pode perder o seu aprendizado e objetos deployados no playground. Nos provedores de nuvem temos que desembolsar um valor considerável para ter um cluster, por isso o KinD - Kubernetes em Docker é uma boa alternativa pra quem está iniciando agora sua jornada e necessita de um ambiente de desenvolvimento e testes.

**Siga os passos abaixo para ter um cluster pra chamar de seu:
**

**1. Instale o Docker:**
Este exemplo baixa o script de https://get.docker.com/ e o executa para instalar a versão estável mais recente do Docker no Linux:
```
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
```

Você pode acessar a [documentação oficial](https://docs.docker.com/engine/install) para verificar como instalar em outros sistemas operacionais.

**2. Instale o Kubectl:
**
A instalação do kubectl em sua máquina permitirá que você acesse o cluster que iremos criar e outros no futuro.

```
sudo apt-get update
sudo apt-get install -y kubectl
```

O Kubectl também está disponível para macos e windows, [clique aqui](https://kubernetes.io/docs/tasks/tools).

**3. Instale o KinD:
**

```
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.9.0/kind-linux-amd64
chmod +x ./kind
mv ./kind /usr/local/bin/kind
```

**4. Criando um cluster:**
Agora temos o necessário para criar o nosso cluster, se você executar o comando:
```
kind create cluster
```
Ele irá criar um cluster com as configurações padrões, mas a partir de um arquivo de configuração podemos informar quantos nós desejamos.

**4.1. Criando um arquivo de configuração do KinD:**
A documentação oficial fornece um exemplo, [acessível clicando aqui](https://raw.githubusercontent.com/kubernetes-sigs/kind/main/site/content/docs/user/kind-example-config.yaml).

```
cat > kind-config.yaml <<EOF
# um cluster com 3 nós control plane e 3 workers
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
- role: control-plane
- role: control-plane
- role: worker
- role: worker
- role: worker
EOF
```
**4.2 Criando o nosso cluster:**

```
kind create cluster --name k8s-playground --config kind-config.yaml
```

Agora o cluster está pronto e você pode usar comandos kubectl para trabalhar no cluster. 

**5. Deletando um cluster:**

```
kind delete cluster --name k8s-playground
```
Akron Income Tax Co - Best Income Tax Preparation Services Akron
Published: 2023-01-20 15:50:59

"Akron Income Tax Co
https://apc1040.com
330-733-1040
An Akron Income Tax Preparation Co. Let us handle your Accounting, Bookkeeping and Income Tax preparation needs. Accurate Reliable and Secure. Income Tax Preparation: Accurate, Reliable and Secure. Let us handle your Accounting, Bookkeeping and Income Tax Preparation needs. Trust us to deliver professional results at reasonable fees. Our flat rate, no frills pricing, means you will always know what you are paying upfront -- No Surprises -- No Hidden Fees.

https://www.youtube.com/watch?v=e3InvLkGFF8
`<iframe width="560" height="315" src="https://www.youtube.com/embed/e3InvLkGFF8" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>`


Whether you are preparing your individual personal income tax returns or if you are a small business, completing the tax return yourself can be a serious burden and put you at risk for missed deductions and tax credits. We offer personal individual tax returns preparation (1040s), corporate tax returns (1120s), partnership returns (1065s) and LLC's income tax preparation."
How You Can Make Your First $1k Freelancing
Tags: beginners, career, productivity, startup
Published: 2023-01-20 15:44:07

You want to make money as a freelancer? At first, making money online can seem like a huge task. But it doesn't have to be. To get started and make your first $1k as a freelancer, follow these five easy steps.

## Determine what type of work you want to do.

You have a lot of options when it comes to deciding what type of work you want to do. What are your interests? What do you like to do? Are there any jobs that sound like they might be fun, or at least interesting?

If you're still not sure, don't worry! There are a lot of resources out there that can help you figure out what type of work is right for you. The first step is just taking some time to think about who you are and what makes you happy, then finding ways to get involved with those things.

## Read blogs and websites that pay your particular niche and be on the lookout for new opportunities.

If you're looking for a way to make extra money, you might be tempted to hop on the first gig that comes your way. But before you do that, take some time to consider your options.

If you're in a niche that pays well, then it's worth your time to do some research and find out what kind of opportunities are out there—and which ones are most likely to pay well.

Read blogs and websites that pay your particular niche and be on the lookout for new opportunities. You could also reach out to people who work at those sites, or even join a forum where others who have worked in similar fields discuss their experiences.

## Take the time to create high quality, unique and interesting content that attracts clients.

Do you want to be the best?

If you want to be the best, you need to do things differently. You need to take the time to create high quality, unique and interesting content that attracts clients.

You can do this by creating a blog and writing articles that speak directly to your audience. You can also use social media platforms such as Facebook and Twitter to reach out directly to your audience.

The more time and effort you put into creating great content, the more likely it is that people will notice what you have created and come back for more!


## Freelancing is a great way to earn money, but it takes work and commitment to succeed.

You must have passion for what you do and be willing to learn if you want to succeed. And you'll need an active social media presence and the ability to network and find new clients, which can be challenging when you're just starting out. All of this is easier said than done, but freelancing opportunities are out there if you want them.


Freelancing is a great, flexible way to earn money on the side, but it takes a lot of hard work, dedication, and smart marketing to make it successful. These tips should help you find success as a freelancer and take your business to new levels. Good luck!
How to know key codes with worth noting?
Published: 2023-01-20 15:36:28

**Key codes worth noting
Letters A-Z: (65-90)

keyboardMap[65];  // A
...
keyboardMap[90];  // Z
Digits 0-9: (48-57)

keyboardMap[48];  // 0
...
keyboardMap[57];  // 9
Number Pad 0-9: (96-105)

keyboardMap[96];   // NUMPAD0
...
keyboardMap[105];  // NUMPAD9
Arrow Keys: (37-40)

keyboardMap[37];  // LEFT
keyboardMap[38];  // UP
keyboardMap[39];  // RIGHT
keyboardMap[40];  // DOWN
Tab Key: (9)

keyboardMap[9];  // TAB
Enter Key: (13)

keyboardMap[13];  // ENTER
Spacebar Key: (32)

keyboardMap[32];  // SPACE
OS Specific Key (91) Windows Key (Windows) or Command Key (Mac)

keyboardMap[91];  // OS_KEY
Alt Key: (18)

keyboardMap[18];  // ALT
Control Key: (17)

keyboardMap[17];  // CONTROL
Shift Key: (16)

keyboardMap[16];  // SHIFT
Caps Lock Key: (20)

keyboardMap[20];  // CAPS_LOCK**
Top packages for React Development
Tags: react, npm
Published: 2023-01-20 15:35:44

Here is my set of favorite libraries when developing with React.


## Building + developing
* [Create react app](https://github.com/facebook/create-react-app) + [Craco](https://github.com/dilanx/craco)
* [Vite](https://github.com/vitejs/vite)
* [Fake-api-middleware](https://github.com/avin/fake-api-middleware)

## Navigation
* [react-router](https://github.com/remix-run/react-router)

## State managment
* [Redux Toolkit](https://github.com/reduxjs/redux-toolkit)
* [Zustand](https://github.com/pmndrs/zustand)

## Common hooks
* [React-use](https://github.com/streamich/react-use)
* [Ahooks](https://github.com/alibaba/hooks)

## Form control
* [React-hook-form](https://github.com/react-hook-form/react-hook-form)
* [Formik](https://github.com/jaredpalmer/formik)

## I18n
* [React-i18next](https://github.com/i18next/react-i18next)

## Components playground
* [React-cosmos](https://github.com/react-cosmos/react-cosmos)
* [Storybook](https://github.com/storybookjs/storybook)

## Animation
* [React-transition-group](https://github.com/reactjs/react-transition-group)
* [React-spring](https://github.com/pmndrs/react-spring)

## Utils
* [Clsx](https://github.com/lukeed/clsx)

## Other useful packages

* [imask](https://github.com/uNmAnNeR/imaskjs)
* [include-media](https://github.com/eduardoboucas/include-media)
* [react-toastify](https://github.com/fkhadra/react-toastify)
How to add code analyzer in React app JSX with ESLint?
Published: 2023-01-20 15:32:13

**React app JSX with ESLint Coding Analysis  Coding Analysis **

Configuration: You can configure ESLint according to your use case. There are two ways two configure ESLint :

Configuration Comments: These are JavaScript comments which are embedded into individual files to configure them
Configuration File: ESLint will use JavaScript/JSON/YAML file which contain information to configure the entire directory.
In this particular config, we will use JSON format i.e. `.eslintrc.json` to have our configurations, or else you can create the `eslintConfig`  property in package.json and write these configurations in that property.

**React app JSX with ESLint **
**1. Installing ESLint**

```
npm install eslint –save-dev 
```
_This installs ESLint for usage in local project_

**2. Installing ESLint for React
**
```
npm install eslint-plugin-react --save-dev
```
Next we need to modify our package.json file according to given code instructions:

```
"extends": [
    "eslint:recommended",
    "plugin:react/recommended"
]

```

**3. Add script to package.json**

```
"scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test --env=jsdom",
    "eject": "react-scripts eject",
    "lint": "eslint src/**/*.js src/**/*.jsx",
    "lint:fix": "eslint \"src/**/*.{js,jsx}\" --fix"
}

```
Then you can run the command 

```
npm run lint
```
Some command name that use for eslint

```
npx eslint App.js --fix
npx eslint ./src --fix
```

Disable

```
"rules": {
      "no-unused-vars": "off"
    }
```
How to convert ASCII code to character using JavaScript ?
Published: 2023-01-20 15:28:09

**How to convert ASCII code to character using JavaScript ?**

For example, the ordinary number key 1 generates an event with keycode 49 while numberpad key 1 (with Numlock on) generates keycode 97. Used with String.fromCharCode we get the following:

**Output:**

```
console.log(String.fromCharCode(65))
console.log(String.fromCharCode(66))
console.log(String.fromCharCode(67))
console.log(String.fromCharCode(89))
console.log(String.fromCharCode(90))
```

![](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zx3e52skjiqcaluqhsls.png)
Introducing Quine to the Dev.To community
Tags: community, news, startup, opensource
Published: 2023-01-20 15:19:48


Hello everyone 👋 I'm Rodrigo, founder of [Quine](https://quine.sh/). I would like to formally introduce ourselves to the [Dev.To](http://Dev.To) community 🤗

Quine is a developer reputation platform that helps you create an **impressive** open source (OSS) portfolio through _good-first-issues_ (i.e. small well-defined GitHub Issues designed to help you get your feet wet with a new project). Finding GitHub issues to work on can be daunting given the sheer amount of repos with open contribution opportunities. Quine helps you overcome this and accelerate your journey in open source by recommending you the most relevant good-first-issues that match your language and topic preferences. Do you want to work on `deep-learning` repos that are written in `Rust`? Just type in the keywords and Quine will point you in the right direction.


![Deep-learning and Rust!](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a9i7uw6oytrea3fqphre.gif)

Open source is set to become the de-facto arena in which developers learn, work, and interact with each other. It is well known how open source can be beneficial for codebases in terms of security, reach, and sustainability. What is not so talked about is how it can also be a goldmine for the personal and professional growth of developers. Quine is the missing OSS platform **optimised** for developers' professional growth.

Would you like to know more? We'll be posting new interesting content every week, so make sure you follow us on [Dev.To](https://dev.to/quine) or [Twitter](https://twitter.com/quine_sh). In the meantime, sign-up [to our platform](https://quine.sh) and start building your PR portfolio. ✌️
## Frontend with Google Sign in + Token
Tags: tutorial
Published: 2023-01-20 15:18:39

Recommended frontend starter: next-auth + prisma
https://github.com/steven-tey/precedent

Get environment variables GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET + API_KEY
https://console.cloud.google.com/apis/credentials

## Google OAuth 2.0 App Sign in

for > **next-auth v4** with Prisma adapter.
```ts
// [...nextauth].ts

import prisma from "@/lib/prisma";
import { PrismaAdapter } from "@next-auth/prisma-adapter";
import NextAuth, { NextAuthOptions } from "next-auth";
import GoogleProvider from "next-auth/providers/google";

export const authOptions: NextAuthOptions = {
  adapter: PrismaAdapter(prisma),
  callbacks: {
    async session({ session, token, user }) {
      const getToken = await prisma.account.findFirst({
        where: {
          userId: user.id,
        },
      });

      let accessToken: string | null = null;
      if (getToken) {
        accessToken = getToken.access_token!;
      }

      session.user.token = accessToken;
      return session;
    },
  },
  providers: [
    GoogleProvider({
      clientId: process.env.GOOGLE_CLIENT_ID as string,
      clientSecret: process.env.GOOGLE_CLIENT_SECRET as string,
    }),
  ],
};

export default NextAuth(authOptions);
```

If you are using typescript. Create a /types directory inside your source folder and add a `next-auth-d.ts` file inside of it.
```ts
// next-auth.d.ts

import NextAuth, { DefaultSession } from "next-auth";

declare module "next-auth" {
  /**
   * Returned by `useSession`, `getSession` and received as a prop on the `SessionProvider` React Context
   */
  interface Session {
    user: {
      /** Oauth access token */
      token?: accessToken;
    } & DefaultSession["user"];
  }
}
```

access the session from clientside:
```ts
import React from "react";
import { useSession, signIn, signOut } from "next-auth/react";

type Props = {};

function ExampleComponent({}: Props) {
  const { data: session } = useSession();

  if (session) {
    return (
      <>
        Access token {session.user.token} <br />
        <button onClick={() => signOut()}>Sign out</button>
      </>
    );
  }
  return (
    <>
      Not signed in <br />
      <button onClick={() => signIn("discord")}>Sign in with Discord</button>
    </>
  );
}

export default ExampleComponent;
```

### Credits and useful links

https://stackoverflow.com/questions/69068495/how-to-get-the-provider-access-token-in-next-auth/74883310#74883310
Les Type Aliases en Kotlin
Published: 2023-01-20 15:13:48

Les typealias en Kotlin sont un moyen de donner un autre nom à un type existant.
Cette fonctionnalité peut être très utile lorsque le nom d’un type est trop long ou difficile à comprendre, ou lorsque vous souhaitez utiliser un nom plus explicite pour un type spécifique.

Lire la suite :
[Les Type Aliases en Kotlin](https://kotlin-java.fr/les-type-aliase-en-kotlin/)
Publish a npm package using next.js and typescript
Tags: typescript, npm, nextjs
Published: 2023-01-20 15:08:33


Code reusability and modular design are what have made React one of the best JavaScript frameworks out there. Also, thanks to NPM, publishing a new JavaScript module has never been easier. All you need to do is point the main JavaScript file in your **`package.json`**
 and run **`npm publish`**

let create our own package

### Plan

- initialize next project
- compile the project
- config package.json for deployement

### Let go

- create a next project
```bash
npx create-next-app myapp -typescript

```

After creating our app, we need to add some features.
When we finish adding all features to our app, we need to publish it to NPM. We need a file named `.npmignore` it is similar to `.gitignore`, it is just to ignore some files and folder when we'll publish our package.

- add a `.npmignore` file

```jsx
# https://docs.npmjs.com/misc/developers#keeping-files-out-of-your-package

#tests
test
coverage

#build tools
.travis.yml
.jenkins.yml
.codeclimate.yml

#linters
.jscsrc
.jshintrc
.eslintrc*

#editor settings
.idea
.editorconfig
```

- connect or create a NPM account

add this to `package.json`

```jsx

{
	"files": [
		"/lib"
	]
}
```

make shure this line your package is not private inside package.json **`"private": false,`**

- connect your project to npm

```jsx
npm login
```

- after  logged in pusblish to npm

```jsx
npm publish
```

now your package is installed
How to prevent multiple times react-hot-toast easily
Published: 2023-01-20 15:05:55

**How to prevent multiple times react-hot-toast easily**
You can achieve by using useToasterStore() & useEffect(). 

Restrict the maximum number of Toasts to show in React Toast component. You can restrict the maximum toast count by event callback function.

1. You need to import useToasterStore hook from react-hot-toast

Copy/paste the given snippet into your code.

```
const { toasts } = useToasterStore();

const TOAST_LIMIT = 1

useEffect(() => {
  toasts
    .filter((t) => t.visible) // Only consider visible toasts
    .filter((_, i) => i >= TOAST_LIMIT) // Is toast index over limit?
    .forEach((t) => toast.dismiss(t.id)); // Dismiss – Use toast.remove(t.id) for no exit animation
}, [toasts]);

```

Output

![](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/08fm4jgrxxrdw1rypaph.png)

It will show only one times. If you want to show multiple time you can put the number in that variable: ` const TOAST_LIMIT = 1`
Why SQL?
Tags: programming, tutorial, opensource, database
Published: 2023-01-20 15:04:21

**SQL** is a tool for organizing, managing and retrieving data stored by a computer database. The name "SQL" stands for Structured Query Language. As the name implies, SQL is a computer language that you use to interact with a database. SQL works with one specific type of database called a relational database.
for more read click here [(https://tutorialsprog.com/sql-tutorial)]
A realidade do sênior de 2 anos
Tags: programming, productivity, beginners, javascript
Published: 2023-01-20 14:44:49

A ideia de se tornar um desenvolvedor senior rapidamente pode ser tentadora, especialmente com a quantidade de cursos e bootcamps disponíveis na internet prometendo isso. No entanto, a realidade é que se tornar um desenvolvedor senior é um processo que requer tempo, dedicação e esforço contínuos.

É verdade que algumas pessoas conseguem se destacar em poucos meses depois de aprender uma tecnologia específica em um bootcamp Javascript. No entanto, essas pessoas geralmente possuem um conhecimento prévio e experiência em programação, ou têm uma capacidade natural para aprender e se adaptar rapidamente.

Muitas vezes, as pessoas que pulam de tecnologia em tecnologia, fazendo curso atrás de curso sem chegar a lugar algum, acabam se frustrando e desistindo. Isso ocorre porque esses cursos geralmente só fornecem uma visão superficial da tecnologia e não ensinam como construir aplicações robustas, flexíveis e escaláveis.

Para se tornar um desenvolvedor senior, é importante dominar uma stack de tecnologias específica e aplicar conceitos avançados na construção de aplicações complexas. Isso inclui a implementação de regras de negócios, arquitetura de software, testes automatizados e boas práticas de desenvolvimento.

Ao invés de empilhar cursos e mais cursos, é melhor se concentrar em dominar uma única stack de tecnologias e aprimorar continuamente suas habilidades. O bootcamp CrazyStack é uma excelente opção para aqueles que desejam construir aplicações robustas, flexíveis e escaláveis usando Javascript, Node.js, MongoDB e Fastify.
E não esqueça de usar o cupom JANEIRODOIDO para obter um desconto de 55% até 31 de janeiro.