teleren/devto huggingface dataset:
Refactoring and Git Rebase Experience
Published: 2023-10-14 03:55:00

In this blog, I will share my experience about refactoring codes and git rebase process. Let's start!

##Refactoring

Refactoring is a crucial aspect of software development, it can improve the maintainability, readability, and overall quality of our code. Usually we have the following approaches:

- Eliminate the global variables.
- Choose functions to compute values rather than storing them in variables.
- Split the code into smaller parts
- Enhance variable naming for clarity and readability.
- Reduce redundancy by implementing shared functions or classes.

##How I did in my project [txt2html](https://github.com/mingming-ma/txt2html)

I've identified several areas where refactoring is needed: I had a global variable related to my language attribute setting, logic lines were repeated for obtaining input file paths that only differed in extensions, and all functions were located in a single file. For now, I have removed the global variable, consolidated repeated lines, and improved variable naming for better readability. I plan to split the functions later.

I'd like to remind you that [React](https://github.com/facebook/react/releases/tag/v18.2.0) has remained at version 18.2 for over one year. I assume they are busy with refactoring for the upcoming release. :)

## Git Rebase in Refactoring

First, let's have a new branch for refactoring:
```
# Create a new topic branch off of main
git checkout -b refactoring main
```

Then we do the changes and commit each changing. After we decide finish the refactoring, we need to squash all commits into one commit, here comes the `git rebase`:

```
git rebase main -i
```

This command gives us all commits as follows:

```
pick <Commit Hash> <Oldest Commit Message> 
pick <Commit Hash> <Older Commit Message> 
pick <Commit Hash> <lasted Commit Message> 
...

# Rebase ...
#
# Commands:
# p, pick <commit> = use commit
# r, reword <commit> = use commit, but edit the commit message
# e, edit <commit> = use commit, but stop for amending
# s, squash <commit> = use commit, but meld into previous commit
...
```

So we need to pick the oldest commits and squash all the other commits to that one, changes the above to:


```
pick <Commit Hash> <Oldest Commit Message> 
squash <Commit Hash> <Older Commit Message> 
squash <Commit Hash> <lasted Commit Message> 
...

# Rebase ...
#
# Commands:
# p, pick <commit> = use commit
# r, reword <commit> = use commit, but edit the commit message
# e, edit <commit> = use commit, but stop for amending
# s, squash <commit> = use commit, but meld into previous commit
...
```

Then we save this and exit, git will do the left things for us.

We then need to use  `git commit --amend` to modify the commit messages after the `rebase` step or `git --amend --no-edit` keep all commit messages. Last step is merge to `main`: 

```
git checkout main
git merge refactoring
git push origin main
```

That's it! Hope it helps!
Refactoring release 0.1
Published: 2023-10-13 23:49:09

Hello everyone,

In this lab I had worked on release 0.1 to refactor the code which eventually means to structure code in such a way to look more readable and modular.

3 Feature that has been refactored:

1. **Get rid of global variables**- I have removed the global variable definitions and encapsulated the logic within functions. The main function is responsible for parsing command-line arguments and driving the program. This makes the code more organized and easier to follow.
2. **separate command-line argument parsing from file**  - In this code, we've separated the file processing logic into a generateHTML function while making minimal modifications. This separation helps improve code organization and readability.
3. **reduce code duplication through shared functions, classes**- In this code, I added utility functions "readFile" and "writeFile" to handle reading and writing files. This reduces code duplication.


**Bugs and error:** While completing i do found some bugs such as for exit code and parsing error for TOML format.

**Conclusion:** Through this journey I learned the importance of maintaining neat and clean code which help other developer to work on project and further helps to find minor bugs which can be removed from project.
Tại sao nên thiết kế website spa? Mấu chốt trong kinh doanh làm đẹp
Tags: spa, lamdep, actgroup, thietkeweb
Published: 2023-10-14 03:35:27

Trong thời đại số hóa hiện nay, việc sở hữu một trang web cho spa của bạn không chỉ là một lựa chọn thông minh mà còn là một yếu tố quyết định giữa thành công và thất bại. Dưới đây, chúng tôi sẽ giới thiệu lý do mà việc thiết kế website cho spa là cần thiết.
Xem thêm: [https://actgroup.com.vn/tai-sao-nen-thiet-ke-website-spa/](https://actgroup.com.vn/tai-sao-nen-thiet-ke-website-spa/)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/un312sdwxax319a8m72k.jpg)
HactoberFest Report
Tags: hacktoberfest23, hacktoberfest
Published: 2023-10-14 03:22:20

This is my first time doing hactoberfest and this is my progress so far
My first 3 merged PR got accepted waiting for the other one to get merged. Still I won't stop there gonna contribute as much as I can to opensource. 


![Hacktoberfest Progress](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g2ko592u40hrei3ok417.png)

### also got tree planted by hactobefest


![Tree Planted](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0ls48sioyn6odfk4tbcy.png)


### furthermore I received some badged for everything

[![An image of @mannuvilasara's Holopin badges, which is a link to view their full Holopin profile](https://holopin.me/mannuvilasara)](https://holopin.io/@mannuvilasara)

----
Breaking Down Redux
Published: 2023-10-12 10:20:19

Redux might be the hot catchword used with React or in general MERN based applications, highlighted as the goto state management tool. 

Before moving further, it becomes a priority to understand what actually is a state. State can be defined as a simplistic JS Object that holds information accessible to all the components in an application.

#### Example - State

`state = {
username: '',
password: '',
result: '',
status: 1
}
`
### Features of Redux

1. **Transparent:** Redux is transparent in a sense that all the information the state holds must me explicitly available to other components of the application. In programmatic words, it is indeed 'global', that must make pretty clear top understand the purpose of Redux.

2. **Independent:** Redux does not require a user interface to rely on thus, giving the developer an independent experience.

3. **Supportability:** Redux has a toolkit named react-redux that is built on top of both the libraries and provides an abstract layer over redux to make the job easier for developer community.

4. **Easy to learn:** Being a newbie with a mountain of terminologies can be daunting but with more practice and understandability, redux ( or redux toolkit ) can be learned gradually.
Becoming Your Own Boss
Tags: learning, freelancer, entrepreneur, sidehustle
Published: 2023-10-14 03:13:17

Selling digital and physical product is the best side business you can learn to earn extra income. It works for me, making money every day without affecting my work as a wellness coach.

Learn the exact ways I start making  extra money using high level skills and tools I acquired from other successful entrepreneurs.
In this coaching session, I provide marketing techniques I learned over 5years I’ve been in business, as well as 1 hour video for all of my visual learners, plus ebook that will show you the specific strategies that you need to follow to grow a successful business,attract your ideal clients and generate consistent income. Also lists of 50 physical & digital product to choose from.
Anybody can do this but you need to put in the work & remain consistent. You can start making $50-$100 a day and $1000-$5000 and more a month. With lots of passion, this one knowledge could change your life turning into 6 figures business.

Whether you’re ready to switch from working to freelancer , having issues getting hired yet, ready to become your own boss or just to start a side hustle. I’ll be shearing all secret and more teaching y’all specific step by step that I’ve used, giving my personal vendors lists and factories connections which you will need if you are new to entrepreneur journey. I’m saving you lot’s of time on sampling products and to avoid being scammed. All of this from the comfort of your home.

https://stassyscott3.wixsite.com/becomingyourownboss
Aprende como montar un volumen EBS en tu instancia de Linux en AWS.
Published: 2023-10-14 03:03:35

A lo largo de este post, de manera muy sencilla, aprenderás cómo montar un volumen EBS en una instancia de Linux en AWS. Asumiré que ya sabes cómo crear una instancia, un volumen EBS y asociarlo a dicha instancia.

Pero ya sabemos que no basta con asociar el volumen a la instancia; debemos hacer el montaje del volumen, y aquí lo haremos paso a paso:

Paso 1: Procedemos a conectarnos a nuestra instancia. Para esto, puedes utilizar la AWS CLI o Instance Connect.

Paso 2: Crearemos el directorio donde queremos montar nuestro volumen. En este artículo, lo haremos en el directorio /mnt y lo llamaremos mi_volumen. Ejecutamos el siguiente comando:

```
sudo mkdir /mnt/mi_volumen
```

Paso 3: Verificamos que el volumen que asociamos ya existe en nuestro sistema. Lo hacemos de una manera sencilla con el comando

```
lsblk
```

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

Podemos ver nuestro volumen xvdf de 4GB en el output anterior.

Paso 4: Debemos formatear nuestro volumen antes de montarlo. Esto significa prepararlo para su uso al establecer la estructura y las tablas de metadatos necesarias. Lo haremos con el siguiente comando, utilizando el sistema de archivos ext4:

```
sudo mkfs -t ext4 /dev/xvdf
```

La salida indicará que el comando ha formateado con éxito el dispositivo /dev/xvdf con el sistema de archivos ext4, y el sistema de archivos ahora está listo para su uso. Los datos que se almacenen en este dispositivo se guardarán en el sistema de archivos ext4 que acabas de crear.

Paso 5: Ahora procedemos a realizar el montaje de nuestro volumen xvdf en el directorio que creamos al inicio llamado mi_volumen. Lo hacemos con el siguiente comando:

```
sudo mount /dev/xvdf /mnt/mi_volumen
```
Verifiquemos el montaje con el comando

```
df -h
```
Deberías ver una línea que muestra el dispositivo y el punto de montaje que configuraste.

Paso 6: Ahora configuraremos que el montaje sea persistente cuando se reinicie o se detenga la instancia. De lo contrario, tendrías que hacerlo de manera manual cada vez que reinicies o detengas la máquina. Esa persistencia se hace accediendo al siguiente archivo:

```
sudo nano /etc/fstab
```
una vez dentro del edito agregaras la siguiente linea:

```
/dev/xvdf  /mnt/mi_volumen ext4 defaults 0 0

```
No olvides usar el nombre de EBS y del directorio que creaste y donde hiciste el montaje cuando vayas a ejecutar las lineas de codigo.

En este punto ya tienes tu volumen EBS montado y aca podrias hacer algunas pruebas como crear archivos y datos, reiniciar tu instancia y  volver a iniciar para observar la persistencia de los datos, hay mucho por aprender y probar, asi que adelante.

Por otra parte, sabias que un EBS que no fue cifrado y que adjuntaste a una instancia podrias cifrarlo teniendo en cuenta los datos que ya existen y los que estan en transito? si te parece interesante y quieres saber como se hace, dejalo en los comentarios.
Reflex: 10 Minute Docs Audit
Tags: python, documentation, docsaudit, webdev
Published: 2023-10-14 02:01:13

Reflex is a Python framework that allows developers to create 100% Python web apps (no JavaScript required). 

{% embed https://youtu.be/6c4G1jOeCjE %}

I run a technical documentation business specializing in writing and editing documentation. I made this series to share my insights and help projects craft impactful documentation.

## What's The Criteria?
3- Excellent
2 - OK
1 - Poor

Purposeful: Does the QuickStart explain what problem it's trying to solve? Who is the intended audience?

UX Experience: How seamless is the experience? Must the user create an account to get through the Quickstart? Does the Quickstart elicit a sense of joy and achievement?

Accurate: Are the instructions correct? Are they complete?

## [The Results](https://www.loom.com/share/b599e41ca14a48bab69a01d84ff4baa3?sid=bb6354df-2245-4303-a4c6-9b2192e5a355)

Tons of fumbling. Not sure who was the bigger problem, me or the docs. First, I was having trouble setting up venv. Then, it took me some time to install Reflex. All that effort and all I got was an error message when I ran the `Reflex Init` command. 😭

How can Reflex improve? Please list how to create and activate `venv`, don't make users have to fumble through the official Python docs. Also, if `reflex init` really is broken, please fix it ASAP. 

Things that Reflex did well? Loved the docs intro. It was obvious that this application was for Python devs who don't want to deal with JavaScript!



|               | Score |
|---------------|-------|
| Purposeful    | 3     |
| UX Experience | 2     |
| Accurate      | 1     |

Are you interested in a FREE Quickstart audit for your company? [Start here](https://forms.gle/5jDeuQraBwahkjT16).
Task 4
Published: 2023-10-14 01:52:42

Manual testing is a software testing technique in which a human tester, without the use of automation tools or scripts, executes test cases to identify defects or issues in a software application. In manual testing, the tester acts as an end user and interacts with the application's user interface, providing inputs and checking the outputs to ensure that the software behaves as expected.
      
Manual testing offers several benefits and drawbacks, and the choice between manual and automated testing depends on the specific context and testing requirements. 

Benefits of Manual Testing:

1. Human Judgment: Manual testers can apply their critical thinking and domain knowledge to uncover subtle defects that automated tests might miss. They can identify issues related to usability, user experience, and other qualitative aspects.

2. Exploratory Testing: Manual testers excel at exploratory testing, where they actively explore the software to find unexpected issues, making it valuable for uncovering new defects.

3. Adaptability: Manual testing is flexible and adaptable to changes in the software, making it suitable for dynamic or rapidly evolving projects.

4. Cost-Effective for Small Projects: For small-scale projects or projects with a limited budget, manual testing may be more cost-effective than setting up and maintaining automated testing infrastructure.

5. Early Testing: Manual testing can begin even before a user interface is fully developed, allowing early testing of requirements and design.

Drawbacks of Manual Testing:

1. Resource-Intensive: Manual testing can be time-consuming and costly, especially for large or complex applications. It requires skilled testers who need time to execute test cases manually.

2. Repetitive Tasks: Testers may become fatigued when repeatedly executing the same test cases, leading to oversight and reduced accuracy.

3. Limited Test Coverage: Manual testing might not cover all possible test scenarios, leading to gaps in test coverage. Automated tests can provide more comprehensive coverage.

4. Not Suitable for Regression Testing: Regression testing, which involves repeatedly testing existing functionalities after each code change, can be inefficient and error-prone when done manually. Automated tests are better suited for this task.

5. Not Scalable: As the application grows in complexity, manual testing becomes less scalable, and the time required for testing increases.
Set SSH keys for Github in ubuntu or linux mint
Tags: github, nalem7, beginners, ubuntu
Published: 2023-10-14 01:50:52

## Github Installation
```console
sudo apt install ppa-purge
sudo ppa-purge ppa:git-core/ppa
sudo apt purge git
```

## Configuring the git
```
git config --global user.name "<your_github_username>"
git config --global user.email <your_email@example.com>
```
> **_NOTE:_**  To check the user.name and user.email set or not 
`git config -l`

## Keys generation

Step 1: Generate new ssh keys
```
ssh-keygen -t ed25519 -C "your_email@example.com"
```

Step 2: Add a new ssh keys
```
cat ~/.ssh/id_ed25519.pub
```

> **_Output will be something like this_**  
ssh-ed25519 
NAAAC3Nza*********jPRyyNVIdgj
your_email@example.com

Step 3: Copy output and paste in `setting > SSH and GPG keys > new SSH key`
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5mrlhokvusj1s5wfh54s.jpg)
Task 3
Published: 2023-10-14 01:39:30

Functional testing and non-functional testing are two types of software testing. The difference between them are:

Functional Testing:
        This type of testing focuses on verifying that the software functions according to its specified requirements. It checks whether the application performs its intended functions correctly. It mainly deals with the "what" aspect of the software.

         It primarily involves testing the features and functionalities of the software. This includes testing individual functions, user interfaces, data processing, and interactions between different parts of the software.

         
Non-Functional Testing:
          Non-functional testing, on the other hand, assesses the qualities or characteristics of the software, such as performance, reliability, usability, and scalability. It evaluates how well the software performs its functions under various conditions and measures attributes like speed, security, and user-friendliness. Non-functional testing deals with the "how" aspect of the software.

         It covers a broader range of attributes and characteristics beyond the core functionality. Non-functional testing includes areas like load testing, security testing, usability testing, and performance testing.

In summary, functional testing focuses on verifying that the software's features work as intended, while non-functional testing assesses various quality attributes like performance, security, and usability. Both types of testing are essential to ensure a software application meets its functional requirements and provides a satisfactory user experience.
Hacktoberfest 2023 Open-Source Repository
Tags: hacktoberfest23, hacktoberfest, webdevelopers, webdesign
Published: 2023-10-14 01:35:22

---
title: Hacktoberfest 2023 Open-Source Repository
published: true
description: Open-Source Repository for hacktoberfest 2023
tags: #hacktoberfest23 #hacktoberfest #webdevelopers #webdesign
# cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hq6wemos1rs3rw11ht1l.png
# Use a ratio of 100:42 for best results.
# published_at: 2023-10-14 01:23 +0000
---


Welcome to all developers who are contributing to open-source for Hacktoberfest 2023!

For this year's event, I am maintaining an open-source repository where you can choose any web design and write the code in HTML, CSS, JavaScript to convert it into a live website.

Demo: [https://aravindkumarv.xyz/design2code2live/Demo](https://aravindkumarv.xyz/design2code2live/Demo)

Here is the repository link {%embed https://github.com/lmas3009/design2code2live %}

Here is the issue link where you can request to work on a new design, create a pull request with your source code, and earn a Hacktoberfest-accepted tag
{% embed https://github.com/lmas3009/design2code2live/issues/216 %}


We encourage all levels of developers who are willing to code and get into live websites.


We expect more developers to work on design2code2live.

Join the discord: https://discord.gg/C3PAvsmrKV to get any updates on the repository.

Thanks
How Do You Navigate the 'Valley of Disappointment?
Tags: discuss, codenewbie, beginner
Published: 2023-10-14 00:00:00

---
published_at : 2023-10-14 00:00 +0000
---
Experieced devs, can you help us out? What are the common challenges faced by new programmers when trying to establish coding habits, and how can they overcome the "valley of disappointment"?

Follow the [CodeNewbie Org](https://dev.to/codenewbieteam) and [#codenewbie](https://dev.to/t/codenewbie) for more discussions and online camaraderie!

*{% embed* https://dev.to/codenewbieteam *%}*
What's A Life Lesson You Wish You'd Learned Sooner?
Tags: discuss
Published: 2023-10-14 00:00:00

---
published_at : 2023-10-14 00:00 +0000
---
Reflect on a lesson from your life experiences that you believe would have been valuable to learn earlier.

Follow the DEVteam for more discussions and online camaraderie!

{% embed [https://dev.to/devteam](https://dev.to/devteam) %}
Refactoring Code: A Journey Towards Clean and Maintainable Design
Published: 2023-10-13 23:42:01

## Introduction
In the world of coding, making our programs easy to understand and work on is really important. It's like organizing your room - it's much easier to find things when everything is in its place. In this story, I want to tell you about how I took a messy Python script and turned it into something clean and easy to work with. I'll explain what I did step by step and share what I learned along the way.

## The Starting Point
At first, our Python script, called txtToWeb, worked fine, but it was messy. It was like having all your clothes in a big pile - you can find what you need, but it takes a lot of time and effort. Our script had some problems: it was hard to understand, and it had some repeating parts that we could make simpler.

## First Commit : Extract parse_config() function
Our script had a part that dealt with settings like language and styles. I took that part out and put it into its own 'helper' function called parse_config(). Think of it like having a separate box just for your accessories. This way, the main part of our script became much cleaner.

## Second Commit : Extract write_html file() function
Our script also had a tricky part where it made HTML web pages. I made a new function, write_html_file(), just for that. It's like having a recipe card for your favorite dish. This made our main script much easier to read and understand.

## Third Commit : Splitting the code in smaller parts
The biggest change was breaking our main script into smaller pieces. I split the big script into smaller files, each doing a specific job like handling files, converting text, or making HTML. This made our code like a well-organized library.

## What I learned new: Git Rebase
During this journey, I discovered a powerful tool in Git - git rebase. It's like having a magic wand for your version control. I used the `git rebase main -i` command to merge my three commits into one. It allowed me to clean up my commit history, making it more organized and clear. I also used `git commit --amend` to edit my commit messages, ensuring they were easy to understand and explained my changes accurately.

Link to rebased and amended commit - [cadb93b](https://github.com/Rachit1313/txtToWeb/commit/cadb93bc648fec68cfed305e7873992f2b93eb1d)

## Conclusion:
In the end, our script transformed from a messy pile into neatly organized parts. Remember, making code better is a marathon, not a race. As we make these improvements, we become better coders, and our programs become even more awesome.