teleren/devto huggingface dataset:
Boost Team Efficiency with Smaller PRs
Tags: engineering, productivity, devops, cicd
Published: 2024-07-02 22:37:28

Ever felt overwhelmed by massive Pull Requests (PRs) that drag on for days, or even weeks? John Kline from Riot Games has the answers you’ve been looking for. In a recent [DevLogue episode](https://www.youtube.com/watch?v=CVMbUcBRk4c), John dished out game-changing insights on how reducing PR size can supercharge your team's performance.

## Slice and Dice: Breaking Down the Work

The first step to conquering PR bloat is breaking down work into bite-sized chunks. Forget those monstrous, long-lived PRs. Instead, aim for short-lived PRs that deliver small, incremental changes daily. This not only makes reviews a breeze but also minimizes risk and integration issues.

**Two Scenarios to Ponder:**

- **Case A**: Developers slice their tasks into smaller, daily PRs, resulting in manageable reviews, seamless integration, and a significant performance boost.
- **Case B**: Developers slog through extensive PRs, each taking days or weeks, leading to complex, hard-to-review changes.

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

## Daily Pushes & Feature Flags: Your New Best Friends

One behavioral tweak can change everything: push changes daily or almost daily. Embrace feature flags and branch by abstraction to push non-working code safely without disrupting the main branch. Riot Games is on this journey, aiming to build pipeline trust and foster a culture of incremental changes.

## Single Source of Truth: Keep It Simple

Long-lived branches with hefty changes? Recipe for disaster. They create multiple sources of truth, complicating integration and wreaking havoc on code reliability. Stick to small, frequent PRs merging into the main branch to maintain a consistent and reliable codebase.

## Empower Your Developers: Tools and Training

Reducing PR size isn’t just about changing habits; it's about empowering your team with the right tools and knowledge. Concepts like branch by abstraction and feature flags might seem counterintuitive at first, but they are crucial. Invest in top-notch tools and comprehensive training to smooth the transition.

## The Bottom Line

Transforming your PR strategy with behavioral changes, smart planning, and the right tools can drastically enhance your team’s velocity and reliability. Start small, think big, and watch your performance soar.

Catch the full podcast episode [here](https://www.youtube.com/watch?v=CVMbUcBRk4c) for John Kline’s in-depth insights on reducing PR size and its myriad benefits.

{% embed https://www.youtube.com/watch?v=CVMbUcBRk4c %}

What are your experiences with PR sizes? Share your thoughts in the comments below!

And don’t forget, [DevInsight.ai](https://www.devinsight.ai/) is here to elevate your engineering intelligence. Try it out for free and revolutionize your team’s workflow.
Day 983 : Weary
Tags: hiphop, code, coding, lifelongdev
Published: 2024-07-02 22:18:40

_liner notes_:
- Professional : Had a couple of meetings. I responded to a couple of community questions. I created a sample application to test a new feature and got it working. Asked the team some questions about what I found while building the application. Day went by pretty quickly.

- Personal : Last night, I went through Bandcamp and picked out what I'll buy this week. Went through some tracks. I actually worked on the logo and got to a good point. I think I just need to add some text and should be good. I watched an episode of "Demon Slayer" and went to sleep.

![A photo of a mountain range with a beautiful sunset in the background. The mountains are rocky and jagged with some green grass and flowers growing on them. The sun is setting behind the mountains and is casting a golden light on the scene.
Location: Caucasian Mountains.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8je4rzj86afjnldq5zyi.jpg)

My Chromebook just restarted while I was about to publish this blog post. Not everything was save. I'm tired and weary. So I'm just wrapping this up. Going to eat dinner, work on my logo, put together social media posts for my Bandcamp picks and watch an episode of "Demon Slayer".

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube GHuOdcmQqVA %}
RETRIEVING LOST OR STOLEN BITCOIN // DIGITAL TECH GUARD RECOVERY
Tags: recovery
Published: 2024-07-02 22:17:37

When a trusted family friend turned against me, I felt completely devastated. This individual accessed my laptop and stole my cryptocurrency wallet, containing $120,000 worth of Bitcoin, which represented years of savings and investments. The sense of loss and violation was overwhelming. Upon a close friend's suggestion, I contacted  DIGITAL TECH GUARD RECOVERY  . From the moment I reached out, their team provided exceptional support and assurance. They listened to my story with empathy and assured me they had the expertise to help recover my funds.  DIGITAL TECH GUARD RECOVERY  team began a thorough investigation. They meticulously traced the unauthorized access and identified the methods used to steal my Bitcoin. Their technical prowess was evident as they navigated through the complex web of digital transactions. In a matter of weeks, they successfully recovered my $120,000 worth of Bitcoin. Their ability to restore my financial stability was nothing short of miraculous. They also offered guidance on securing my digital assets against future breaches, ensuring I was better protected moving forward.  DIGITAL TECH GUARD RECOVERY  dedication and expertise turned my despair into hope. Their unwavering support and professional excellence provided a lifeline in my darkest hour. I highly recommend their services to anyone who has faced similar betrayals. They are true guardians of digital security and trust. Throughout the recovery process,  DIGITAL TECH GUARD RECOVERY   exhibited a level of professionalism and empathy that exceeded my expectations. They didn't just see me as a client with a problem; they understood the emotional toll that such a betrayal can take. Their willingness to listen and provide support went above and beyond, making me feel valued and understood throughout the entire ordeal. Furthermore, their technical proficiency was truly remarkable. They left no stone unturned in their investigation, meticulously dissecting every aspect of the breach to ensure a successful recovery. Their attention to detail and expertise in navigating the complexities of digital transactions were evident every step of the way. Beyond recovering my funds,  DIGITAL TECH GUARD RECOVERY   also provided invaluable guidance on enhancing my digital security. They educated me on best practices for safeguarding my assets and offered practical solutions for fortifying my defenses against future threats. Their proactive approach to security gave me peace of mind knowing that I was better equipped to protect myself in the future. In conclusion, I cannot recommend  DIGITAL TECH GUARD RECOVERY   highly enough. Their professionalism, empathy, and technical expertise set them apart as true leaders in their field. If you find yourself in a similar situation, don't hesitate to reach out to them. They are more than just a recovery service; they are a beacon of hope in times of darkness. Reach out to DIGITAL TECH GUARD RECOVERY via email: contact@ digitaltechguard .com and their website page link  https:// digitaltechguard. com
[Game of Purpose] Day 45 - HUD
Tags: gamedev
Published: 2024-07-02 21:49:19

Today I added HUD. The first version includes engine status. It properly reacts to its change.


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

{% embed https://youtu.be/B05i21UdWA4 %}
A new react dev slack group
Tags: community, react, nextjs, reactnative
Published: 2024-07-02 21:40:32

Hi all!

We just launched our slack group focused on react but mainly frontend development. We want to build a community of frontends devs (and all devs) that is welcoming and supportive for one another. So whether you’re just interested in frontend development or you’ve been doing it for years join us!

https://join.slack.com/t/react-devs-world/shared_invite/zt-2lpxa7tie-wkl7sBhANirRaKYciVcLsg
Install Module in Powershell without Install-Module
Tags: powershell, help, windows, installmodul
Published: 2024-07-02 21:26:27

## The term ‘Install-Module’ is not recognized as the name of a cmdlet.

Have you ever found yourself in trouble because your Powershell is not working anymore after a colleague told you to just delete every module of Windows Powershell? No problem… you can just use Install-Module to reinstall everything. Oops… Install-Module is part of the module you just deleted. Here is the guide on how to escape this chicken and egg problem.

![Chicken - Egg - Problem](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/meffvuoks88cjikxrdmb.jpg)

***

## How to restore Install-Module manually

To restore functionality, you need two modules. _PowerShellGet_ and its dependency _PackageManagement_. You can get them from the [Powershell Gallery](https://www.powershellgallery.com/). Search for the modules and click on _‘Manual Download’_. There you will also find a helpful [description of how to install these Nuget packages manually](https://learn.microsoft.com/en-us/powershell/gallery/how-to/working-with-packages/manual-download?view=powershellget-3.x). Follow the instructions step by step. Only in step 5, you should first create a subfolder containing the version of the module. Restart your PowerShell and you can install all other modules now.

## Are you a developer and too lazy to do things manually?

Since you already use Powershell, why not just use Powershell?

{% embed https://gist.github.com/KinNeko-De/ca317f091b0dca9c4feb5ebbd0bc1f36.js %}

Finally, copy the two folders _PowerShellGet_ and _PackageManagement_ to your Powershell Module folder. You will get a warning that the files are marked as untrusted. If anyone finds a solution, please leave a comment.

## If you are simply smart and pragmatic

Use the Windows Recycle Bin to restore the PowerShellGet and PackageManagement modules.

***

Please also leave a comment if anyone else is experiencing the same problem. Together we are strong 💪♥️❤♥️

![Love for all](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nepjx9ua6o1vm1jqn1mp.jpg)
_Foto von <a href="https://unsplash.com/de/@timmarshall?utm_content=creditCopyText&utm_medium=referral&utm_source=unsplash">Tim Marshall</a> auf <a href="https://unsplash.com/de/fotos/hande-die-zusammen-mit-roter-herzfarbe-geformt-wurden-cAtzHUz7Z8g?utm_content=creditCopyText&utm_medium=referral&utm_source=unsplash">Unsplash</a>_
Urgent Appeal: Help Nabil's Family Rebuild Their Lives in Gaza
Tags: gaza, python, webdev, programming
Published: 2024-07-02 21:25:09

Hello, My Name is Nabil , Computer Engineer From Gaza , 33 year old , My family and I have been deeply affected by the recent war in Gaza. We are struggling to rebuild our lives and urgently need your support. 🏠💔 ▶ https://gofund.me/73675284

Any contribution, no matter how small, can make a huge difference. Please consider donating and sharing our story with others. 💖

Thank you from the bottom of my heart for your kindness and generosity. 🙏✨

Donate Link ▶ https://gofund.me/b7d52f2a
Finite-state machine example in JavaScript
Tags: javascript, patterns, example
Published: 2024-07-02 21:08:16

---
title: Finite-state machine example in JavaScript
published: true
description: Finite-state machine example in JavaScript 
tags: #javascript #patterns #example
cover_image: https://images.unsplash.com/photo-1574087631700-abf928509b80?q=80&w=1888&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D
# Use a ratio of 100:42 for best results.
# published_at: 2024-07-02 19:05 +0000
---

## What is Finite-state machine?

### Context
FSM refers to classes of automata

![Classes of automata: wiki](https://upload.wikimedia.org/wikipedia/commons/thumb/a/a2/Automata_theory.svg/450px-Automata_theory.svg.png)

**The finite state machine (FSM)** is a software design pattern where a given model transitions to other behavioral states through external input.

### Example using if else

Let's say we have a simple task where we check, for example, a traffic light and perform actions depending on the current state.

```js
function trafficLightAction(color) {
  if (color === 'green') {
    console.log('Go');
  } else if (color === 'yellow') {
    console.log('Slow down');
  } else if (color === 'red') {
    console.log('Stop');
  } else {
    console.log('Invalid color');
  }
}

// Function call examples
trafficLightAction('green');  // Return: Go
trafficLightAction('yellow'); // Return: Slow down
trafficLightAction('red');    // Return: Stop
trafficLightAction('blue');   // Return: Invalid color
```


### Example with using Finite-state machine (FSM)

Now let's implement the same functionality using a state machine. A state machine will be an object where each key (state) is associated with a specific action.

```js
const trafficLightFSM = {
  green: () => console.log('Go'),
  yellow: () => console.log('Slow down'),
  red: () => console.log('Stop'),
  invalid: () => console.log('Invalid color'),
};

function trafficLightActionFSM(color) {
  const action = trafficLightFSM[color] || trafficLightFSM['invalid'];
  action();
}

// Function call examples
trafficLightActionFSM('green');  // Return: Go
trafficLightActionFSM('yellow'); // Return: Slow down
trafficLightActionFSM('red');    // Return: Stop
trafficLightActionFSM('blue');   // Return: Invalid color
```

Now, our traffic light will works well.

Disclaimer:
Several levels of additional tests would not hurt here, and perhaps another programming language ;) 

![Traffic light](https://images.unsplash.com/photo-1584649525122-8d6895492a5d?q=80&w=2070&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D)
RESTful APIs
Tags: restapi, backend, api, javascript
Published: 2024-07-02 20:55:00

- *Topic*: "Building RESTful APIs with Node.js and Express"
- *Description*: How to design and build RESTful APIs using Node.js and Express.

#### Content:

#### 1. Introduction to RESTful APIs
- **What is REST**: Explain REST (Representational State Transfer) and its principles.
- **HTTP Methods**: Discuss common HTTP methods: GET, POST, PUT, DELETE, PATCH.

#### 2. Setting Up the Project
- **Project Initialization**:
    ```bash
    mkdir myapi
    cd myapi
    npm init -y
    npm install express body-parser
    ```
- **Project Structure**:
    ```
    myapi/
    ├── node_modules/
    ├── package.json
    ├── index.js
    ```

#### 3. Creating a Simple API
- **Basic Express Setup**:
    ```javascript
    const express = require('express');
    const bodyParser = require('body-parser');
    const app = express();
    const port = 3000;

    app.use(bodyParser.json());

    app.listen(port, () => {
      console.log(`API running at http://localhost:${port}`);
    });
    ```

#### 4. Defining Routes
- **Sample Routes**:
    ```javascript
    let books = [];

    app.get('/books', (req, res) => {
      res.json(books);
    });

    app.post('/books', (req, res) => {
      const book = req.body;
      books.push(book);
      res.status(201).json(book);
    });

    app.get('/books/:id', (req, res) => {
      const book = books.find(b => b.id === parseInt(req.params.id));
      if (book) {
        res.json(book);
      } else {
        res.status(404).send('Book not found');
      }
    });

    app.put('/books/:id', (req, res) => {
      const index = books.findIndex(b => b.id === parseInt(req.params.id));
      if (index !== -1) {
        books[index] = req.body;
        res.json(books[index]);
      } else {
        res.status(404).send('Book not found');
      }
    });

    app.delete('/books/:id', (req, res) => {
      books = books.filter(b => b.id !== parseInt(req.params.id));
      res.status(204).send();
    });
    ```

#### 5. Testing the API
- **Using Postman or Curl**: Demonstrate how to use Postman or Curl to test API endpoints.
- **Example Tests**:
    - GET /books
    - POST /books with JSON body `{"id": 1, "title": "1984", "author": "George Orwell"}`
    - GET /books/1
    - PUT /books/1 with JSON body `{"id": 1, "title": "Animal Farm", "author": "George Orwell"}`
    - DELETE /books/1
Why I'm Excited for the HNG Internship
Published: 2024-07-02 21:08:01

I'm Joel, a computer science student at Accra Technical University, Ghana. As an aspiring backend developer, I haven't encountered any significant backend problems yet. I'm eager to dive in and learn through hands-on experience, and the HNG Internship offers the perfect opportunity to do just that.

I am very excited about starting the https://hng.tech/internship. This opportunity will help me gain the technical skills I need and prepare me for a successful career in backend development. I’m looking forward to tackling real challenges, learning from experienced mentors, and contributing to meaningful projects.
Exploratory Testing: User Experience Improvements for Scrape Any Website
Tags: bug, scrapping, programming
Published: 2024-07-02 21:04:39

**Introduction:** Welcome to my detailed bug report for Scrape Any Website (SAW), version 1.1.15.0 for x86 architecture. In this post, I'll share the bugs and usability issues I encountered during my exploratory testing of this data extraction tool. This exercise is part of my ongoing efforts to improve web scraping tools and ensure they meet user needs effectively

**Application Name and Version:** Scrape Any Website, Version 1.1.15.0
**Test Environment:**
Device: Dell Latitude E7270
Operating System: Windows 11
SAW Version: 1.1.15.0

**Links to get the application**
Website - [SAW](https://scrapeanyweb.site/)
Windows Store - [Download Page](https://apps.microsoft.com/detail/9mzxn37vw0s2)

**Testing Methodology:**
A multifaceted testing approach was employed, focusing on:

**Functional Testing:** Evaluating core functionalities like website scraping, data extraction, and output formatting.
**Usability Testing:** Assessing the application's ease of use, intuitiveness of the interface, and overall user-friendliness.
**Performance Testing:** Observing general responsiveness and scraping speeds during exploration.
**Edge Case Testing:** Pushing the boundaries of expected use scenarios to uncover potential bugs or limitations.

**Findings:**

My testing efforts revealed several areas for improvement in SAW. A detailed report outlining these findings, including specific bug reports is available in the attached spreadsheet: Full Report Excel [Link](https://docs.google.com/spreadsheets/d/1vmXSYHIZO-Eepjt9ylzefQrsQVww0iTyJ0LIz5TcLYw/edit?usp=sharing)

**Conclusion:** The exploratory testing of Scrape Any Website revealed several bugs and usability issues. Addressing these issues will significantly improve the user experience and reliability of the application.
Creating Users and Groups on Linux with a Bash Script
Published: 2024-07-02 21:01:12

## Overview

This bash script automates the process of creating multiple users and groups on a Linux system. It's designed to streamline the onboarding process for new employees or system users. The script reads user information from an input file, creates users with their respective groups, sets random passwords, and logs all actions.

## Features

- Creates users and their personal groups
- Adds users to additional specified groups
- Generates random passwords for each user
- Logs all actions for auditing purposes
- Stores generated passwords securely
- Handles existing users and groups
- Provides detailed error checking and reporting

## Prerequisites

- Linux environment (tested on Ubuntu)
- Root or sudo access
- Bash shell

## Installation

1. Clone this repository `https://github.com/Seundavid18/HNG11-Stage-1-Task` or download the `create_users.sh` script.
2. Make the script executable:
   ```
   chmod +x create_users.sh
   ```

## Usage

1. Create an input file (e.g., `users.txt`) with the following format:
   ```
   username; group1,group2,group3
   ```
   Each line represents a user. The username and groups are separated by a semicolon (;). Multiple groups are separated by commas (,).

2. Run the script with root privileges:
   ```
   sudo ./create_users.sh users.txt
   ```
   Replace `users.txt` with the path to your input file.

## Input File sample

```
light; sudo,dev,www-data
idimma; sudo
mayowa; dev,www-data
```

- Each line represents a user
- Username and groups are separated by a semicolon (;)
- Multiple groups are separated by commas (,)
- Whitespace around separators is ignored

## Output

- Users are created with their home directories
- Each user is assigned to their specified groups
- Random passwords are generated for each user
- All actions are logged in `/var/log/user_management.log`
- Passwords are stored in `/var/secure/user_passwords.csv`

## Troubleshooting

- Ensure you have root privileges when running the script
- Check the log file at `/var/log/user_management.log` for detailed information about each action and any errors
- Verify that the input file is formatted correctly

## Conclusion

By automating user and group management with a Bash script, you can efficiently handle multiple users, ensure security through proper permissions and password management, and maintain an audit log of all actions. This script provides a solid foundation for user management in a Linux environment.

## HNG11 Interniship

Visit https://hng.tech/internship | https://hng.tech/hire for more information about HNG and it's internship opportunities.
A Product-Engineering Understanding
Tags: product, engineering, leadership
Published: 2024-07-02 20:48:34

The Correct Way To Write Javascript Is To Write Bad Javascript
As Such
Everyone is good at writing Javascript.

## Human Software

I've been in a lot of software houses, and an interesting reflection I make that that the engineering units tend to have a runtime like the software they write.

**The Runtimes of Note Are:**
Interpreted
Compiled
Javascript

Human Software Is The Humans' Software.

## Javascript Is A Shitshow

Javascript Is A Wild Ecosystem
Regarding Javascript Applications, The Written Software Varies Wildly From Software House To Software House.

JavaScript Is A Shitshow
Because Javascript Is The Language Of the Human User Interface
And Humans Are Shitshows

The Runtime Of Javascript Only Software Houses Is The Unfiltered Human Software Of The World.

Working Javascript Always Answers The Question "How Is It Possible For It To..." A Crafty Scripter Can Get It Done. If Future Readability Is Not A Concern, Crafty Scripts May Be The Call.

## Further Thoughts:
I Recommend Consistently Applying The Empathetic Product Story For Readability. Empathetic Product Story For Readability Technique States To Start With Perfect Product Definition. Given PPD, A Vocabulary Is Extracted.

Perfect Product Understanding Allows Owners (OwnerGroup1 and Owner Group 2) To Have Shared Context While Refering to The Unique Effect. The Software Written Under Empathetic Product Story For Readability Originates From Product Understanding And, Correctly Positioned, Flows To The Engineering And Other Organizational Units.

PPU Answers "How Is It Possible For Me To".

Given The Product Understanding, An Engineer, Rather Than A Scripter, Answers "How Is It Possible For An Owner To".