teleren/devto huggingface dataset:
Archiving Web Pages with wget and Wayback Machine: A Handy Guide
Tags: webarchive, wget, waybackmachine, webdev
Published: 2024-01-28 19:43:12

Introduction:
The Wayback Machine (web.archive.org) is a valuable resource for accessing archived versions of web pages. In this guide, we'll explore how to use the `wget` command to download content from the Wayback Machine, allowing you to preserve and explore historical snapshots of websites. Follow the example command and explanation below to get started.

Example Command:
```bash
wget --recursive --no-clobber --page-requisites --html-extension --convert-links --restrict-file-names=windows --no-parent https://web.archive.org/web/20231225142555/https://example.com/index.php
```

Explanation of Options:
- `--recursive`: Download recursively, ensuring that all linked resources are captured.
- `--no-clobber`: Skip downloading files that already exist, preventing redundancy.
- `--page-requisites`: Download necessary files for complete page rendering (images, stylesheets, etc.).
- `--html-extension`: Save HTML files with a `.html` extension for easy identification.
- `--convert-links`: Convert links to enable offline viewing by updating relative paths.
- `--restrict-file-names=windows`: Modify filenames to be compatible with Windows file naming conventions.
- `--no-parent`: Prevent ascending to the parent directory, keeping the downloaded content organized.

Usage Notes:
- **Replace URL**: Substitute the example URL in the command with the specific Wayback Machine URL you want to download.
- **Content Limitations**: Keep in mind that not all websites may be fully archived, and dynamic content might not be accurately captured.
- **Review Terms**: Adhere to the terms of service and usage policies of the Wayback Machine and the archived website.

Conclusion:
Using `wget` in conjunction with the Wayback Machine provides a practical way to archive and explore historical versions of web pages. This process ensures that you can access and analyze web content as it appeared at specific timestamps, offering insights into the evolution of websites over time.
Task-4
Published: 2024-01-28 19:38:34

Manual testing is a software testing process in which cases are executed manually without using any automated tool. All test cases executed by the tester manually according to the end users perspective. It ensures whether the application is working as mentioned in the requirement document or not. Test cases are planned and implemented to complete almost 100 percent of the software application. Test case reports are generated manually.
Drawbacks:
It uses a comparatively large number of human resources 
It is costly in the short run
It is very timing consuming
It does not cover all aspects of testing
Benefits:
If If you are using block box testing you don't need programming knowledge
It is easy for new testers to learn
The software end up 100 percent bug free
It's cost effective
Always learning together.
Tags: webdev, beginners, javascript
Published: 2024-01-28 19:10:48

Hi I'm Will. I've been messing with markup and script for years. Pretty much on my own though. I'm not part of a team of developers so I'm here to formulate what is missing when working alone - I want to be able to grow my knowledge even further in return for offering others what I already know well - to continue learning together. I joined to get answers to coding problems more quickly and in return offer my own experience in making websites responsive and how I achieve my aim of creating sites that are fully W3C valid, streamlined and device responsive. I look forward to sharing code ideas.
Task 3
Published: 2024-01-28 19:09:24

**Functional testing **:
* It verifies the operations and actions of the application
*It is based on the requirements of the customers
*it helps to enhance the behavior of the customers application
*Functional testing is easily to execute manually 
*It tests what the product does
*Functional testing is based on the business requirements
Examples:
Unit testing, Smoke testing, Integration testing, Regression testing

Non-functional testing:
*It verifies the behavior of the application
*It is based on the expectations of the customers
*It helps to improve the performance of the application
*It is hard to execute non-functional testing manually
*It describes hoe the product does
*non-functional testing is based on the performance requirement
Examples:
performance testing, load testing, stress testing, scalability testing
100 Tips from The Pragmatic Programmers Book: Part 4/10
Tags: career, thepragmaticprogrammer, books, programming
Published: 2024-01-28 18:30:00

#### 4.1. Failing Test Before Fixing Code.
> Create a focussed test that reveals the bug before you try fixing it.

&nbsp;
#### 4.2. Read the Damn Error Message.
> Most exceptions tell both what failed and where it failed. If you’re lucky you might even get parameter values.

&nbsp;
#### 4.3. “select” Isn't Broken.
> It is rare to find a bug in the OS or the compiler, or even a third-party product or library. The bug is most likely in the application.

&nbsp;
#### 4.4. Don’t Assume It—Prove It.
> Prove your assumptions in the actual environment—with real data and boundary conditions.

&nbsp;
#### 4.5. Learn a Text Manipulation Language.
> You spend a large part of each day working with text. Why not have the computer do some of it for you?

&nbsp;
#### 4.6. You Can’t Write Perfect Software.
> Software can’t be perfect. Protect your code and users from the inevitable errors.

&nbsp;
#### 4.7. Design with Contracts.
> Use contracts to document and verify that code does no more and no less than it claims to do.

&nbsp;
#### 4.8. Crash Early.
> A dead program normally does a lot less damage than a crippled one.

&nbsp;
#### 4.9. Use Assertions to Prevent the Impossible.
> If it can’t happen, use assertions to ensure that it won’t. Assertions validate your assumptions. Use them to protect your code from an uncertain world.

&nbsp;
#### 4.10. Finish What You Start.
> Where possible, the function or object that allocates a resource should be responsible for deallocating it.

&nbsp;
Thanks for reading, happy coding 😀
Technical Writer Interview Experience - Devtron
Tags: webdev, javascript, beginners, programming
Published: 2024-01-28 18:25:26

Hey folks, I hope you all doing amazing. This article is not about any technical stuff like JavaScript, Python, etc. This article focuses on my experience for the Technical writer position applied at @devtron_inc company. 

# How It Started ✨
It all started with a Twitter post containing information about hiring a tech writer role at Devtron. I started searching about what is Devtron and what are requirements of the role are. 
Then after doing all my research, I found that Devtron is a great opportunity for me to start with because Devtron is a tool or platform that helps you to set up and monitor all devops things.  
Like CI/CD pipeline, dockerization, K8s, etc. 
Want to explore Devtron? Here's the [platform link](https://devtron.ai/). 

<img width="100%" style="width:100%" src="https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExNTJwdHd5OTY1ODk0YXZ6b3RycjB2MDhrbXN6NmE5b2M2N2o1azd6MCZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/l2Je4CdnzGOkPESC4/giphy.gif">



# Interview Process 🎯
There are a total of four rounds there. 

### Round 1 - Telephonic Interview Call ✅
In this round, the HR manager will connect to you over the call to make sure you're good with communication and ask you about your previous work, introduction, roles, and responsibilities to work, and other introductory questions. 

### Round 2 - Writing Assessment ✅
In this round, you have to write and solve MCQs. This round consists of 45 grammar questions and correcting the paragraph sequence(Part 1) and (Second part)you have to write on two topics in 200 words each with 30 mins (15 mins each topic).

### Round 3 
After clearing both rounds there will be a technical round. A senior tech writer will be there to test your technical skills. This interview is 45 minutes long. The interviewer will ask you about 
1. Version Control System 
2. Why we need DevOps
3. DevOps tools if you know
4. Small task (not writing)
5. ABout the company (Make sure you have done all your research)
6. WHat you know about products 

These all are listed questions that the interviewer asked me while interviewing. Also, make sure you know the role requirements, research the Product, and your ideas to solve the problem. 

### Round 4 
This interview is the final with the founder of the company. They will ask you why Devtron, Goals, and personality-oriented questions as well as salary negotiations also done in this round. 

## Result 
I reached round number 3 (Technical Round) and was not selected for the role. 

### Advise 
1. First listen to the question carefully then answer. 
2. Aware of trends & tools of the market. 
3. Must Do company research.
4. Practice some Docker, VCS, and a bit about the product. 

You can apply for the role from here. 
[Devtron career](https://devtron.ai/careers)

Support my Youtube Channel👇
{% youtube https://youtu.be/qbwmXpvSwlQ?si=oXOa0EK_dgxsu_Je %}
Fully featured, modern and extensible editor
Tags: markdown, editor, typescript, javascript
Published: 2024-01-28 18:17:58

Hello, I recently made a React library for creating text editors. This library uses tiptap and comes with all the essential features. Moreover, you can extend its functionality with extensions and customize its styles.

## Installing
```bash
pnpm install eddies
```

## Usage
To start you only need few lines of code:
```tsx
"use client";
import { Editor } from "eddies";

export default function Page() {
  return (
    <div className="m-5">
      <Editor />
    </div>
  );
}
```

## Features
- Slash commands
When you type / in the editor, a menu will appear with all available commands. You can customize the commands by passing the slashMenuCommands prop to the editor.

- Syntax highligting
![Syntax higlighting preview](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n2sk9sqte828twwu50no.png)
In order to use syntax highlighting follow the guide in the [documentation](https://malezjaa.github.io/eddies/docs/extensions/code-highlighting.html)

- Character counter
- Themes 
- Formatting toolbar
- And many more!

You can try it here: https://eddies-web.vercel.app/
Github repo: https://github.com/malezjaa/eddies
Docs: https://malezjaa.github.io/eddies/
Using when with the Laravel Http Client
Tags: laravel, http, webdev
Published: 2024-03-04 20:42:05

---
title: Using when with the Laravel Http Client
published: true
date: 2024-01-28 18:00:07 UTC
tags: Laravel,Http,WebDev
canonical_url: https://www.csrhymes.com/2024/01/28/using-when-with-laravel-http-client.html
cover_image: https://www.csrhymes.com/img/laravel-http-when.jpg
---

Here’s a little tip I discovered that I haven’t seen documented anywhere. You can use when() and unless() with the Laravel Http client.

Here is an example method that uses the Laravel Http client.

```php
use Illuminate\Support\Facades\Http;

public function getUser(int $id): array
{
    $response = Http::baseUrl('https://example.com/api')
        ->get("user/{$id}")
        ->throw()
        ->json();

    return $response;
}
```

Now imagine that we wanted to pass a token in that is sent as a header.

```php
use Illuminate\Support\Facades\Http;

public function getUser(int $id, string $token): array
{
    $response = Http::baseUrl('https://example.com/api')
        ->withHeader('X-Token', $token)
        ->get("user/{$id}")
        ->throw()
        ->json();

    return $response;
}
```

The Http client makes this very easy by using the `->withHeader()` method.

But what happens if the token is optional for some calls? Some requests need it and others don’t?

Well, we could copy the whole method and duplicate all our code, or we could make use of `->when()`.

If you look into the PendingRequest class, you’ll see that it makes use of the `Illuminate\Support\Traits\Conditionable` trait. This trait gives it access to both when() and unless().

Here we set the token to be an optional parameter. When it is passed in, the when() resolves as true and then adds the closure.

```php
use Illuminate\Support\Facades\Http;
use Illuminate\Http\Client\PendingRequest;

public function getUser(int $id, ?string $token = null): array
{
    $response = Http::baseUrl('https://example.com/api')
        ->when($token, function (PendingRequest $request) {
            $request->withHeader('X-Token', $token);
        })
        ->get("user/{$id}")
        ->throw()
        ->json();

    return $response;
}
```

You can also set a default method if you need to which runs when the when() resolves to false. An example could be setting a default token in the header if one is not provided.

```php
use Illuminate\Support\Facades\Http;
use Illuminate\Http\Client\PendingRequest;

public function getUser(int $id, ?string $token = null): array
{
    $response = Http::baseUrl('https://example.com/api')
        ->when($token, function (PendingRequest $request) {
            $request->withHeader('X-Token', $token);
        }, function (PendingRequest $request) {
            $request->withHeader('X-Token', 'default-value');
        })
        ->get("user/{$id}")
        ->throw()
        ->json();

    return $response;
}
```

[Photo](https://stocksnap.io/photo/city-skyline-0SE0ZRMZCM) by [FOCA Stock](https://stocksnap.io/author/focastock) on [StockSnap](https://stocksnap.io)
Task-15
Published: 2024-01-28 17:56:20

[Q.no.1]

Difference between selenium IDE, selenium webdriver, and selenuim grid.

1)Selenium IDE:-

(i) Selenium IDE is for less-technical testers to create a visual. 

(ii) Selenium IDE offers simple installation and is easy to learn.

(iii) Selenium IDE is an open source test automation tool that can record and playback your actions on the web.

2)Selenium Web driver:-

(i) WebDriver should be used for more complex tests that need to loop, perform setup or interact with external systems.

(ii) WebDriver supports a wide range of browsers and provides more control over testing scenarios and browser configurations.

(iii) Selenium WebDriver is more powerful and flexible at a higher cost. 

3)Selenium grid:-

(i) Grid-like example of what they want to test.

(ii) Selenium Grid is designed to facilitate parallel and distributed testing across multiple machines and browsers simultaneously.

(iii) Selenium Grid is a smart proxy server that makes it easy to run tests in parallel on multiple machines.

[Q.no.2]

I made some collapse in eclipse to create package for this question, so i copy and paste the code.

package Task15;

import org.openqa.selenium.chrome.ChromeDriver;

public class Task15Q2 {

	public static void main(String[] args) {
		ChromeDriver driver = new ChromeDriver();
		
		//pass the url
		
		driver.get("https://www.google.com/");
		
		//Maximize the window
		
		driver.manage().window().maximize();
		
		//Close the browser
		
		driver.close();
		
		
	
	}

}

 
[Q.no.3]

Selenium:-

Selenium is an open-source suite of tools and libraries that is used for browser automation. Selenium us used to: It allows users to test their websites functionally on different browsers. Perform Cross browser testing to check if the website functions consistently across different browsers.

Selenium uses:-

1. Language and Framework Support.
2. Open Source Availability.
3. Multi-Browser Support.
4. Support Across Various Operating Systems.
5. Ease Of Implementation.
6. Reusability and Integrations.

[Q.no.4]

Web drivers used in selenium:-

The major implementation classes of WebDriver interface are 
1.AndroidDriver 
2.FirefoxDriver 
3.ChromeDriver
4.SafariDriver
5.OperaDriver
6.iPhoneDriver
7.HtmlUnit Driver
8.InternetExplorerDriver.

Each driver class corresponds to a browser. We simply create the object of the driver classes and work with them. It helps you to execute Selenium Scripts on Chrome browser.
The Magic of Time in Rails: Journey into the Past with time_ago_in_words
Tags: rails, ruby, date
Published: 2024-01-28 17:41:00

---
title: The Magic of Time in Rails: Journey into the Past with time_ago_in_words
published: true
description: Explanation rails method time_ago_in_words
tags: #rails #ruby #date
# cover_image: https://direct_url_to_image.jpg
## Use a ratio of 100:42 for best results.
published_at: 2024-01-28 17:41 +0000
---

Web development projects take on a life of their own, and so does time. In the world of Ruby on Rails there is a wonderful method that can give character to your time - time_ago_in_words. Let's embrace this magic and create dynamic, engaging experiences for your users.
Journey to the Past:

When your site posts get older than dinosaurs, regular timestamps turn into boring numbers. However, with time_ago_in_words you can offer your users more than just "2 minutes ago" or "yesterday".

How it works:

This method translates ordinary timestamps into magic phrases, providing dynamic descriptions of time, such as "A moment ago," "An hour ago," or even "Last month." Your interface becomes more alive, and users feel that your messages not only exist in space, but are themselves a part of time.
```
time_ago_in_words(3.minutes.from_now)                 # => 3 minutes
time_ago_in_words(3.minutes.ago)                      # => 3 minutes
time_ago_in_words(Time.now - 15.hours)                # => about 15 hours
time_ago_in_words(Time.now)                           # => less than a minute
time_ago_in_words(Time.now, include_seconds: true) # => less than 5 seconds

from_time = Time.now - 3.days - 14.minutes - 25.seconds
time_ago_in_words(from_time)      # => 3 days

from_time = (3.days + 14.minutes + 25.seconds).ago
time_ago_in_words(from_time)      # => 3 days
```
Features and Settings:

The time_ago_in_words method automatically adapts to different languages and can be customized to suit your preferences. You can use it to create a friendly and interesting user experience.

About alias:

The time_ago_in_words method in Ruby on Rails is not alone in its magic. He has his close ally, a synonym, ready to share with him the protection of time - **distance_of_time_in_words_to_now**. Both methods have the unique ability to transform cold time numbers into lively phrases, immersing your applications in the world of human time perception. So, when creating dynamic user interfaces or visualizing timestamps, you can choose one of these methods, knowing that each is capable of recreating the sense of time with a unique elegance.
mua chung Flipmine
Tags: webdev, javascript, beginners, programming
Published: 2024-01-28 17:40:25

Flipmine là gì ?
Công cụ mạnh mẽ nhất để tìm những thứ bị định giá thấp trực tuyến.
[mua chung Flipmine](https://www.wsovn.net/flipmine-annual) là một công cụ phân tích nghiêm túc giúp xác định các sản phẩm bị định giá thấp trên một trong những thị trường trực tuyến lớn nhất thế giới – eBay.
Ai nên sử dụng Flipmine?
Flipmine  là công cụ tối ưu dành cho bất kỳ ai muốn tìm những giao dịch tuyệt vời trên các sản phẩm trực tuyến:
Người mua sắm trực tuyến đang tìm kiếm các giao dịch tuyệt vời trên các sản phẩm
Các đại lý tìm cách kiếm lợi nhuận bằng cách lật sản phẩm
Những người mua sắm trên Ebay mệt mỏi với việc sàng lọc các trang sản phẩm để tìm các giao dịch tốt nhất
Những người mua sắm mới làm quen muốn có một công cụ dễ sử dụng để giúp họ tìm được những giao dịch tốt nhất
Những người mua sắm có kinh nghiệm đang tìm kiếm một cách nhanh hơn và hiệu quả hơn để tìm kiếm sản phẩm
Nếu bạn cảm thấy mệt mỏi với việc dành hàng giờ để sàng lọc các trang của sản phẩm, chỉ để thấy rằng hầu hết chúng đều được định giá quá cao, thì công cụ này là giải pháp. Đây là công cụ hoàn hảo cho bất kỳ ai muốn tiết kiệm tiền khi mua sắm trực tuyến.
Làm thế nào nó hoạt động?
Tìm kiếm
Sử dụng   công cụ phân tích mạnh mẽ của Flipmine để tìm ngay những thứ bị định giá thấp. Thu hẹp kết quả theo thông số kỹ thuật mong muốn của bạn bằng cách thêm nhiều quy tắc tìm kiếm.
Của tôi
Đào qua các kết quả. Sử dụng  các công cụ quản lý của Flipmine  để thực hiện những việc sau:
Mua ngay tại: [https://www.wsovn.net/flipmine-annual[](url)](https://www.wsovn.net/flipmine-annual)
👨‍💻 Daily Code 52 | +1 & -1 Buttons in 🟨 JavaScript
Tags: beginners, daily, javascript
Published: 2024-01-28 17:38:29

So today I just gave me a JS exercise so easy that I could do the whole thing without even opening ChatGPT once. And I was able to do it! It’s a totally oversimplified calculator that can only do +1 and -1. Perhaps I should try to do more complicated calculators as exercises in the future, but anyways, right now I am very happy with this one!

# My Code

```jsx
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>+1 & -1 buttons</title>
</head>

<body>
    <button id="js-plus-one">+1</button>
    <button id="js-minus-one">-1</button>
    <div id="js-result">0</div>
    <script>
        let result = 0
        document.getElementById('js-plus-one').onclick = function () {
            result++;
            document.getElementById('js-result').textContent = result;
        }
        document.getElementById('js-minus-one').onclick = function () {
            result--;
            document.getElementById('js-result').textContent = result;
        }

    </script>
</body>

</html>
```

Nothing complicated about this really. It was just all a syntax exercise. And I’m happy to report that I’m by now getting really familiar with this.

That’s it for today. See you in the next one 😊
Share your product & obtain traffic
Published: 2024-01-28 17:14:39

I shared the [AI tool directory website ](https://similartool.ai/) in my blog and some bbs.
And after I shared it, the traffic of my website had a surge!

![Surge of my website: https://similartool.ai/](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jaovat6rwunccc64izxm.jpeg)
Resilience Patterns in Distributed Systems: Handling Transient Failures with Retry and Circuit Breaker Strategies
Tags: microservices, designpatterns, distributedsystems
Published: 2024-01-28 16:50:15

**Transient Failures**: In distributed systems, including microservices, failures are often transient. These can be due to temporary network glitches, short-lived unavailability of a service, etc

**Retry Pattern**: This pattern is typically used to handle transient failures by retrying the failed operation after a short delay, in the hope that the issue resolves itself quickly. However, excessive retries can lead to resource exhaustion and can compound the problem if the service is already under stress.

**Circuit Breaker Pattern**:
	

- **Preventing Cascade Failures**: In a distributed system, if one microservice fails and other services continually try to use it, this can lead to a cascade of failures. A circuit breaker helps prevent this by "opening" and stopping calls to the failing service.

- **System Resiliency**: It enhances system resiliency by allowing failed services time to recover, and it avoids overwhelming a struggling service with further requests.

- **Fallback Mechanisms**: Circuit breakers often provide mechanisms for a fallback action, allowing the system to continue functioning in a degraded state instead of complete failure.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/468x2gkxifkxvdsycmwa.PNG)