teleren/devto huggingface dataset:
Você deve usar tailwindcss!
Tags: braziliandevs, css, frontend, webdev
Published: 2023-05-16 13:33:42

Claro, o uso é relativo, já que uma ferramenta que se encaixe em um projeto não significa ser a ideal em todos os outros. Mas agora que consegui sua atenção com o título, veja alguns motivos para considerar usar o tailwind no seu projeto.

Podemos dividir frameworks CSS nas categorias Components e Utility como veremos a seguir.

Diferente de outros populares frameworks de CSS, como o bootstrap, que traz o design pronto com estilização (components), o tailwind traz classes para você criar seu próprio design (utility).

Seu código vai ficar cheio de classes e parecer feio, o que mais incomoda alguns devs, porém isso vem com ganhos de velocidade no desenvolvimento após o domínio da ferramenta.

Lembre-se da letra S (Single Responsability Principle) do SOLID para que seu código não fique sujo. Então não crie componentes complexos e grandes, do contrário, use outra solução de CSS para seu HTML não ficar enorme.

Pontos que me fizeram optar pelo tailwind em meus projetos:

- Maior controle na linguagem visual, mais leve por usar apenas as classes necessárias e vai melhorar seu conhecimento de estilos CSS em comparação a um framework de componentes.
- Curva de aprendizagem não muito alta. As classes utilitárias de tamanho são abreviações de estilos CSS. Por exemplo, `padding-bottom: 10px` é a classe `pb-10` e definir a classe apenas para um tamanho de tela também é simples com um prefixo. Para dispositivos de tamanho médio seria `md:pb-10`;
- Tudo pode ser personalizado. Use o arquivo tailwind.config.js para criar seu próprio Design System. Você pode levar seus tokens de UI para lá;
- Traz padronização desde o início do seu projeto, como múltiplos de 8 e unidade rem;
- Adotado por grandes empresas;
- Exibido na documentação do Next.js;

Dica: Extensão Tailwind CSS IntelliSense para VS Code.

Crie um tema no [arquivo de configurações](https://tailwindcss.com/docs/configuration) para definir as cores, fontes e espaços, os design tokens. Se houver uma modificação, você não vai precisar trocar todas as classes do código.

Além do já citado bootstrap, temos outras atraentes, como o styled components, Chakra UI e Material Design.
É necessário analisar qual se enquadra melhor no seu projeto. Eu defendo mais CSS puro ou tailwind pelos motivos já listados.

Esse artigo é sobre frameworks e não Tailwind vs CSS. Há quem prefira o CSS puro e ter menos classes no HTML, o que também é válido.

Único caso que não recomendaria qualquer tipo de framework é na criação de libs. Aliás, quando menos dependências em libs melhor.

Se você é iniciante recomendo estudar bootstrap, que possui curva de aprendizagem baixa e é usada também no mercado e depois partir para estudar uma solução de utilitários como o tailwind e aprender CSS. Todos Devs front-end tem que saber no mínimo o básico de CSS!

Bootstrap venceria em um cenário 
em que você precise desenvolver um produto rápido e já estilizado, já o tailwind onde você já tem um Design System próprio.

Confira o ranking dos frameworks CSS em 2022

https://2022.stateofcss.com/en-US/css-frameworks/
Vite Server not Updating Changes after Save in Vue 3 with Nuxt js
Tags: vue, vue3, nuxt, vitejs
Published: 2023-05-16 13:24:42

---
title: Vite Server not Updating Changes after Save in Vue 3 with Nuxt js
published: true
description: There are a few things that can go wrong with hot reload, and if you're having problems, it can be difficult to know where to start. In this blog post, we'll walk you through some of the most common problems with Vite hot reload and how to fix them.
tags: vue, vue3, nuxtjs, vitejs
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2023-05-16 13:10 +0000
---

Vite is a modern JavaScript build tool that provides fast development times and a great developer experience. One of the best features of Vite is hot reload, which allows you to see changes to your code without having to manually refresh the browser.

However, there are a few things that can go wrong with hot reload, and if you're having problems, it can be difficult to know where to start. In this blog post, we'll walk you through some of the most common problems with Vite hot reload and how to fix them.

## **Problems with Vite Hot Reload**

There are a few common problems that can occur with Vite hot reload. These include:

* **File names not matching import statements:** Make sure that the file names and import statements match exactly. For example, if your file is named `task.js`, your import statement should be `import Task from "src/js/task.js"`.
    
* **Third-party libraries not supporting hot reload:** Some third-party libraries don't support hot reload, which means that you'll need to manually refresh the browser to see changes.
    
* **Incorrect Vite configuration:** Make sure that your Vite configuration is correct. You can find more information on the Vite website.
    

## **Troubleshooting Vite Hot Reload**

If you're having problems with Vite hot reload, you can try the following:

* **Restart your Vite server.**
    
* **Clear your browser's cache.**
    
* **Try a different browser.**
    

If you're still having problems, you can ask for help on the Vite Discord server.

## **Tips for Troubleshooting Vite Hot Reload**

Here are some additional tips for troubleshooting Vite hot reload:

* **Use a consistent file naming convention.** This will help to avoid errors caused by mismatched file names and import statements.
    
* **Avoid using third-party libraries that don't support hot reload.** If you must use a third-party library that doesn't support hot reload, you can try using a CDN to load the library.
    
* **Keep your Vite configuration up to date.** The Vite team is constantly adding new features and improvements, so it's important to keep your configuration up to date.
    

## **Conclusion**

Hopefully, this blog post has helped you to troubleshoot Vite hot reload in Vue 3. If you're still having problems, please feel free to ask for help on the Vite Discord server.

If you have any questions or comments, feel free to reach out to me on my Twitter handle [@iamatifriaz](https://twitter.com/iamatifriaz)
LeetCode 424. Longest Repeating Character Replacement
Tags: python, leetcode, slidingwindow, algorithms
Published: 2023-05-16 13:10:55

## Example 1:
Input: s = "ABAB", k = 2
Output: 4
Explanation: Replace the two 'A's with two 'B's or vice versa.

## Example 2:
Input: s = "AABABBA", k = 1
Output: 4
Explanation: Replace the one 'A' in the middle with 'B' and form "AABBBBA".
The substring "BBBB" has the longest repeating letters, which is 4.
There may exists other ways to achive this answer too.

---

## Solution
```python
from collections import defaultdict

class Solution:
    def characterReplacement(self, s: str, k: int) -> int:
        left = 0
        right = 0
        frequency = defaultdict(int)
        max_count = 0

        for _ in range(len(s)):
            frequency[s[right]] += 1
            max_count = max(max_count, frequency[s[right]])
            if right - left + 1 - max_count > k:
                frequency[s[left]] -= 1
                left += 1

            right += 1

        return right - left
```
📜Awesome Page Scroll Effect | HTML & CSS✨
Tags: beginners, css, html, programming
Published: 2023-05-16 13:04:27

{% embed https://youtu.be/uV8kH5RgSZU %}

1️⃣ Importing Google Fonts:
The @import rule imports the "Poppins" font from Google Fonts. It makes the font available for use throughout the stylesheet.
```css
@import url("https://fonts.googleapis.com/css2?family=Poppins&display=swap");
```
2️⃣ Global Styles:
The following styles are applied to all elements on the page using the universal selector (*):
```css
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}
```
* margin: 0; and padding: 0; set the margin and padding of all elements to zero, removing any default spacing.
* box-sizing: border-box; ensures that the width and height properties include padding and borders, avoiding unexpected layout issues.
* font-family: "Poppins", sans-serif; sets the font family to "Poppins", a sans-serif font from Google Fonts. If Poppins is not available, it falls back to a generic sans-serif font.

3️⃣ Container Styles:
```css
.container {
  scroll-snap-type: y mandatory;
  overflow-y: scroll;
  height: 100vh;
}
```
* scroll-snap-type: y mandatory; enables the container to scroll vertically in a snap manner, meaning it will align its children sections neatly.
* overflow-y: scroll; enables vertical scrolling within the container.
* height: 100vh; sets the height of the container to 100% of the viewport height, ensuring it takes up the entire screen.

4️⃣ Section Styles:

```css
section {
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  scroll-snap-align: start;
}
```
* height: 100vh; sets each section's height to 100% of the viewport height, making them fill the entire screen.
* display: flex; enables flexbox layout for the sections.
* justify-content: center; centers the contents horizontally within each section.
* align-items: center; centers the contents vertically within each section.
* scroll-snap-align: start; ensures each section aligns at the start of the scroll position, creating the snapping effect.

5️⃣ Styling for Different Sections:
There are four different sections with class selectors: .one, .two, .three, and .four. Each section has a different background color.
```css
.one {
  background-color: rgb(36, 164, 138);
}
.two {
  background-color: rgb(211, 79, 79);
}
.three {
  background-color: rgb(67, 91, 175);
}
.four {
  background-color: rgb(191, 64, 191);
}
```
* .one has a background color of rgb(36, 164, 138).
* .two has a background color of rgb(211, 79, 79).
* .three has a background color of rgb(67, 91, 175).
* .four has a background color of rgb(191, 64, 191).

These styles define the layout, scrolling behavior, and appearance of sections within a container. They create a visually pleasing and engaging scrolling experience with distinct section colors.
How to Use Cross Account IAM Role
Tags: aws, devops, serverless, security
Published: 2023-05-16 13:02:18

**Cross account IAM roles** allow you to grant access to resources in one AWS account to a user or resource in another AWS account. This is useful for scenarios where you have multiple AWS accounts and need to share resources between them.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/73h1pf6jiiyb357k8kho.jpg)

To use cross account IAM roles, follow these steps:

1. Create an IAM role in the account that owns the resource you want to share. This is known as the resource account **ACCOUNT B**.
2. Define a trust policy for the role that allows the account you want to share the resource with to assume the role. The trust policy should include the AWS account ID of the account that will assume the role **ACCOUNT A**.
3. Attach a policy to the role that grants permissions to the resource you want to share.
4. Share the IAM role with the account that needs access to the resource . To do this, create a role in the account that needs access **ACCOUNT A**, and define a trust policy that allows it to assume the cross account IAM role.
5. Use the cross account IAM role to access the shared resource.

By following these steps, you can easily share resources between AWS accounts using cross account IAM roles.

If you want to know more, I have prepared a video in which I explain everything **step by step**. I am creating **2 IAM roles** in 2 different AWS accounts and one **lambda function** that can use a role from another AWS account. The lambda function can add, remove, change and do other cool things in a completely different AWS account.

{% embed https://youtu.be/Qrm84k9vRXg %}
HI GUYS , AM HERE TO TALK ABOUT MY HOBBY
Published: 2023-05-16 12:52:33

AS a child I grew IN Kigali city, I like basketball so much, I support Los Angeles Lakers and I admire LEBRON JAMES. 
I was a great player in high school at which I got Scholarship when I was In S6, I thought I would go all the way to become a great international basketballer, but unfortunately ,It didn't 
go my way, but I hope my child will fulfill my dream.

I also like to watch football, am a big Fan of ARSENAL FC and FC BARCELONA, I like LIONNEL MESSI by which as many ,I take him as the GOAT(The greatest of all the time in football),
I like zoo life, by watching wild life documentaries, am a big fan of little children, I used to talk to them and listen from them, in order to know what they think   
My favorite  food are Meat ,Irish potato and PIZZA

Thanks for today, see u next time

bye!!!
HELLO GUYS, AM HERE AGAIN TO TELL YOU ABOUT MY VULNERABILITY
Published: 2023-05-16 12:28:36

HELLO GUYS, Am here to tell you about my vulnerability.
As a child I grew in the city, Am not used to live in rural area
in addition am already married, I have a big task to get money for us to live better in addition I don't have a job which can provide us what we need, especially for my pregnant wife.
it makes me discomfort and overthinking about the future of my family.
so, am working hard to change that so we may have a good future.

Thanks a lot may God be with you
Life in a refugee camp
Published: 2023-05-16 12:27:55

My name is NTIRAMPEBA Leilla Carmene, I  know that many people don't know how life is in a refugee camp and today is exactly what I'm gonna share with you.
My first time in a refugee camp was on 28th/04/2015; when my new chapter in life started.
I was still too young, I was very scared I didn't know if I can make it I mean get used to my new life and forget my old life, friends and everything. What made me worry the most was about school because I taught that I won't study anymore.
But like somewhere else there are some opportunities in a camp even if is still at a low level but at least we can study and get basic needs and that is why I as a refugee have a small opportunity that means a lot to me because maybe it won't come again that's why I have to work hard when I still have time to do so.
For me living in a camp is also experiencing new life like; living with different people from different places, living a completely different life from what you used to live.
Although we had different problems especially for us young for example many youths used drugs by thinking that they solving problems without knowing that they making the situation worse.
I would like to end my story by telling you that living in a camp is not easy but we are still moving forward and fighting for our life.
Survey aimed at software developers and computer science students
Tags: webdev, javascript, development, programmers
Published: 2023-05-16 12:26:29

Dear software development community,

my name is Havva Korkmaz, I'm studying business administration service management at the Berlin School of Economics and Law and am currently writing my bachelor's thesis. This deals with the topic of which personnel marketing and personnel recruiting measures are most effective in order to attract software developers.

To answer this question, your opinion as a software developer is of great importance. I would like to understand your expectations and needs when looking for a job and making a decision about a new job.

I would appreciate active participation in my survey:

https://forms.gle/D54gxiFYLZK3n2Gj9
HELLO ONCE AGAIN, THIS IS KEVIN,AM BACK TO TELL YOU ABOUT MY LIVEHOOD
Published: 2023-05-16 12:04:07


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3ta60p8wl9jcqef1gb3h.jpg)Hello guys, as I told you last time Am a Rwandan, I live here in 
  MAHAMA sector.
Am a man and I'll turn 29 come in September, I have a family, we were 5 children with 3 boys and 2 girls, am 4th but unfortunately my younger brother passed away in 2017 through car accident, I totally lost my mind because he was the only one left home with me because all others were married.
My parents especially mom was in worst moments of her life that she couldn't cope with the loss of her child, but the time passed by and life moves on.
Right now am a married man with a pregnant wife, we are about to give birth for our first child come in august, I used to be hustling to live and we are not in best life we would like to live in, but hopefully ,the future looks brighter with this coding class am taking.
thanks for getting in touch with me .

SEE U SOON!!!!!
MySQL 8.0: Invisible Columns
Tags: mysql, tutorial, sql
Published: 2023-05-16 12:03:39

The Oracle company ported `INVISIBLE COLUMN` feature to it's little brother MySQL. Since version 8.0.23 the invisible column feature available for MySQL users.

Let's learn how it works!

You can create invisible column as regular when you create a table using `INVISIBLE` keyword:

```
CREATE TABLE test_table (
  a INT,
  b DATE INVISIBLE
) ENGINE = InnoDB;
```

or add new column to an exists table by `ALTER TABLE` command:

```
ALTER TABLE test_table ADD COLUMN c INT INVISIBLE;
``` 

When a column exists you can change its visibility using CHANGE, MODIFY or ALTER COLUMN command as you can see below:

```
ALTER TABLE test_table CHANGE COLUMN b b DATE VISIBLE;
ALTER TABLE test_table MODIFY COLUMN b DATE INVISIBLE;
ALTER TABLE test_table ALTER COLUMN c SET VISIBLE;
``` 

When you fetch table structure you will see all columns, but part of them will be marked by `INVISIBLE` flag:

```
SHOW COLUMNS FROM test_table;
SHOW CREATE TABLE test_table;
```

So you see, the invisible column manipulation pretty simple. Now look how the visibility affects DML.

First, when you try to select all columns using `SELECT *`, the invisible columns are not appears. So if you need to see they, you must to know the column name and select it by its name. Look below SQL code examples:

```
TABLE test_table; SELECT * FROM test_table; -- column hidden

SELECT a, b, c FROM test_table; -- column visible
```

Same way, when you need to insert data to invisible column you must call it by name:

```
INSERT INTO test_table VALUES (1, now(), 33); -- Error
INSERT INTO test_table () VALUES (1, now(), 33); -- Error too

INSERT INTO test_table VALUES (1, 22); -- NULL inserted
INSERT INTO test_table (a, b, c) VALUES (1, now(), 33); -- all values
```
Where you can use this feature? First - security - you can use invisible column for hide some column from DB users with low permissions. Second - when you use generated column you can prevent insert data to such column doing it invisible.
Look next example:
```
CREATE TABLE test_table (
  a INT,
  b INT
) ENGINE = InnoDB;

INSERT INTO test_table VALUES (1, 2), (2, 3), (3, 4);

ALTER TABLE test_table ADD COLUMN a_b_sum INT AS (a + b);

SELECT * FROM test_table;
```
In above example we added generated column to our `test_table` but this change can break our insert query. What we can do in this case? Right - use invisible column.

```
ALTER TABLE test_table ALTER COLUMN a_b_sum SET INVISIBLE;

INSERT INTO test_table VALUES (5, 7), (2, 9), (2, 3);

SELECT a, b, a_b_sum FROM test_table;
``` 

Here you can [run SQL queries online](https://sqlize.online/s/0d) and test this feature.

So, this is all about this feature. If you think about more use-cases please share it in comments.
Breaking out of tutorial hell
Tags: webdev, javascript, beginners, programming
Published: 2023-05-16 11:58:58

I think it's safe to say that for nearly all of us self-taught/bootcamp developers, the term "tutorial hell" is something we've heard at least once.

I have been battling with the self-taught path since the beginning of the pandemic. Tutorial after tutorial. It wasn't far into my journey before I realized that as soon as I went to start coding out my own project, I had NO idea what I was doing. It wasn't until recently that I discovered Scrimba as a learning resource.

The people over at Scrimba have broken down the steps of learning front-end web development in the best possibly way. With just enough hand holding leading up to the solo projects, I have finally reached the point where I am able to start building my own apps with confidence.

My advice, for those in the same boat, is to start applying what you've learned on your own projects IMMEDIATELY. It's scary, yes, but it truly is the best way to create the muscle memory needed to thrive in the industry. Let me know how your journey is going and if you've also struggled with tutorial hell!
Terminal Chat with Bard using bardAPI and Python
Tags: bard, ai, python, chatgpt
Published: 2023-05-16 11:51:51

So I took a look at `BardAPI` on Github and built a simple terminal chat using python

BardAPI : https://github.com/dsdanielpark/Bard-API

My Github : https://github.com/pj8912/terminal_chat

- Get the key as per the instruction on [BARDAPI](https://github.com/dsdanielpark/Bard-API)
- Create a `.env` on the root folder and assign that value `BARD_API_KEY` variable

## Code

```
import os
from dotenv import load_dotenv
from bardapi import Bard
load_dotenv()
os.environ['_BARD_API_KEY'] = os.getenv("BARD_API_KEY")
bard = Bard()
print('\n','*'*50,'Terminal Chat with BARD','*'*50, '\n')
try:
    while True:
        user_input = input('\U0001F464 You: ')
        print('')
        print('\U0001F916 Bard:', bard.get_answer(user_input.strip())['content'])
        print('-'*100, "\n")
except KeyboardInterrupt:
    print('Ended Chat!')
except:
    print('Ended Chat!')
```
As per the documentation the `os.environ['_BARD_API_KEY']` is assigned the your BARD_API_KEY 

---

## Run
Run the script to start chatting with `Bard`
```
$ python app.py
```
![Image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/il96nfsllmjtn90v1fd3.png)

## ENJOY!
awesome-game-kata
Tags: opensource
Published: 2023-05-16 11:46:45

check it out - [awesome-game-katas](https://github.com/adrocodes/awesome-game-kata)

a subset of [awesome-katas](https://github.com/gamontal/awesome-katas) focusing on code katas related to games/gaming. if you find any katas that you think may fit under this theme open a PR, otherwise have some fun and solve some interesting code problems.

🐢