teleren/devto huggingface dataset:
Discover How Drip Protocol efficiently tested their entire application with BuildBear’s Engine.
Tags: dapp, defi, testnet
Published: 2023-09-28 05:31:40

What is Drip Protocol ?

Drip Network, the world’s leading daily Return On Investment (ROI) platform that has been paying out 1% daily in Drip to its investors since April 2021. Drip Network is a decentralized finance ecosystem that generates daily passive income.

About Sascha Maraj: Sascha Maraj is a Data Engineer and a web3 whitehat, helping to build Secure web3 protocols.

**Challenges faced by Sascha (Drip team):**

No Explorer! It is difficult to debug failed transactions The lack of an explorer to observe local Hardhat node transitions in detail made it challenging to troubleshoot issues when transactions fail.

Tokens! Wall guarded The task of Accumulating enough Testnet tokens for comprehensive smart contract testing has proven to be quite time-consuming.

Faster Simulation Engine! We had to process tons of test transactions and for that purpose we needed something very fast. While at some level Hardhat’s Engine and Anvil were good, as our growth rose our demand for a faster simulation engine grew. This was only met due to the specific engine that we got from BuildBear’s team.

Integration with BuildBear: Sascha and his team integrated BuildBear into their workflow in order to address these challenges, seeking a solution.

**Key Features Leveraged:**

Sascha recognized several essential functionalities offered by BuildBear that have greatly contributed to his Auditing process:

BuildBear Faucet: By utilizing the BuildBear Faucet, Sascha instantly accessed an abundant reserve of Native and Popular ERC20 Testnet tokens, eliminating the need for manual token accumulation and leading to substantial time savings.

Explorer: The BuildBear explorer provided Sascha with a user-friendly interface to effortlessly view all transaction data and effectively debug any failed transactions. Additionally, it enabled Sascha to interact with contracts directly through the explorer.

ASAP Engine: For eg, at one point in time, we wanted to mine a million blocks and we wanted to get it done under 1 sec; while Hardhat could deliver that, it was not literally mining blocks, at the same time, Anvil was taking 3 seconds per block (mocking the behaviour of the BSC fork that we needed); that is where BuildBear’s engine did a fabulous job of literally mining 1 million blocks in less than 1 sec.

**Impact of Using BuildBear in their own words:**
“Having a GUI faucet and explorer is really valuable when testing contracts, it makes it so much easier to run tests and see the results. The BuildBear explorer made it trivial for us to isolate the root cause of the failing tests. The faucet is nice as well so that any user testing could get assets on their own, without having to ask us to provide test assets.”

Are you an Dapp developer? What are you waiting for? Utilize BuildBear to accelerate your building / development process.

Spend your valuable time building your product while we take care of the rest.
Demystifying Node.js Module Paths: The Importance of the "./" Prefix
Published: 2023-09-28 05:19:39

Node.js, a powerful server-side JavaScript runtime, excels in modularization. It allows developers to break down their applications into smaller, manageable pieces called modules. These modules can be either built-in, like 'fs' for file system operations, or user-created, residing in custom folders. When it comes to importing these modules, understanding the significance of the `./` prefix is vital.

## The Basics of `require()`

In Node.js, `require()` is the primary method for including modules. It searches for modules in specific directories, mainly `node_modules`, and ensures efficient code reuse.

- **Core Modules:** These are built-in modules, accessed by simply stating the module name in `require()`. For example, `require('fs')` imports the file system module.

- **User-Defined Modules:** To import modules you've created within your project, you need to specify the path.

## Relative Paths with `require()`

Relative paths are vital when you want to import a module or file relative to the current file's location. The `./` prefix is a key part of this process.

- **`./` Indicates the Current Directory:** The `./` prefix signifies that the module is located in the current directory.

- **`../` Indicates the Parent Directory:** Conversely, using `../` indicates that the module is located in the parent directory.

## Practical Application

Imagine a simple project structure like this:

```plaintext
project-root
|__ server.js
|__ routes
    |__ index.js
```

Suppose you want to import the `index.js` module into your `server.js` file. You would use the following:

```javascript
const indexRouter = require('./routes/index');
```

By using `./`, Node.js looks for the module in the current directory, specifically the `routes` folder.

Without the `./` prefix:

```javascript
const indexRouter = require('routes/index');
```

Node.js would look for `routes` as a built-in module or in `node_modules`. However, since it's a custom module in the project directory, this would result in an error.

## Conclusion

Understanding how to specify module paths is fundamental in Node.js development. The `./` prefix enables precise module location specification relative to your current file. This approach ensures an efficient and organized code structure, facilitating seamless module importing and enhancing code reusability.

As you continue your journey in web development and deepen your understanding of Node.js, mastering module paths will be a valuable skill.

Happy coding!
You don't know TDD... yet
Tags: testing, programming, tdd, development
Published: 2023-09-28 05:14:25

Test-driven development (TDD) has been a cornerstone of software engineering for years, yet its core principles are often misunderstood or misapplied. This article aims to shed light on these overlooked aspects, elevating your understanding of TDD regardless of your experience level. While the title may come across as provocative, it’s inspired by Kyle Simpson’s seminal book series, ‘You Don’t Know JS Yet.’ The goal here is not to question your expertise, but to challenge conventional wisdom and enrich your perspective on TDD.

As a Software Engineer and Consultant with 23+ years of experience, I’ve been fortunate to guide engineering teams toward high performance. One commonality I’ve noticed is how TDD is frequently both praised and criticized, sometimes for the wrong reasons. The discourse tends to focus on surface-level practices, leaving the deeper, more meaningful aspects of TDD unexplored. This article won’t serve as an introductory guide to TDD or delve into its origins. Instead, it aims to expose and clarify the misconceptions and lesser-known facets that could make or break your experience with TDD.

By examining these misconceptions and the rationale behind them, this piece will help you avoid pitfalls that even seasoned engineers sometimes fall into. We’ll go beyond the basic “red-green-refactor” cycle and discuss what often gets overlooked: the discipline, the commitment, and the philosophical underpinnings that make TDD a compelling practice for teams striving for excellence. Whether you’re a beginner seeking clarity or an expert looking to refine your understanding, this article will offer valuable insights to enhance your TDD practice.


##Common Misconceptions about TDD

Before diving into the nitty-gritty, it’s important to clarify that misconceptions about TDD are not exclusive to newcomers. Even seasoned professionals can fall into certain traps. The following list identifies some of the most prevalent misunderstandings that I’ve observed across a range of engineering teams.

- Over indexing on Writing Tests First
- Not having a test list to determine what tests to write, ordered by simplicity
- Using versioning (git) against the principles of working software
- Not knowing when to stop
- Thinking Test Driven Development is about quality when in fact it’s about design
- Believing TDD is for backend only and does not apply to frontend

By examining and addressing these common misconceptions, we can develop a more informed and effective approach to TDD. Knowledge is power, and understanding where you might go astray can help you fully harness the benefits of this methodology.

Full article: https://medium.com/@wgcorrea/you-dont-know-test-driven-development-yet-e0787273db6c
Hack 4g viettel với 4gspeed
Published: 2023-09-28 05:07:19

[4gspeed](https://4gspeed.me) - Nền tảng hack 4g tốc độ cao hàng đầu chắc hẳn ai cũng nghe qua rồi, hôm nay mình sẽ hướng dẫn các bạn hack 4g tại 4gspeed
Hướng dẫn [hack 4G Viettel mới nhất 2023](https://4gspeed.me)

Thay vì bỏ tiền ra mua [gói cước 4G Viettel](https://4gspeed.me) để truy cập mạng tốc độ cao thì bạn hãy nắm ngay cách hack băng thông Viettel. Đang được nhiều người dùng chia sẻ khắp mọi diễn đàn, web, mạng xã hội. Bạn có muốn thực hiện cách hack đơn giản nhất để có data dùng hoặc được dùng internet không tốn phí không? Cùng 4gspee tìm hiểu chi tiết ngay bên dưới và chọn cách hack đơn giản nhất thực hiện nhé!
Hack 4g Viettel là gì?

Hack băng thông Viettel (hay còn gọi là hack data Viettel) là thao tác mà bạn sẽ sử dụng thủ thuật để hack hệ thống nhà mạng tìm lỗ hổng và có được data miễn phí dùng hoặc không giới hạn. Khi hack data bạn sẽ không mất bất kỳ chi phí nào cho việc đăng ký 4G của Viettel.
Bây giờ chúng ta cùng bắt đầu nhé
Bước 1 : tải app clash android
Đầu tiên. Bạn hãy truy cập vào CHPLAY trên điện thoại và tìm kiếm ứng dụng Clash For Android <- Nhấp vào để truy cập tải nhanh
 

Bước 2 : đăng ký tài khoản

 

Đăng ký tài khoản tại [4GSPEED](https://4gspeed.me) <-- click vào đây

Chọn gói đăng ký tại 4GSPEED
Thay đổi SNI phù hợp với nền bằng cách sau
 

Xem thêm về cách đổi sni tại https://docs.4gspeed.me
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b8235q4azjb2zebrehke.png)
Parallels and MSSQL Server
Tags: macmini, m2, programming, sql
Published: 2023-09-28 04:48:38

I recently purchased a Mac-Mini-M2 (Base Model), it was awesome and fast enough to kill my Windows 11 Laptop , :). Since I am supposed to develop Mac and Windows, also looking for a VM which utilise the power of M2 Silicon. 

## Development setup on Parallels

Firstly I installed Microsoft Visual Studio ,and it work better than ** ASUS Laptop with 8 GB Intel Core i5**

Also need a Microsoft SQL Server for backend needs and I started the install the setup, it just went with errors. 

## Docker
The second option for me is Docker on the Parallel. I tried and it succesfulluy installed. But the engine doesn't work for me. I google it, since it is container it is not possible.  

## Docker Solution

Docker container on Mac OS - That will be work right. Note that Some of the Docker Images (most) were built for Intel M1 chip. In such cases need to install Rosetta first, which help the transition of Intel to silicone.

`softwareupdate--install--rosetta`

## How do I connect Mac Docker to Parallel Visual Studio ? 

We can simply use the Mac IP with container exposed port as bellow. Go to Network click the Network option to get the IP.

```

 <add name="Dolphin_Accounts.Properties.Settings.sql_connection" connectionString="Data Source=192.168.20.101,1433;Password=mssql1Ipw;User Id=sa;Initial Catalog=dolphinedb;Integrated Security=False" />
```

## The Docker Compose iml 

`version: '3.9'

services:
  mssql-azur-edge2:
    image: mcr.microsoft.com/azure-sql-edge
    platform: linux/arm64
    ports:
      - 1433:1433   
    volumes:
      - ~/apps/mssql/data:/var/lib/mssqlql/data
    environment:
      - ACCEPT_EULA=Y
      - SA_PASSWORD=mssql1Ipw

From the terminal run `docker-compose up -d` and also make sure it is running by issuing the `docker-compose ps` command.

[More post on M2,Docker and Mac-Mini-M2 setup  ](http://devmnj.wordpress.com)
What proxy login
Tags: beginners, react
Published: 2023-09-28 04:40:38

**What is Proxy Login?**
Proxy Login is also known as proxy authentication.
This is a mechanism that allow one user to log into a system  or application on the behalf of another user.

**Users of proxy Login**

**Delegated Access:** It allows one user or system component to delegate specific permissions or access rights to another user or component. For example, a system administrator may temporarily act on behalf of a regular user to troubleshoot an issue.

**Authentication and Authorization:** Proxy login is used in situations where one entity (the proxy) needs to access resources or perform actions on behalf of another entity. The proxy must authenticate itself and obtain the necessary permissions to act as the other entity.

**User Impersonation:** In some systems, especially for troubleshooting or support, administrators can temporarily assume the identity of another user to see the system from their perspective, troubleshoot issues, or provide assistance.

**Multi-Tenancy:** In multi-tenant applications or services, proxy login can be used to allow an administrator to access the data or settings of a specific tenant without knowing their password.
Converting ".ipynb" Files to Other File Format
Tags: python, jupyter, beginners, markdown
Published: 2023-09-28 04:27:58

I love using Jupyter Notebook especially when I'm learning something new with Python. Aside from using it with Pandas, it allows me to quickly document my learnings, whereas I can take notes and write and run codes in the same file. There are times I publish these notes into blogs, so I have to convert these `.ipynb` files into `.md` files, and it is a real hassle to transfer them into another file line-by-line. So, I got curious and searched for a Python module for converting `.ipynb` files into other file types, and lucky there is a module for this job. It is called `nbconvert` module and if you don't know about this yet, here's a quick guide to using it.


## Install Jupyter nbconvert (if you haven't already):
You can install `nbconvert` using `pip`:
```bash
pip install nbconvert
```

## Convert .ipynb to .md:
You can convert a `.ipynb` file to `.md` using the following command in your terminal or command prompt:
```bash
jupyter nbconvert --to markdown your_notebook.ipynb
```
Replace `your_notebook.ipynb` with the actual name of your Jupyter Notebook file. This command will create a Markdown file with the same name as your notebook but with the `.md` extension.

## Converting to other formats:
The `nbconvert` library supports converting Jupyter Notebooks to various formats, including HTML, PDF, LaTeX, and more. To convert to a different format, replace `--to markdown` with the format of your choice. For example:

HTML: `--to html`
PDF: `--to pdf`
LaTeX: `--to latex`
You can specify the output file name using the `--output` option, followed by the desired file name and extension.

Here's an example command to convert a `.ipynb` file to HTML:
```bash
jupyter nbconvert --to html your_notebook.ipynb
```

These commands will generate the respective output files in the same directory as your Jupyter Notebook. And that's how you can easily convert a `.ipynb` file into another file format.
MyNextDeveloper - Excellence with empathy
Tags: contractors, community, engineering
Published: 2023-09-28 03:11:49

MyNextDeveloper (MND) aims to be an incubator for a community of the top 3% of pre-vetted, highly skilled & independent software engineers and contracts them to international startups. We are solving the problem of trust among startups by focusing on human qualities like empathy, trustworthiness, and communication.

[https://mynextdeveloper.com](https://mynextdeveloper.com)
WebSocket with Node.js and React using TypeScript (1) - Set up HTTP server and check the server running status
Tags: http, node, typescript, webdev
Published: 2023-09-28 03:11:42

[full codes](https://github.com/yujhenchen/real-time-weather-mood-node/blob/develop/index.ts)

## Read the port number from the environment variable file

Use dotenv
```
import dotenv from 'dotenv';

dotenv.config();
const port = process.env.PORT;`
```

## Create a HTTP server and listen to the given port
```
...

import * as http from 'http';

...

const server = http.createServer();
server.listen(port, () => {
    console.log('Server started');
});
```
<br>

## Check the server running status
Pass a function `(request, response) => { // do something }` into `createServer` as the request handler. When the http server receives a HTTP request, the request handler will handle it. 

<br>

For example, set the response header (status code 200 and the response type), send a text as a response to the client, and then end the response object (which is a `WritableStream`):

```
...

const server = http.createServer((req, res) => {
    res.writeHead(200, { 'Content-Type': 'text/plain' });
    res.end('Hello!\n');
});

...
```

Open a browser to test

![Server is running on localhost](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gsh5pd3hu6nvl57ilpkq.png)




## Reference

1. https://blog.logrocket.com/websocket-tutorial-real-time-node-react/#use-websockets-node-js-react
2. https://dhruv-saksena.medium.com/websocket-development-with-typescript-from-scratch-782436d3e3be
3. https://stackabuse.com/how-to-start-a-node-server-examples-with-the-most-popular-frameworks/
4. https://nodejs.org/en/docs/guides/anatomy-of-an-http-transaction
Create a timer in React with Start, Pause and Reset feature
Tags: timer, react, javascript, programming
Published: 2023-09-28 03:03:48

Hello guys, i came across this task during my interview with a great company so i thought to share it with you all. The task is to create a countdown timer in **React** with _Start_, _Pause_ and _Reset_ features, so let's start building it -

```
// Import the useState hook from React for managing state
import { useState } from "react";

// Import the CSS file for styling
import "./styles.css";

// Define the main App component
export default function App() {
  // Initialize state variables for timer and timeInterval
  const [timer, setTimer] = useState(0);
  const [timeInterval, setTimeInterval] = useState(null);

  // Function to start the timer
  const startTimer = () => {
    // Use setInterval to update the timer every 1000 milliseconds (1 second)
    setTimeInterval(setInterval(() => {
      // Update the timer by incrementing the previous value by 1
      setTimer((prev) => prev + 1);
    }, 1000));
  }

  // Function to pause the timer
  const pauseTimer = () => {
    // Clear the interval to stop the timer from updating
    clearInterval(timeInterval);
  }

  // Function to reset the timer
  const resetTimer = () => {
    // Reset the timer value to 0
    setTimer(0);
    // Clear the interval to stop the timer
    clearInterval(timeInterval);
  }

  // Render the timer and buttons in the component
  return (
    <div className="App">
      <h3>Timer: {timer}</h3>
      <div className="btn-wrapper">
        {/* Button to start the timer */}
        <button onClick={startTimer}>Start</button>
        {/* Button to pause the timer */}
        <button onClick={pauseTimer}>Pause</button>
        {/* Button to reset the timer */}
        <button onClick={resetTimer}>Reset</button>
      </div>
    </div>
  );
}
```
 
This is the complete code, i hope you found it informative and you can extend it to next level by setting a timer and decreasing it until **0**. See you soon in the next post 😊
🎙️ 6 Podcasts Nacionais Para Você Se Atualizar Em Tecnologia
Tags: braziliandevs, podcast, techtalks, programming
Published: 2023-09-28 03:00:38

Desde que comecei a estudar tecnologia, fiz questão de buscar conhecer sobre a área, para ficar o mais imersa possível em todo o universo. Eu precisava (preciso) correr atrás pra conhecer o máximo que eu podia. 

![Homem correndo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/klmo7qjxous5uqw735wx.gif)

Ouvir sobre a carreira dos mais experientes, as dificuldades que a maioria passa, as dores dos profissionais, me fez ter uma noção muito maior do que eu poderia ter naquele curto espaço de tempo que eu tinha, em vez de esperar para ter essa percepção apenas com a experiência.

Por isso, sempre busquei, das formas que podia, ouvir os mais experientes, seja lendo artigos, participando de lives, consumindo vídeos, e também podcasts.


![Homem falando que estava fazendo anotações](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lodhmdvs2e23lw0urkw4.gif)

E é justamente isso que trago hoje. Alguns podcasts que me ajudaram - e ajudam - a conhecer mais sobre o mundo da tecnologia.

🎙️ **Hipsters Ponto Tech** 
https://www.hipsters.tech/

🎙️**Mulheres de Produto**
https://mulheresdeproduto.com/podcast

🎙️ **Olá, Gabs**
https://www.gabsferreira.com.br/podcast

🎙️ **DevShow**
https://devshow.com.br/

🎙️ **DevNaEstrada**
https://devnaestrada.com.br/

🎙️ **Papo de UX**
https://podcasters.spotify.com/pod/show/papo-de-ux

---

Vamos nos Conectar? Fique à vontade para me seguir nas minhas [Redes](https://giselletech.vercel.app/). :)
Automatically Adding a Jira Ticket ID to a Github Commit
Tags: github, jira, scripts
Published: 2023-09-28 02:38:55

---
title: "Automatically Adding a Jira Ticket ID to a Github Commit"
published: true
description: "A Github hook to automatically add the ID of a Jira ticket to the commit message."
cover_image: "https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9io07h04fejv4bro4g37.png"
tags:
    - github
    - jira
    - scripts

---

We use Jira at work to track tasks. So, anytime you make changes to code,
the commit message usually includes the ticket ID in the message.

It goes something like [this](https://whatthecommit.com/f7975e36c8b5b0c1db6d4c302cd26bf3):

```
[ISSUE-123] I understand that it's an antipattern, but it's convenient.
```

This is useful when you're looking at a busy repository and going through
the history to find a specific commit.
 

Of course, you can add this manually every time you commit. Or you can add
this tiny script as a Github pre-commit hook so that it's automatically
added.

```bash
#!/bin/bash

# This way you can customize which branches should be skipped when
# prepending commit message.
if [ -z "$BRANCHES_TO_SKIP" ]; then
  BRANCHES_TO_SKIP=(master)
fi

BRANCH_NAME=$(git symbolic-ref --short HEAD)

ISSUE_NUMBER=$(printf "${BRANCH_NAME}" | sed -n
's/.*\(ISSUE-[0-9]*\).*$/\1/p')
ISSUE_NUMBER="${ISSUE_NUMBER##*/}" # Strip out everything except ID

BRANCH_EXCLUDED=$(printf "%s\n" "${BRANCHES_TO_SKIP[@]}" | grep -c
"^$BRANCH_NAME$")
ISSUE_NUMBER_IN_COMMIT=$(grep -c "\[$ISSUE_NUMBER\]" $1)

if [ -n "$BRANCH_NAME" ] && ! [[ $BRANCH_EXCLUDED -eq 1 ]] && ! [[
$ISSUE_NUMBER_IN_COMMIT -ge 1 ]]; then
  sed -i.bak -e "1s/^/[$ISSUE_NUMBER] /" $1
fi
```

To use this script:

1. Navigate to your `<repository>/.git/hooks/`
2. Create a file named `prepare-commit-msg` and put the script inside it
3. Make it executable by running `chmod +x prepare-commit-msg`

Now, you might have noticed that the regex specifically looks for the word
`ISSUE` in the branch name. That's because it's the project code that we
work with. You can simply adjust it to match the naming scheme of your
project.

I'm not any good at scripting so I just cobbled this together using chatGPT. There are [plenty](https://stackoverflow.com/questions/48170832/pre-commit-hook-to-check-for-jira-issue-key) [of] (https://gist.github.com/projectpwr/0805d381898053dd397c204da144290b) [options](https://gist.github.com/robatron/01b9a1061e1e8b35d270) that will let you automate this. Find one that fits your workflow and go nuts!