teleren/devto huggingface dataset:
What Should make Programmers Happy
Published: 2021-09-13 15:12:59

At some point, you need to be happy. Remember this is life, there is more than coding in life. You need to enjoy life. As long as you might brag about being an extrovert, with the current Covid-19 situation, programmers stay indoors.

Working from home

This has changed. The pandemic has had a positive impact on us, let’s make some noise. Almost all the jobs are remote. We have GitHub where we submit our daily projects. Be happy about this.

Completing a running a project.

As a programmer, there is a time when you may experience bugs in your project. Trust me, the time spent writing codes is much less than the time you might spend debugging. But if you practice good coding behavior, then it will be easier to debug. There is nothing good as a project that is running smoothly.

Meeting deadlines

It’s okay to experience delays. The matter comes down to debugging. But if you have strict deadlines, remember to negotiate with your employer. They must understand that at the moment we face challenges and coding is not a walk in the park. If you meet deadlines as agreed, remember you are supporting the organization, You will have a positive impact on the organization. Smile a bit because it means you’re going to be free for some time.

Earning a high salary

Yes, remember the time you struggled learning languages. It’s okay, everyone passes through that moment. The reward is always good. Getting your first job is essential. Then at the end of two weeks or months, earn your salary, that feeling is awesome. Have high hopes, apply for jobs even if you are working, let them pay you the money that equals your skills. Be on a job where you become happy when the salary booms in.
How To Install Certbot on CentOS 8
Tags: ssl, certbot, letsencrypt, centos
Published: 2021-09-13 15:06:53

- First, install snapd on CentOS 8
```
sudo dnf install epel-release
sudo dnf upgrade
sudo yum install snapd
sudo systemctl enable --now snapd.socket
sudo ln -s /var/lib/snapd/snap /snap
```
- Installing Certbot:
```
sudo snap install --classic certbot
sudo ln -s /snap/bin/certbot /usr/bin/certbot
```
- To run Certbot:
- 
```
sudo certbot certonly --standalone
```

- Then follow the instructions to create a certificate for your domain name
Agregar liquidez desde un Smart Contract
Published: 2021-09-13 14:51:28

---
title: Agregar liquidez desde un Smart Contract
published: true
description: #blockchain #DeFi #solidity #layer2
tags: 
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ei6ta83r2kz8kku93nok.png
---

La liquidez es el punto de entrada de nuestro token ERC-20 o ERC-777 con el resto del ecosistema DeFi. En este video agregamos liquidez desde un smart contract que funciona de la misma manera que la interfaz gráfica pero nos abre la puerta a una infinidad de posibilidades de automatización, decentralización y transparencia.

{%youtube YBgIu4nOmOk%}

## 1. Lanzamos el contrato

Nota que debes seleccionar el address del contrato Router dependiendo de dónde deseas lanzar el contrato:

* Polygon Quickswap: `0xa5E0829CaCEd8fFDD4De3c43696c57F7D7A678ff`
* Ethereum Uniswap V2: `0x10ED43C718714eb63d5aA57B78B54704E256024E`
* BSC Mainnet Pancake: `0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D`
* BSC Testnet Pancake: `0xD99D1c33F9fC3444f8101754aBC46c52416550D1`

En este ejemplo usamos los addresses `0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063` y `0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174` para DAI y USDC respectivamente. Modifícalos con los tokens que desees.

```solidity
// SPDX-License-Identifier: MIT
pragma solidity 0.8.7;

import '@openzeppelin/contracts/token/ERC20/ERC20.sol';

contract Router {
  function addLiquidity(
   address tokenA,
   address tokenB,
   uint amountADesired,
   uint amountBDesired,
   uint amountAMin,
   uint amountBMin,
   address to,
   uint deadline
  ) external returns(uint amountA, uint amountB, uint liquidity) {}
}

contract Liquidifier
{
  Router router = Router(0xa5E0829CaCEd8fFDD4De3c43696c57F7D7A678ff);
  ERC20 DAI_token  = ERC20(0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063);
  ERC20 USDC_token = ERC20(0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174);

  function addLiquidityDAIAndUSDC(uint amount_DAI, uint amount_USDC) public
  {
    IERC20(DAI_token).transferFrom(msg.sender, address(this), amount_DAI);
    IERC20(USDC_token).transferFrom(msg.sender, address(this), amount_USDC);
    
    IERC20(DAI_token).approve(address(router), amount_DAI);
    IERC20(USDC_token).approve(address(router), amount_USDC);
    
    router.addLiquidity(
       address(DAI_token),
       address(USDC_token),
       amount_DAI,
       amount_USDC,
       0,
       0,
       msg.sender,
       block.timestamp
    );
  }
}
```

## 2. Aprobar y probar

Una vez lanzado el contrato nos dirigimos al explorador de ambos tokens, en este [DAI](https://polygonscan.com/address/0x8f3cf7ad23cd3cadbd9735aff958023239c6a063#writeProxyContract) y [USDC](https://polygonscan.com/address/0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174#writeProxyContract). Y utilizamos la función `approve` pasando el address del contrato que recién lanzamos y un número grande de tokens.

[Documentación oficial](https://docs.uniswap.org/protocol/V2/reference/smart-contracts/router-02#addliquidity)

**Gracias por ver este tutorial!**

Sígueme en dev.to y en [Youtube](https://www.youtube.com/channel/UCNRB4tgwp09z4391JRjEsRA) para todo lo relacionado al desarrollo en Blockchain en Español.
Laços de Repetição: Exemplos com for (Parte 4)
Tags: javsacript, for, loops
Published: 2021-09-13 14:30:46

Vou apresentar alguns exemplos com `for`. Eu sei, existem também o `for in` e o `for of` (pode-se dizer que são derivados de `for`), mas como são laços um pouco mais avançados, vou deixar para outra ocasião.

## Exemplo 1

### Soma dos valores

Vou usar o laço for aqui para somar valores digitados pelo usuário. Começo com uma variável para a soma dos números, cujo valor inicial é 0.

```javascript
let soma = 0;
```

Agora vem a parte com o `for`. Como as condições aparecem de antemão, vou incluir uma variável dentro do laço que vai conter os números que o usuário vai digitar.

```javascript
for(let i = 0; i < 5; i++) {
	let num = Number(prompt(`Digite o ${i + 1}º valor`));
}
```

Debaixo dessa variável vou fazer a soma dos valores para mostrá-los na tela.

```javascript
soma += num;
```

O laço completo fica assim:

```javascript
for(let i = 0; i < 5; i++) {
	let num = Number(prompt(`Digite o ${i + 1}º valor`));
    soma += num;
}

console.log(`Soma dos valores: ${soma}`);
```

## Exemplo 2

### Quantos valores estão entre 0 e 10? Mostre também a soma entre os números ímpares digitados

Aqui é o seguinte: posso digitar qualquer valor, porém a lógica é que o programa considere apenas os números digitados pelo usuário (e a soma dos números ímpares) que estão entre 0 e 10. Vou criar duas variáveis para o total de valores entre 0 e 10 e a soma total de números ímpares.

```javascript
let totalValoresEntreZeroEDez = 0;
let somaValoresImpares = 0;
```

Dentro do laço, vou colocar uma variável para os números digitados. Aqui entra a seguinte condição: vou considerar apenas os valores que estão entre 0 e 10. Dentro dessa condição, vou somar apenas os números ímpares.

```javascript
if(num >= 0 && num <= 10) {
  	totalValoresEntreZeroEDez++;
    if(num % 2 === 1) {
    	somaImpares += num;
  }
}
```

A lógica completa fica desse modo

```javascript
for(let i = 0; i < 10; i++) {
	let num = Number(prompt(`Digite o ${i + 1}º valor`));
  if(num >= 0 && num <= 10) {
  	totalValoresEntreZeroEDez++;
    if(num % 2 === 1) {
    	somaImpares += num;
    }
  }
}

console.log(`Total de valores entre 0 e 10: ${totalValoresEntreZeroEDez}`);
console.log(`Soma dos números ímpares: ${somaImpares}`);
```

E aí? Gostaram? Até a próxima anotação! 😊
Run Containers on AWS Lightsail
Tags: devops, beginners, aws, docker
Published: 2021-09-13 14:22:08

---
series: Containers on AWS
---
AWS Lightsail is an easy-to-use service that offers all the features needed to host web applications of any scale. Besides VPS services, the AWS Lightsail also lets you deploy your containers.

From the AWS console, navigate to 'Lightsail'
![AWS Lightsail](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tvgcp2wz1u6uz4rt1sjm.png)


From the Lightsail homepage, switch to the 'Containers' tab and then click 'Create container service'
![Containers on AWS Lightsail](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4hqc0gx9ch50iw9hz51u.png)

Select the region where you want to deploy your containerized application
![Zone/Region in AWS Lightsail](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hkbbrvjf7pm011ph82cm.png)

Select size and number of instances based on your usage
![Fixed pricing container deployment in AWS Lightsail](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ow9kmfgl7xvmya77s8u6.png)

Click 'Set up deployment'
![AWS Lightsail Deployments](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x2v2t99ntwionxlhk2cq.png)

- Choose 'Specify a custom deployment'
- Enter any meaningful name as Container name
- Enter your public image name with tag, example: `nginx:latest` (at the time of writing AWS Lightsail doesn't support private images for container deployment)
- Click 'Add open ports' and add ports on which your application listens to
- In the `PUBLIC ENDPOINT`, select the container name which is open to public
![AWS Lightsail Container Deployment](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dxb6fz20swiltyr7jl7q.png)

Give a name to your service and click 'Create container service'
![Create container service](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9ptgi5hd42g376dmkndc.png)

Once the deployment is finished successfully, it will change the status to active
![Deploy services in AWS Lightsail](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8j5ocmwt0u7xjvmc1g6k.png)

To access your service/containerized application, use the link given as a public domain
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9vofy3sno34jasrbazgd.png)

---
Let's connect: 

Linkedin: [https://www.linkedin.com/in/mubbashir10/](https://www.linkedin.com/in/mubbashir10/) 

Twitter: [https://twitter.com/mubbashir100](https://twitter.com/mubbashir100)
My B.Tech Final Year Trip (2021)
Tags: vizag, anrkcseb2018to2022, sept2021, trip
Published: 2021-09-13 14:11:39

Hello everyone, First of all a very big thank you for being here to read my second blog 😅

I recently started blogging and this came into my mind to make a blog on our recent trip.

## Crime Partners( I mean people in the trip 😄)
* Saicharan(Myself)
* Saikumar
* Naresh.K
* Naresh
* Saishiva
* Saivivek
* Saipraveen
* Rahul (The rider - coz he is the person who driven the car throughout the journey 🦾)

## Location

### From

kodad,Telangana

### To

Vizag,Andrapradesh

## Places we covered during the trip

* Vijayawada durga matha temple
* Annavaram
* Vizag city
* Rk beach
* Kailasagiri
* Rushikonda beach
* Chaparai waterfalls
* Araku
and many more..

## The story

This is my B.tech final year trip. We are students from Anurag Engineering College, Kodad, Telangana. Currently in final year CSE (2018-2022 batch).

It was an suddenly planned trip and we have some places in our minds at last we decided to explore Vizag. We then selected ertiga (7 seater car) and started our journey with all our joy on 02-09-2021.

The total journey was about 1500kms (up and down) and this was the memorial trip for all of us, we enjoyed a lot during the trip.

On day-1(02-09-2021) we started our journey from Kodad at 12 pm and then we covered Vijayawada durga matha temple and we reached vizag by late night and we stayed there at vizag city.

On day-2(03-09-2021) we covered vizag city, Rk beach, Kailasgiri, Rushikonda beach and at evening we started our journey to explore araku and by late night we reached araku and had a sleep there.

On day-3(04-09-2021) we explored the beauties of araku, chaparai waterfalls and by evening we started our journey towards annavaram, we reached annavaram from araku by late night and had our stay there at annavaram on day-3.

On day-4(05-09-2021) we explored annavaram and returned back to home and by late night we successfully reached to our homes.
Edit any GitHub repository on the web without installing anything😱
Tags: github, vscode, git, webdev
Published: 2021-09-13 14:10:38

---
canonical_url: https://blog.avneesh.tech/edit-any-github-repository-on-the-web-without-installing-anything
---

Hey there 🙋🏻‍♂️👋🏻,

Github released a new feature recently. If you go to any GitHub repository and click on the `.` on your keyboard, you will be able to see a web version of Visual Studio Code with the files of that repository. Now you can even edit the repository without installing anything!

![How cool is that](https://media3.giphy.com/media/JSjjhv0tuiTGW6peHb/giphy.gif)

You can also install extensions and themes in the web version but make sure that you are signed in to your GitHub account.

### Seeing it in action
https://www.loom.com/share/eaa4090560684d97a423f5ef1a1e962a

### Useful links

[GitHub dev](https://github.com/features/codespaces)

[Visual Studio Code's video on `the dot`](https://youtu.be/ywUZOOzLX3c)

[Connect with me](https://avneesh-links.vercel.app)
How to make a killer robot's eyes convincingly evil w/ flutter
Tags: podcast, jokes, devops, flutter
Published: 2021-09-13 13:52:02

Nothing says "Ugh, how do I put off starting my week as a developer" like a new episode of COUNCIL OF THE WISE DEVELOPERS!

@scottstoll2017 has some great insight on how to architect a killer robot's software!

{% spotify spotify:episode:54cHEmAhhCJHXWtGz2nw9c %}
Write a program to print the absolute value of the number.
Tags: python, programming, number
Published: 2021-09-13 13:49:35

##Absolute number is: 
       number --> if number is positive.
       0 number --> if number is Zero.
       -number --> is number is negative.

## Expiation of the code:
1.You have take a integer number as user-input.
2.Check the following condition:
         - number is greater than zero.
         - number is equal to zero.
         - number is smaller than zero.
3.Run the code and enjoy it...
non-string keys in object literal syntax JS
Published: 2021-09-13 13:24:03

```ts
 
type KeyStore <T> =  {
    asKey: (value: T) => symbol;
    fromKey: (key: symbol) => [] | [T];
}

const mkKeyStore = <T>():KeyStore<T> => {
  const map = new Map<symbol,T>();
  const asKey = (value: T) : symbol =>  {
    const key = Symbol()
    map.set(key, value);
    return key
  }
  
  const fromKey = (key: symbol): [] | [T] => {
    if (map.has(key)) { 
      return [map.get(key)!]
    }
    return []
  }
  return {asKey, fromKey}
}


const mapMakerMaker = <K>(s:KeyStore<K>) => <T>(record:Record<Extract<K,string | number | symbol> | symbol, T>): Map<K,T> => {
  const stringEntires:[string, T][] = Object.entries<T>(record)
  const entires1 = stringEntires as any as [K,T][]

  const symbols = Object.getOwnPropertySymbols(record);
  const entries2 = symbols.flatMap(key => s.fromKey(key).map((v):[K,T] => [v, record[key]] ))
  const map = new Map<K,T>([
    ...entires1,
    ...entries2
  ])
  return map
}

const keyStore = mkKeyStore<string | ["required",string]>()
const required = (key:string) => keyStore.asKey(["required", key])
const mkMap = mapMakerMaker(keyStore);

const x = mkMap({
 [required("asd")]: "string",
 basd: "int"
})

console.log(x)
// Map (2) {"basd" => "int", ["required", "asd"] => "string"} 
```
What is NEXT.JS?
Published: 2021-09-13 13:21:13

👉 What is NEXT.JS?👨‍💻

✅ NEXT.JS is a React Framework that enables you to build
super fast & extremely user-friendly static websites.📲

✅ NEXT.JS is an open-source development framework built on top of Node.js enabling React based web applications functionalities such as server-side rendering and generating static websites📲

👉 Why Should I Use NEXT.JS??👨‍💻

✅ Next. js is an open-source development framework built on top of Node. js enabling React based web applications functionalities such as server-side rendering and generating static websites.📲

👉 Is NEXT.JS Have Any New Features Other Than ReactJS?👨‍💻

✅ Yes NextJS Has So Many New Features 🌐

✅ It Has Automatic Static Optimization 🌐

✅ Now your "Static" & "dynamic " content are one now 🌐

✅ The Features Allows Nextjs to build hybrid applications that contains both server-rendered & statically & statically generated pages 🌐

✅ It uses Server Side Rendering (SSR) & at the same time it can be also a great Static Site Generator (SSG) 🌐

👉 Why Should I Go With NEXT.JS??👨‍💻

✅ The Big reason to choose NEXT.JS is its SEO efficiency 🌐

👉 Is next JS full stack?👨‍💻

✅NEXT.JS is a complete full-stack framework built on top of React. js.🌐

For More #techblogs
✅ Follow @devkshitij7  

#nextjs #reactjsdevelopment #kshitijblogs #kshitijspeaks
How to inject JS from a source dynamically
Tags: javascript
Published: 2021-09-13 13:15:27

```
/**
 * Inject a script tag with a src so that you can add JS dynamically
 * @param src
 * @returns { Promise }
 */
export function injectScript(src) {
    return new Promise((resolve, reject) => {
        const script = document.createElement('script');
        script.src = src;
        script.addEventListener('load', resolve);
        script.addEventListener('error', e => reject(e.error));
        document.head.appendChild(script);
    });
}
```

Then e.g: 
`await injectScript('your src string goes here)`
`Other code goes here`

This allows you to capture errors etc
Important thing to remember about recovering panic'ed code in Go
Tags: go
Published: 2021-09-13 13:12:29

---
title: Important thing to remember about recovering panic'ed code in Go
published: true
description: I feel stupid to have not known this... so I need to record it (mostly for myself XD)
tags: golang, go
//cover_image: https://direct_url_to_image.jpg
---

When recovering from panic in golang, I have often found myself troubled by potentially not knowing where the error originated...

This was because the stack doesn't get passed along with the message when you recover... or so I thought.

Go's runtime actually handles recovery from panic in an interesting way.  Stack trace wise, it allows deferred functions the ability to call `debug.Stack()` as if from the location of the panic.

for example:

```golang
package main

import (
	"log"
	"runtime/debug"
)

func main() {
	defer func() {
		if e := recover(); e != nil {
			log.Printf("%s: %s", e, debug.Stack())
		}
	}()

	f1()
}

func f1() {
	f2()
}

func f2() {
	f3()
}

func f3() {
	panic("some error")
}
```

the stack trace output from the above code produces the following.

```
2021/09/13 22:00:07 some error: goroutine 1 [running]:
runtime/debug.Stack(0xc00009bdb8, 0x4acd60, 0x4e5168)
        /home/rustysysdev/go/src/runtime/debug/stack.go:24 +0x9f
main.main.func1()
        /home/rustysysdev/Documents/panic-test/cmd/panic/main.go:11 +0x5b
panic(0x4acd60, 0x4e5168)
        /home/rustysysdev/go/src/runtime/panic.go:965 +0x1b9
main.f3(...)
        /home/rustysysdev/Documents/panic-test/cmd/panic/main.go:27
main.f2(...)
        /home/rustysysdev/Documents/panic-test/cmd/panic/main.go:23
main.f1(...)
        /home/rustysysdev/Documents/panic-test/cmd/panic/main.go:19
main.main()
        /home/rustysysdev/Documents/panic-test/cmd/panic/main.go:15 +0x5e
```

this is very useful for troubleshooting and I feel stupid only figuring this out now. XD

source: https://groups.google.com/g/golang-nuts/c/MB8GyW5j2UY
Are emotions impacting your Team progress?
Tags: agile, teamwork, softwaredevelopment
Published: 2021-09-13 12:41:44

---
title: Are emotions impacting your Team progress?
published: true
date: 2021-09-13 12:40:30 UTC
tags: agile,teamwork,softwaredevelopment
canonical_url: https://medium.com/chingu/are-emotions-impacting-your-team-progress-56077f413eea
---

Sprint 3 — Monday

![](https://cdn-images-1.medium.com/max/1024/1*MCI_30GVirCkiuBsJyJmvA.jpeg)<figcaption>Photo by <a href="https://unsplash.com/@tengyart?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Tengyart</a> on <a href="https://unsplash.com/s/photos/emotions?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption>

All project teams pass through predictable emotional stages!

When starting out your excitement will take you to the _peak of inflated_ _expectations_, from where you’ll drop into the _trough of despair_ where you begin to realize the amount of work that must be performed and the complexity of your workload sets in.

> **Don’t be discouraged!**

![](https://cdn-images-1.medium.com/max/500/1*WA49n8kMHhxYgW7IkySeFQ.png)

1. **All** project teams go through this same stages
2. This is where **the team should come together** around challenges to support one another.
3. **Break problems down into small actionable tasks** , prioritize them, and work on them one at a time.
4. **Communicate honestly and frequently** with your team. Problems can be made worse by misunderstandings and incorrect assumptions between team members.

This is where your teams Agile process will help to ensure that you focus on the right tasks. Watch out for over analyzing issues you encounter. It’s more important to deliver a working MVP than a perfect design.

> It’s okay to make mistakes as long as you learn from them! Fail Forward!

### Before you Go!

Chingu helps you to get out of “_Tutorial Purgatory_” by transforming what you’ve learned into experience. The experience to boost your Developer career and help you get jobs.

You can learn more about **Chingu** & how to join us at [https://chingu.io](https://chingu.io/)

* * *
New version of Scrawl-canvas - v8.6.1 - released today.
Tags: javascript, html, a11y, canvas
Published: 2021-09-13 12:25:18


Scrawl-canvas is a Javascript library for creating responsive, interactive and accessible HTML5 canvas infographics and animation for modern websites. https://scrawl-v8.rikweb.org.uk/

Scrawl-canvas: art video creator
{% youtube 0nrXHj5zy6E %}

Scrawl-canvas: ribbon kaleidoscope
{% youtube UJeZsTLpRZw %}

Scrawl-canvas: colorize a live video feed
{% youtube Qglt-rOvdjU %}