teleren/devto huggingface dataset:
Detalhes sobre desenvolvimento de software
Tags: programming, productivity, architecture
Published: 2021-10-15 17:42:03

Vou tentar abordar uma série de tópicos recorrentes na vida de pessoas desenvolvedoras seniors, e que todos podem aplicar no dia a dia indepentemente do cargo/senioridade que possuem. A maioria dos tópicos tratam de sistemas web, mas é fácil fazer um paralelo e aplicar para outras realidades, como software embarcado, dispositivos móveis, software legado, etc.

Cada tópico será um post separado para facilitar a leitura. Os tópicos são indepentendes entre si, mas a leitura de todos é recomendada.

1. [O básico (ou nem tão básico assim)](/pedrokiefer/o-basico-ou-nem-tao-basico-assim-3aln)
2. [Arquitetura escalável](/pedrokiefer/arquitetura-escalavel-335g)
3. [Cachear ou não cachear, eis a questão](/pedrokiefer/cachear-ou-nao-cachear-eis-a-questao-2084)
4. [Métricas - the good, the bad, and the ugly](/pedrokiefer/metricas-the-good-the-bad-and-the-ugly-4b7e)
5. [Logging, o quê, quando e como?](/pedrokiefer/logging-o-que-quando-e-como-13lh)
6. [Deploy, release the kraken!](/pedrokiefer/deploy-release-the-kraken-1ae9)
7. [Debugging; Deu ruim, e agora?](/pedrokiefer/debugging-deu-ruim-e-agora-2lhf)
8. [Segurança](/pedrokiefer/seguranca-4no8)

Gostaria de agradecer à todas as pessoas que me incentivaram a escrever e contribuiram com ideias, discussões, feedbacks e revisão do texto: Diego Pereira, Elen Araújo, João Vortmann, John Kliff, Luísa Kiefer, Luiza Hagemann, Rafael Inocêncio, Rodolpho Escobar, Rodrigo Kassick, Wilson Júnior, Yago Nobre.
EKS Security Best Practices
Tags: aws, kubernetes, security, devops
Published: 2021-10-15 17:22:41

In this blog we are going to see the security best practices for EKS cluster related to IRSA roles and service account tokens. 

#### Restrict IRSA Trust policy to Service Account Name Scope and Don't use *. 

Sample Trust policy for the IRSA role. 
 
`{
	"Version": "2012-10-17",
	"Statement": [{
		"Effect": "Allow",
		"Principal": {
			"Federated": "arn:aws:iam::CI_ACCOUNT_ID:oidc-provider/OIDC_PROVIDER"
		},
		"Action": "sts:AssumeRoleWithWebIdentity",
		"Condition": {
			"StringEquals": {
				"<OIDC_PROVIDER>:sub": "system:serviceaccount:<namespace>:<serviceaccount>"
			}
		}
	}]
}`

Assume a demo namespace has two IRSA roles create with trust policy <system:serviceaccount:demo:*>

IAM Role 1 - ServiceAccount01 - access to S3 
IAM Role 2 - ServiceAccount02 - access to S3 and DynamoDB

Pod1 with ServiceAccount01 can access Role 2 just by exporting the `AWS_ROLE_ARN = <ARN OF IAM ROLE 2>` so that it will get access to S3 and DynamoDB .

#### Enable IRSA role for aws-node daemonset. 

EKS supports IRSA roles for the aws-node daemonset, it is security best practice to use IRSA role instead of system node role. 

#### Disable auto-mounting of service account tokens

Update the pod spec with `automountServiceAccountToken=false` attribute if there is no need for the application to access EKS Control plane API.
My experience with the Github Community
Published: 2021-10-15 17:17:57

## Introduction
Hey, I'm a 1st-year Computer Science student and I know the absolute basics of Python, C++, C, and Java. I have also begun to learn git. I was introduced to Github through a YouTube recommended video. After watching the video I was intrigued and so I started to slowly expose myself to the Open Source World. As mentioned, as I know the bare basics of a few programming languages, the number of Repositories that I can contribute to is greatly reduced but I try to help repositories with Documentation till I reach a good level with my knowledge of programming languages.

## Experience
Being a newbie to the Github community, I was absolutely lost, I had no idea what Repositories, Pull Requests, Issues, Forks, etc were. Since many companies use Github for many of their projects, there are formal rules, signing of documents and many strict guidelines to be followed when contributing to their Repositories and since I haven't been exposed to such scenarios before, you can believe there were a lot of mistakes on my behalf...and this is where the Owners of the repositories come in. I have been very fortunate to have contributed to repositories with the most patient, understanding, and amazing people ever, who have helped me with my mistakes irrespective of how many I made and I absolutely appreciate them.

## Conclusion
My experience to date with the Github Community has been absolutely amazing and I hope it stays this way. I also believe the better you treat the contributors for your repository, the more that join and the bigger the community. This has been my experience so far, how has yours been?
How to make Rainbow Text in CSS
Tags: css, beginners, github, html
Published: 2021-10-15 17:10:45

# Intro

Hey everyone! Today I was bored after I woke up and I had an idea for a CSS text design.

***
# Description

It's text with Rainbow Fade. Yea that's it.

***
# Outro

Thanks for reading! Here are some links.

Repl Profile: [dudeactualdev](https://replit.com/@dudeactualdev)

Github Profile: [dudeactual](https://github.com/dudeactual)

Github Repository: [CSSRainbow-Text](https://github.com/dudeactual/CSSRainbow-Text)

#### DEMO: [Demo](https://css-rainbow-text.dudeactualdev.repl.co/)
ShowDev: I made an Random Words API with Pronunciation
Tags: showdev, node, express
Published: 2021-10-15 17:03:34

Hi All, 

I created a simple API which returns Random English Word along with the Definition and Pronunciation.

Pronunciation is generated on the fly with NLP.

Stack used

- NodeJs
- Express

Demo: https://random-words-api.vercel.app/word

RapidAPI: https://rapidapi.com/mcnaveen/api/random-words-with-pronunciation/

{% github mcnaveen/Random-Words-API %}

If you found it useful. Please give a star.

Thank you.
Refactoring The Great Site Generator
Tags: opensource, cpp
Published: 2021-10-15 16:40:42

This week, I focused on refactoring this project using <code>git rebase</code> to rewrite history on a branch for my first time. I also learned how to use <code> git commit --amend</code> to change the information in my commit. 

I wanted to reduce redundancy in my code so [I created a function](https://github.com/drew5494/the-great-site-generator/commit/87ff668cb13ebb6c40451035daadc957de4cf210) called <code>readFolder()</code> for reading folders. I also combined <code>readMarkdownFile()</code> into <code>readFile()</code>. This supports both file types of either .txt or .md. 

Lastly, I separated these functions into a new class called [Reading](https://github.com/drew5494/the-great-site-generator/blob/main/thegreatsitegenerator/reading.h). I then placed the class into its own <code>reading.h</code> file. I broke it a few times during this process, usually just forgetting a brace somewhere. 

Using the interactive vim to edit commits was new to me. Ive used command line editors before but not very much. At first, I made a few mistakes by accidentally adding too many spaces between the commit ID and action. I received a few errors but figured it out eventually!

Changing git history was interesting and a useful thing to learn when cleaning up code and changing commits. It was confusing to do at first but I will keep practicing. I hope to use it again in the future!
We measured maintainer response time in Issues and PRs for 90k GitHub repos
Tags: opensource, hacktoberfest, github
Published: 2021-10-15 16:33:56

Writing an open-source contribution is difficult and time-consuming, but so is reviewing it and maintaining it. For this reason, contributing to open source is a two-sided investment decision. On the one hand, contributors invest their time and energy writing high-quality code and understanding how their submission fits in the storyline of the repo. On the other hand, maintainers allocate time and attention to review the PR and tacitly make a long-term commitment to look after the wellbeing of the contribution. When a PR is finally merged, the time and effort that was put into writing and reviewing it converts into exponential value for the authors, the reviewers, and the ecosystem!

Unfortunately, contributor stories does not always end in happy merges. The open source ecosystem is flooded with abandoned open issues and neglected pull-requests, which speaks about fundamental mismatches between repo's communities and aspiring contributors. We at Quine think this is mainly a data problem.

*Would you invest time opening an issue if you knew the repo is abandoned?* *Is your community more unresponsive that the "other" competing repo?* 

To address these information asymmetries we built ***repo detail page***, a statistical dashboard that helps contributors and maintainers understand the health of a repository at the community level. To start with, we created a **response time graph** that measures the (median) time it takes maintainers to respond to issues, and the time it takes for pull requests to be merged after being initially submitted. Your time is valuable, but so is the time of maintainers. Understanding the activity and responsiveness of the community you aspire to join can help you make an informed decision on where to invest your time and energy. For maintainers, the response time graph can help understand the internal dynamics of their community and provide a better contributor experience 🙂

Response time graphs are already available for the 90,000 most popular open source repositories on Github. To access them, signup [here](https://quine.sh)! 

Quine's just getting started ✨ Follow us [on Twitter](https://twitter.com/quine_sh) or join [our Discord server](https://discord.com/invite/ChAuP3SC5H) if you want to be in the loop!
Js Fundamentals: Array.prototype.pop(), push(), shift(), and unshift()
Published: 2021-10-15 16:24:00

1.push(), adds one or more elements to the end of an array and return the new length;
example:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wo5da171tc00qd6vebmw.JPG)

2.pop(), removes an element from the end of an array and returns that item;
example:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6smnof84hy1jxaitm3r2.JPG)

3.unshift(), add one or more elements to the beginning of an array and returns the new length;
example:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6yc1x5ahhn2hth4t45j8.JPG)
add more elements:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z5c9y6swa0e5ewkpxrh7.JPG)

4.shift(), removes an element from the beginning of an array and returns that element.
example:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qp6ozo8iyxndox4o31f5.JPG)
LGPD - Dados Pessoais
Tags: datascience, lgpd
Published: 2021-10-15 16:20:34

Inspirada na General Data Protection Regulation (GDPR), da União Europeia, a Lei Geral de Proteção de Dados (lei 13.709/18 – LGPD), traz uma série de inovações em relação à proteção do direito à privacidade e de dados pessoais como direitos individuais, além de garantir maior segurança jurídica para as empresas, atualizando conceitos antes esparsos em diversas normas setoriais.

A legislação brasileira não adotou o termo “privacidade”, mas “vida privada” e “intimidade”, sem conceituá-los de forma específica. Ela determina a forma como os dados dos cidadãos podem ser tratados, e ainda prevê punições para transgressões a essas determinações.

Os dados pessoais, podem ser separados em três tipos:

* Informações relativas a uma pessoa física identificada: nome, apelido, data de nascimento, endereço IP, imagens relativas a sistemas de monitoramento eletrônico e gravação de chamadas telefônicas;
* Dados pessoais sensíveis, ligados a questões mais subjetivas e comportamentais: raça, opinião pública e vida sexual;
* Dados anonimizados, dados pessoais que tenham sido descaracterizados ou codificados.

Em cada um destes grupos, existe sanções específicas e com dosimetria diferente. Penas mais brandas para informações de pessoa física identifica e penas mais pesadas para dados pessoais sensíveis.

Vivemos em uma sociedade na qual a informação se tornou o centro gravitacional da nova forma de organização social e econômica. A circulação de dados não só altera as relações sociais, redefinindo as noções de tempo e espaço, mas tem valor comercial.

A atual ordem econômica utiliza informações, que são dados sobre experiências humanas, como matéria prima para fins comerciais, segmentando campanhas para perfis específicos de consumidores e criando produtos cada vez mais personificados, que acabam guiando as escolhas dos usuários. Para que essa lógica de acumulação funcione, é preciso que cada vez mais dados sejam coletados.

Neste cenário, o titular dos dados assume posição de vulnerabilidade, pois sua capacidade de autodeterminação é cada vez mais calibrada pelas informações que são coletadas a seu respeito, tais como acesso a determinado programa de linha de crédito e diversas outras oportunidades sociais que são filtradas pelo processamento de dados dos cidadãos.

Os impactos da LGPD no futuro ainda são bastante incertos, sabemos que no presente momento, é fundamental que profissionais que atuam na área de Ciência de Dados, precisa estar cada vez mais atentos e atualizados as novas diretrizes legislativas vigentes no país.

-----



That's all folks! ✌️
Code Custodian: A lesson in refactoring.
Tags: opensource
Published: 2021-10-15 16:20:21

## The Story So Far...
When the OSD600 course began, we were asked to create a Static Site Generator tool to create HTML documents from txt files. Then, we were asked to add extra options to allow for customizing the HTML files such as stylesheet. As the weeks progress we added more and more features to the project. I noticed my code was following the same pattern for each of the operations, with minor tweaks in the HTML template based on the options passed in. 

## Improvements
The focus of my refactoring for this lab was making a module for my Yargs configuration options, and refactoring my repeated code into functions that can be called instead of retyping all the HTML template strings like so:
![generatepara](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lxscl2hs710uazfwrcsu.png)

Previously, instead of calling generatePara(), I would have had the split/map/join and regexp repeated inside each of the txt "if" statements checking file type. Furthermore, you may notice
```
let styles = argv.s ? `\n<link rel="stylesheet" href="${argv.s}">` : "";
```
 which previously was a statement checking 
```
if(argv.s){render the whole html template + link tag}
```
By doing it this improved way, I can simply add "styles" variable to my HTML template, and if it doesn't exist a blank string is added which produces nothing in the HTML. This allowed me to eliminate 2-3 repeated if statements and make the code much more readable.

I did the same thing in the Markdown sections and made a separate function to handle h1, h2, and p tags. I removed the repeated template code, added a function, and changed the styles tag as I did with txt.
## yargsConfig.js
In terms of the Yargs code, I made a [module](https://github.com/AndreWillomitzer/textToHTML_V2/blob/main/yargsConfig.js) and required it in my main file in order to get access to "argv" value. This helped me make my main textToHTML.js file much cleaner because the setup code for Yargs was put into it's own file and textToHTML.js just handles the file logic.

## Squash... and not the vegetable.
![Butternut Squash](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/unmw557tdfs35ea96hfs.png)
  
At the end I had a total of 4 commits and used git rebase -i main to squash the changes into 1 commit. Overall the command was very intuitive and allowed me to pick my 1st commit and squash the others into it. I then went to rename the commit message so that they would all be under a single name of "Refactored textToHTML.js for modularity". A link to the final commit can be found [here](https://github.com/AndreWillomitzer/textToHTML_V2/commit/4dfe0232d46ea2e270b7bc7b81b6e026d701002d). 

Thanks for reading!
Top 10 trending github repos of the week🌟.
Tags: docker, hacktoberfest, uptime, monitoring
Published: 2021-10-15 15:52:48

---
title: Top 10 trending github repos of the week🌟.
published: true
description: Most popular trending Github repos in this week.
cover_image: https://source.unsplash.com/featured/?coding
tags: docker,hacktoberfest,uptime,monitoring
series: Weekly Github top 10
---
GitHub is where over 65 million developers shape the future of software, together. Contribute to the open source community, manage your Git repositories, review code like a pro, track bugs and features, power your CI/CD and DevOps workflows, and secure code before you commit it.

Here is the most popular repos published on this platform.

## #1
{% github louislam/uptime-kuma %}

## #2
{% github facebook/flipper %}

## #3
{% github goplus/gop %}

## #4
{% github Slurmio/school-dev-k8s %}

## #5
{% github babysor/MockingBird %}

## #6
{% github lvgl/lvgl %}

## #7
{% github trailofbits/algo %}

## #8
{% github hrsh7th/nvim-cmp %}

## #9
{% github argoproj/argo-cd %}

## #10
{% github ossrs/srs %}

Enjoy these repos.
Follow me for more articles.
Thanks 💖💖💖
HACKTOBERFEST2021
Tags: hacktoberfest
Published: 2021-10-15 15:52:19

![Screenshot (103)](https://hacktoberfestswaglist.com/img/Hacktoberfest_21.jpg)

<!-- ✨This template is only meant to get your ideas going, so please feel free to write your own title, structure, and words! ✨ -->
I am enjoy to tell you that I feel great to Move one step toward opensource by hacktoberfest21.
My opinion about this fest.
https://www.youtube.com/channel/UCBpgSleRY0JfzAyW59beChQ
**This repository will automatically assign the `hacktoberfest` and `hacktoberfest-accepted` labels to all submitted pull requests.**
  
**If u not star this repo will automatically assign with `star_validation` labels in pull request and automatically not merge!.**
  
</p>

---

## ❤ HOW TO CONTRIBUTE

**1. STAR THIS REPO !! OR I WILL NOT MERGE YOUR FILES**

**2. SIGNUP / CREATE ACC IN HACKTOBER FEST**

**3. FORK THIS REPO** 

**4. ADD FILE + CREATE PULL REQ** 

**5. I WILL ACCEPT AS FAST AS POSSIBLE**

--- 

## 💥 NOTE

#### ⚠ PLEASE ADD YOUR FILE TO FOLDER.IF U WANT ADD ANOTHER PORGRAMMING LANGUAGE CREATE NEW FOLDER.Thank You.
#### ⚠ IF U ADD FILES OUTSIDE FOLDER IT WILL AUTOMATIC DELETED
#### ⚠ You can add any Programming file to this repo
#### ⚠ DONT EDIT README.MD!!!
#### ⚠⚠ IF U NOT STAR THIS REPO DON'T EXPECT ME TO MERGE YOUR PULL REQ ❤
#### ⚠⚠ ALREADY STAR BUT BUT I HAVEN'T MERGE? , LEAVE A COMMENT ❤

---

## 🔰 REWARD
#### ⚠ In Hacktoberfest 2021 You Can get free merchandise for $256 from DEV Shop
![Screenshot (71)](https://github.com/OMGUPTA21/Hackotoberfest2k21/blob/master/Screenshot%202021-10-21%20102617.png?raw=true)

![Screenshot (81)](https://user-images.githubusercontent.com/75615789/137628333-673fed7c-9570-49b9-a49b-f7a99af70901.png)

![Screenshot (99)](https://user-images.githubusercontent.com/75615789/137628407-5807fca1-9fc3-4baf-9126-97ddccae9a28.png)

![Screenshot (102)](https://github.com/OMGUPTA21/Hackotoberfest2k21/blob/master/WhatsApp%20Image%202021-10-21%20at%2010.31.19.jpeg?raw=true)

![Screenshot (110)](https://user-images.githubusercontent.com/75615789/137628448-bf26d656-a0e8-49b6-a84b-386a5008d1be.png)
Programming Platitudes
Tags: jokes, programming
Published: 2021-10-15 15:50:51

<ol start=0>
<li>Computers like to start counting at zero</li>
<li>A good place to start is to say "hello, world!"</li>
<li>Programming is a skill, it requires practice; designing programs is an art, it requires even more practice</li>
<li>Global variables will come back to haunt you</li>
<li>Computers get really confused when you ask them to divide something by zero</li>
<li>Make it work, then make it neat, then make it fast</li>
<li value=13>Asynchronous events means the order of things can be unpredictable</li>
<li value=6>Copy and paste is not a substitute for functions</li>
<li>Humorous test messages are not so humorous when they accidentally go live</li>
<li>Sometimes 32,767+ 1 = -32,768</li>
<li>No system is user proof</li>
<li>Infinite loops can be really bad for performance</li>
<li>No comment is better than an incorrect comment</li>
<li>Users reserve the right to change their mind</li>
<li value=14>You will spend way more time reading code than writing it</li>
<li>Rubbish data in, well processed yet still rubbish data out</li>
<li>Be weary of the prototype that just went live "as a stop gap"</li>
<li>Programming ability is related to your willingness to embrace meaninglessness</li>
<li>You are probably not the first to try and solve this problem</li>
<li>If all else fails, call it a caching problem and reboot</li>
<li>Goto 10</li>
</ol>
vue サーバーからデータを取得して表示する
Tags: vue, api
Published: 2021-10-15 15:43:41

## 前提条件

- バックエンドは`Rails`
- 自作のAPIサーバーからデータを取る
- `vue_cli`で作成
- パッケージ管理は`npm`

## 一次情報

- [axios公式](https://www.npmjs.com/package/axios)
- [vue.js.org](https://vuejs.org/)

## 手順

<ol>
  <li><strong>axios</strong>インストール</li>
  <li><strong>export default {}内</strong>にサーバーとやり取りするコードを記述</li>
  <li><strong>Rails</strong>側設定</li>
</ol>

## axiosインストール(HTTP通信ができるようになる)

- pakage.jsonがあるディレクリに移動後下記のコマンド実行

```unix
$ npm install axios --save
```

### サーバーとやり取りするコードを記述

- コンポーネント`methods`内に`axios`のコード追記

```js
-----------
  template
-----------

<script>
  import axios from [インストール先パス];

  export default {
  name: 'test',
  data: {
    test: []
  },
  methods{
    // メソッドreadが発火したら取りにいくという想定
    read(){
      axios
      .get('https://取得したいサーバドメイン名')
      .then((response) {

        // responseが実際に取得するデータ
        console.log(response);

        // responseの中のdata属性に取得したいデータが格納されている.
        // thisはvuecomponentオブジェクト 配列であるtestに格納している.
        // 取得するデータがJSONだとdataでいいっぽい APIそんな触らないから他のパターンもあるかも
        this.test = response.data;
      })
      .catch((error) {
        // handle error
        console.log(error);
      })
    },
  }
  };
</script>
```

- 長々と書いたが、実際に気にするのはどこから取得するかと、取得したデータの格納先
今回記述したコードは`axios`のサンプルコードとほぼ同じ.サンプルコードを下記に示す.

```js
const axios = require('axios');

// Make a request for a user with a given ID
axios.get('/user?ID=12345')
  .then(function (response) {
    // handle success
    console.log(response);
  })
  .catch(function (error) {
    // handle error
    console.log(error);
  })
  .then(function () {
    // always executed
  });
```

## Rails側設定

- CORS対策でRails側の設定が必要

```gemfile
gem 'rack-cors'
```

- `config/initializers/cors.rb`コメントアウトを有効に

```ruby
# Be sure to restart your server when you modify this file.

# Avoid CORS issues when API is called from the frontend app.
# Handle Cross-Origin Resource Sharing (CORS) in order to accept cross-origin AJAX requests.

# Read more: https://github.com/cyu/rack-cors

Rails.application.config.middleware.insert_before 0, Rack::Cors do
  allow do
    origins 'http://データを贈りたいパス'

    resource '*',
      headers: :any,
      methods: [:get, :post, :put, :patch, :delete, :options, :head]
  end
end
```

- 変更するのは`origins`の指定のみ

- Railsサーバーを再起動させて、データをこれで取得できるはず.