teleren/devto huggingface dataset:
Multiple Authentication Using Middleware In Laravel 9
Tags: laravel, authentication, middleware, codenewbie
Published: 2023-01-04 05:30:00

In this article, we will see multiple authentication using middleware in laravel 9. Here, we will learn how to multiple authenticate using middleware in laravel 9. Using middleware we authenticate the user. 

Laravel includes a middleware that verifies the user of your application is authenticated. If the user is not authenticated, the middleware will redirect the user to your application's login screen.

So, let's see laravel 9 multi auth using middleware, multi auth in laravel 9.

Laravel 9 multi auth creates a middleware for checking the user. It is a super admin or user and manager. And create middleware and configure it in the kernal.php file.

In this example, we will add three types of users:

1. User

2. Manager

3. Super Admin

When we log in as a user then it will redirect to user routes. If you log in as super admin then it will redirect to super admin routes.
Create a Birthday Reminder with React App
Tags: beginners, react, webdev, javascript
Published: 2023-01-04 04:56:41

**Introduction:**
- learn to load data from a static JS file
- learn to use useState to store data
- learn to clear the state variable and see that reflected in the UI

**1. Create the HTML hierarchy in App.js:**

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

- App component h3 should contain the following text:

> 0 birthdays today

**2. Create the List component in App.js and pass the data as props to List component:**


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

> set how many people birthdays today based on the data.length

**3. The data file have all the _image url, id, age, and name_ for List component:**

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

**4. List component**

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

When pass the data as props to List component, we can deconstruct the props and map the passing data.

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

**5. Add a “Clear” button which will reset it to 0 birthdays.** 

For the clear all button as the following in App.js component:

-  Create a new state variable called people and useState Hook to accept the initial value as the imported data from the top.
- Pass this state variable in the List component.
- When the Clear button is pressed, empty the state variable so that no record is displayed (Hint: set it to an empty array)


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

**Conclusion**
Building the birthday reminder react app can help newbie understanding the basic useState Hook, export data and then store in the App.js variable. 
see more detail in my github page: https://github.com/chenyibo406
I also update the birthday-app in netify, see my project at: https://birthday-reminder-ac.netlify.app/
EMMET at a glance
Tags: html, css, vscode, webdev
Published: 2023-01-04 04:41:34

EMMET makes the task of typing for HTML and CSS short.

The following are the few EMMET commands.
EMMET is already a built in extension for vscode.
The following are the commonly used shortcuts provided by EMMET

! - Template HTML DOC 5 code.
p - Paragraph tag
div - div tag
tag name in html - gives the open and closed tags along with common attributes.
(# as prefix)x - Gives a div tag with id x
.x - Gives a div tag with class x
(# as prefix)x.x - Gives a div tag with class x and id x.
p.x - Gives a paragraph tag with class x.
p#x - Gives a paragraph tag with id x.
div*3 - Gives 3 div tags.
div.x*3 - Gives 3 div tags with class x.
div#x*3 - Gives 3 div tags with id x.
div>p>h1 - Gives a div with p as child with h1 as p's child.
div>p*3 - Gives a div with three child p tags.
div+p - Gives a div and p tags as siblings.
How do i open a coinbase business account
Tags: coinbase, business, account
Published: 2023-01-04 04:37:27

Coinbase offers a [Coinbase Business account](https://www.techaroundnow.com/open-a-coinbase-business-account/) that is designed specifically for businesses. With a Coinbase Business account, you can securely buy and sell cryptocurrencies, manage multiple users and wallets, and view detailed reports on your activity. Coinbase Business accounts also have access to additional features, such as recurring buys and higher limits. To create a Coinbase Business account, you will need to provide some additional information about your business, such as your business name, address, and contact information. You may also need to verify your business's identity by providing documentation such as a business license or articles of incorporation.

To open a [Coinbase Business account](https://tipsfromtycoon.com/coinbase-business-account/), follow these steps:

1. Go to the Coinbase website and click on the "Sign Up" button.
2. Select "Business" as the account type.
3. Enter your business name, email address, and create a password.
4. Click on the "Create Account" button.
5. Follow the prompts to complete the registration process. This may include providing additional information about your business, such as your business address and contact information, as well as verifying your business's identity. 

Once you have completed the registration process, you can use your Coinbase Business account to buy and sell cryptocurrencies, manage multiple users and wallets, and view detailed reports on your activity.
Fetching Your daily.dev Articles for Your Blog App
Tags: devjournal, dailydev, programming, webdev
Published: 2023-01-04 04:26:23

If you're a developer who writes articles on daily.dev, you may want to display these articles on your personal blog or portfolio website. One way to do this is by using the dev.to API, which allows you to access articles from daily.dev and other websites.

Step 1: Get Your daily.dev Username

First, you'll need to find your daily.dev username. This is the handle that appears in the URL of your articles, such as "https://dev.to/{username}/your-article-slug".

Step 2: Fetch Your Articles

To fetch your articles from daily.dev, make a GET request to the following endpoint:

https://dev.to/api/articles?username={USERNAME}

Replace {USERNAME} with your actual daily.dev username. This endpoint will return a JSON array of your articles, along with their titles, URLs, and other metadata.

Step 3: Display Your Articles in Your Blog App

Once you have your articles, you can display them in your blog app however you like. For example, you could loop through the array of articles and render a list of links to each article. Or, you could display the full text of each article on a separate page.

To display the full text of an article, you can make a GET request to the URL of the article, which is included in the JSON object returned by the API. This will return the HTML content of the article, which you can then parse and display in your app.

Conclusion

Using the dev.to API, it's easy to fetch and display your articles from daily.dev in your personal blog or portfolio website. With just a few lines of code, you can keep your app up to date with your latest content from daily.dev.
Stack in Java
Published: 2023-01-04 03:52:17

Stack is very beneficial. For example, stack is used to solve the valid parentheses problem. This is the memo about stack using Java.

To make Character stack :
`Stack<Character> stack = new Stack<>()`

The built-in methods of stack:
push()... to add the element on the top

pop()... to remove the element on the top

peek()... to find the element on the top

search()... to search the specific element and return the position of it

Empty()... to return if the stack is empty or not
Learn Java From Scratch
Published: 2023-01-04 03:37:15

Java track program have become a favorite among fresh graduates looking to launch a career in tech. It provides them with a quick route to acquire relevant skills and get into a job as soon as they graduate.
One of the biggest reasons students are attracted to the java track program is their placement assistance and job guarantee. Job guarantee ensures that you will find a job in the field of your study.
If you are willing to learn java from scratch enroll yourself with SynergisticIT, [best java track program in Bay Area](https://www.synergisticit.com/java-track/).

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hj3re1i578dlgy2ho9f0.jpg)
Circuit Breaker: A Basic Concept
Tags: circuitbreaker, systems, beginners, tutorial
Published: 2023-01-04 03:34:31

A circuit breaker is a design pattern we use in system design that detects failures. It also presents a logic that prevents failure that might occur during maintenance, external system failure, or unexpected problems in the system. The concept is to enclose a protected function call in a circuit breaker which then monitors for possible failures. When the failures reach a certain threshold, the circuit breaker trips which means the remaining calls return with an error without the protected call being made. We can also have monitor alerts in case of the circuit breaker trips in any way.

## Why is a circuit breaker used?

Software systems make remote calls to the software running in different processes that might lie in some other machine across a network in a faraway location. A remote call is more bound to fail and can even hang up without a response until some timeout limit is reached. This is what differentiates remote calls from in-memory calls. If we have numerous incoming calls on an unresponsive supply, you have the chance of running out of critical resources leading to cascading failures across multiple systems.

## Circuit Breaker States

There are three states in circuit breaker which are individually explained below: -

![Circuit Breaker States](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/trpvs8arbivg6lkxfnvs.jpg)

### 1. Closed

Circuit Breakers are in a closed state when everything is good and normal. The request calls pass through the services normally when circuit breakers are in the closed state. However, when the failures increase and pass the threshold, the circuit breaker trips and moves to our next state — Open.

### 2. Open

Circuit breakers return an error without even invoking the services while in the open state. Eventually, the timeout will be specified with the help of the monitoring system while in the open state and when the certain timeout period elapses, the circuit breaker goes to the half-open state.

### 3. Half-open

The half-open state can go both ways. The circuit breaker can pass a limited number of requests from the service to pass through and invoke the operation. When the requests are successful, the circuit breaker goes to a closed state and when they fail, it goes to the open.

{% embed https://github.com/pragyaasapkota/System-Design-Concepts %}

**_I hope this article was helpful to you._**

**_Please don’t forget to follow me!!!_**

**_Any kind of feedback or comment is welcome!!!_**

**_Thank you for your time and support!!!!_**

**_Keep Reading!! Keep Learning!!!_**
Notes from class 1
Published: 2023-01-04 03:09:01

Back on the horse. Today we jumped into refactoring code we learned in App Dev 1, in particular improving form functionality. One item of note was the addition of authenticity tokens to forms to add security such that other sites can't grab a form and submit unrelated content for a database.

```
<input type="hidden" name="authenticity_token" value="<%= form_authenticity_token %>" >
```

Ruby pulls the token from that method that is called in-line within the form. 

<h3>GitPod shortcut of the week</h3>
Select some text and then press Command + D selects the next instance of identical text in the document, using arrow keys you can then edit multiple lines at the same time.
Week 1
Published: 2023-01-04 02:51:04

**Remembering things from App Dev 1 (1 year ago)**

- bin/server
- rails db:migrate
- preview in post
- control d selects all instances

**Improvements from AD 1:
**

Authenticity Tokens

-  `<input type="hidden", name="authenticity_token", value="<%= form_authenticity_token %>">`
     
REST API

- HTTP request methods should be used to name methods
- / plural version of table name / dynamic route 

**.at()
**
Can't use anymore. use [] or .first

Scaffold generator is built into rails
Do you need to know all design patterns (as a Java Developer)?
Published: 2023-01-04 02:33:02

It is not necessary for a Java developer to know all design patterns. However, it is generally considered a good idea for a developer to be familiar with some of the most common design patterns, as they can be useful tools for solving common design problems that arise in software development. Knowing some design patterns can also make it easier for a developer to communicate with other members of a development team and understand code written by others. That being said, it is not necessary to know all design patterns to be a successful Java developer.
Getting started with NodeJs and Express (Backend development)
Tags: node, express, javascript, beginners
Published: 2023-01-04 02:27:17

Node.js is a JavaScript runtime library that allows developers to run JavaScript on the server side (i.e., outside of a web browser). It allows you to build server-side applications using JavaScript, and is particularly useful for building real-time, high-concurrency web applications such as chat rooms and online games.

Express is a framework for building web applications and APIs with Node.js. It provides a set of features and functions that make it easy to build and customize server-side applications using Node.js.
Both go hand-in-hand.
**To set-up node and express on your system, you will need the following:**
A text editor: This can be any text editor that you are comfortable using, such as Sublime Text, Atom, or Visual Studio Code. (I use VScode, which I will also recommend greatly)

Node.js: This is the JavaScript runtime that allows you to run JavaScript on the server side. You can download the latest version of Node.js from the official website (https://nodejs.org/en/) and install it on your system.

npm (Node Package Manager): This is a package manager for Node.js that allows you to install and manage Node.js packages (libraries and tools). npm is included with Node.js, so you don't need to install it separately.

Once you have these tools installed, follow these steps:

Create a new directory for your project.

Then open a terminal or command prompt window, navigate to the project directory, and run the following command to create a package.json file:

```
npm init -y

```
Then, you can install express with:

```
npm install express

```
After that, create an entry point for your application by creating a file named index.js in the project directory.

Then open index.js in your text editor and import the Express module by adding the following line at the top of the file:

```
const express = require('express');

```
Then, create an instance of an Express app by adding the following line:

```
const app = express();

```
This should fall directly under the former.

Routes and middleware functions are needed in Express. Here is an example:
The following route will send a "Hello World!" message when the root URL is accessed:

```
app.get('/', (req, res) => {
  res.send('Hello World!');
});

```
In order to be able to start the server, add the following line at the bottom of the file:

```
app.listen(3000, () => {
  console.log('Server listening on port 3000');
});

```
That's it! You should now have a basic Node.js and Express server set up on your system. You can start the server by running the following command in the terminal:

```
node index.js

```
That's just the fair introduction to Nodejs and Express. If you have any questions, please feel free to ask in the comment section below. Thanks
Array Vs List
Tags: programming
Published: 2023-01-04 02:27:16

Arrays and Lists are similar data structures. But there are some differences between arrays and lists. Lists are dynamic data structures. It means that lists can be manipulated. In other words, lists can be changed. An element can be easily added or removed in a list. For example if we want to add an element 3 in the list [7,5,1,8]. In case of list, we can easily do it using the list.append() function. But in this case the length of the list changes. Before the length of the list was 4. After the addition of 3 the length of the list now has become 5 and the list is now [7,5,1,8,3]. But this method will not work for arrays. That is because the size of the arrays are fixed. It means if we take the same array [7,5,1,8] like before then we cannot just add 3 to it. The reason is if we add 3 to the list then the size of the list will be changed. What we can do is that we can create another array setting the length of the array 1 greater than the previous array. As the length of the array is 4 we have to make another array with the length of 5. Then we will copy the previous elements in the new array. After that at the last index we can add 3. Thus, these are the differences between arrays and lists.
Take full-shot of your Websites
Published: 2023-01-04 02:18:19

As a developer or designer everyone must need a tool to fully capture their design to show others. It might sound easy but not for the software available in the market mostly are paid . 

And for that I make a way out for myself with a chrome extension which is fully free to use . 

with more than 5M users its a really free to use productive tool . 
you can find it "GoFullPage - Full Page Screen Capture" on google just write and it will appear than add it to your chrome . That is all a problem is solved with a free tool !!!!


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/beiu1ck9kfc413j2c1xu.png)
Postman Collection: How to Create & Manage Collections - API Testing using Postman - (Part 3)
Tags: webdev, beginners, programming, tutorial
Published: 2023-01-04 01:58:57

In this tutorial on Postman Collection, We are going to discuss the How to Create a New Collection in Postman and How to manage them and How you can share them with your team in the postman team work space.

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

Buy the Full course Here - ►► https://www.udemy.com/course/learning...
 ◄◄

You are going to learn the concepts of API, API testing, web services and HTTP Methods basics which are helpful in API testing interview questions

#API #APITesting #Postman  #APITestingTutorials.

Join Facebook Group :  http://bit.ly/learntesting2019

Website:   https://scrolltest.com

Website:   https://thetestingacademy.com

Twitter: https://twitter.com/itstechmode


In this tutorial, we are building API test suite in Postman and Running it Command Line(Newman).

API calls Collection include mainly three things:
Creation
Manage
Sharing

Recommend Books :

- Foundations of Software Testing ISTQB Certification  - https://amzn.to/2AZf21m

- Mastering Selenium WebDriver - https://amzn.to/2BXtLeY

- Selenium Framework Design in Data-Driven Testing -https://amzn.to/2B2MWCu

- Selenium Design Patterns and Best Practices - https://amzn.to/2BZkYZW

- Learning Selenium Testing Tools - https://amzn.to/2B1DteU


Join Facebook Group : Software Testing & Automation Discussion
https://www.facebook.com/groups/18560..
.

Blog :  https://scrolltest.com


Follow at Quora : https://www.quora.com/profile/Promode-1


🚀 Tools and services I recommend:
Some of the courses that I recommend to become better Automation Tester 🙌🙌

✅Selenium Training and Certification -
https://scrolltest.com/go/edureka


✅Learn Jenkins for QA -
https://bit.ly/learnjenkins-p1


✅Programming Java -
https://bit.ly/learnjava2020-p1


✅Test Automation - 
https://bit.ly/learnautomation2020


✅API Testing - 
https://www.learnapitesting.com


✅Cypress Tutorial with LIVE Projects -
http://cypresstutorial.com
#DevDiscuss: Monoliths vs. Microservices
Tags: discuss, microservices, programming, devdiscuss
Published: 2023-01-04 01:56:54

---
title: #DevDiscuss: Monoliths vs. Microservices
published: true
description: 
tags: discuss, microservices, programming, devdiscuss
series: #DevDiscuss
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/29b09yso4zqwnj49u8wq.png
---
*image created by [Margaux Peltat](https://www.patreon.com/margauxpeltat) for the [Chilled Cow YouTube channel](https://www.youtube.com/watch?v=lTRiuFIWV54)* 

Time for #DevDiscuss — right here on DEV 😎

{% embed https://dev.to/lovepreetsingh/microservices-vs-monolithic-architecture-a-practical-approach-4m06 %}
Inspired by [@lovepreetsingh](https://dev.to/lovepreetsingh/)'s Top 7 post, tonight’s topic is...monoliths vs. microservices 🏗️

---

Questions:
- **Do you prefer working with monoliths or microservices?**
- **What are the pros and cons of each approach, in your experience?**
- **Which microservices patterns have you had the most (or least) success with?**
How to Sort C# Dictionary?
Published: 2023-01-04 01:42:59

We can Sort any kind of collection with the help of methods exposed by Linq library in C#. Order by can be used to [sort the collection](https://beetechnical.com/tech-tutorial/cshapr-dictionary/).

```
 static class Program
    {
        static void Main(string[] args)
        {
            var dictionary = new Dictionary<string, int>()
            {
                { "Deep", 32 },
                { "Saurabh", 30 },
                { "Rahul", 35 },
                { "Jitendra", 24 }
            };

            foreach (var keyValuePair in dictionary)
            {

                Console.WriteLine(keyValuePair.Key + " " + keyValuePair.Value);
            }
            
            //After sorting
            Console.WriteLine("\nAfter sorting\n");
            var sortedDictionary = dictionary.OrderBy(x => x.Value);
            foreach (var keyValuePair in sortedDictionary)
            {
                Console.WriteLine(keyValuePair.Key + " " + keyValuePair.Value);
            }

            //After sorting
            Console.WriteLine("\nAfter Sorting in Descending Order\n");
            var sortedDictionaryInDescOrder = dictionary.OrderByDescending(x => x.Value);
            foreach (var keyValuePair in sortedDictionaryInDescOrder)
            {
                Console.WriteLine(keyValuePair.Key + " " + keyValuePair.Value);
            }
            Console.ReadKey();
        }

    }
```

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ow56i4e5iqv4c4wik48n.png)
Clear Cookies in Qutebrowser
Published: 2023-01-04 01:38:41

After a few times of trying to figure out where to clear the cookies so I can log back into a specific website. This is the correct path to remove the Cookies


~/.local/share/qutebrowser/webengine

rm Cookies

restart your Qutebrowser

that's it!

btw, the command pwd shows the current path.