teleren/devto huggingface dataset:
Authentication vs. Authorization
Tags: webdev, programming, auth
Published: 2023-06-20 19:06:41

When building web applications, there are two key security terms you need to know - Authentication and Authorization. They may seem similar, but they have different roles in ensuring the security of an application. Let's simplify these concepts a bit.

## Authentication
Authentication is all about proving who you are to the system. It is the process of validating a user's identity. It could be a user, a login, or a session. The system checks if the person is genuinely who they claim to be. This is often done using a username and password, but it could also involve more advanced methods like biometric scans or two-factor authentication.

Imagine logging into a website. You enter your username and password, and the website checks if they match what it has on record. If it's a match, you're authenticated. You've successfully proved your identity to the system.

## Authorization
After the system knows who you are (thanks to authentication), it needs to know what you can do within it. This is where authorization comes into play. Authorization is all about permissions - it determines what actions you can take or what resources you can access in the system.

Think about using a computer where you're not the admin. You can do some things (like creating a document), but not others (like installing new software). That's an example of authorization at work.


![Visualization of both processes together](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zn4vv2eb4ywkkkmpa0am.jpg)

## The Core Difference
In simple terms, **authentication is about proving who you are**, while **authorization is about what you can do in the system**.

Think about it this way: Authentication is like unlocking and entering your house with a key. Authorization is like knowing which rooms you're allowed to go into once you're inside.

---

## Summary
Both authentication and authorization are important for web security. If a system doesn't manage these well, it's like leaving your front door wide open - not a good idea!

How you use these processes depends on your application's needs, the tools you're using, and how secure you want it to be. You could use something like JSON Web Tokens (JWT) to manage both processes, or OAuth if you want to let third parties have access without exposing user credentials.

In summary, knowing the difference between authentication and authorization is important for building secure web applications. They're two different concepts, but both are key parts of web security.
Data Manipulation in Software Quality Assurance
Tags: webdevelopemnt, sqa, softwaretesting, qualityassurance
Published: 2023-06-20 19:00:00

Data manipulation plays a crucial role in software quality assurance (QA) processes. It involves the transformation, organization, and analysis of data to ensure the quality and reliability of software products. Here are some key aspects of data manipulation in software QA:

1. Test Data Generation: Test data is essential for verifying the functionality and performance of software applications. QA teams often need to generate various test data sets to cover different scenarios and edge cases. Data manipulation techniques, such as randomization, data combination, and parameterization, can be used to create diverse and representative test data.

2. Test Data Preparation: Before executing tests, QA engineers may need to prepare the test data by manipulating it to meet specific conditions or prerequisites. This could involve modifying existing data, creating specific data structures, or simulating real-world data scenarios. Data manipulation tools or scripts can automate these tasks, making the process more efficient.

3. Data Validation and Verification: During software testing, data validation is crucial to ensure that the input and output data meet the expected criteria. QA teams need to compare actual test results with expected results and perform data verification checks. Data manipulation techniques can be employed to transform, filter, or aggregate data for validation purposes.

4. Data Cleansing: In some cases, data used in testing may contain inconsistencies, errors, or irrelevant information. Data cleansing involves identifying and rectifying such issues to ensure the accuracy and reliability of test results. This may include removing duplicate entries, correcting inaccuracies, or anonymizing sensitive data.

5. Data Analysis and Reporting: QA teams often analyze test results and generate reports to communicate findings to stakeholders. Data manipulation techniques can be applied to extract meaningful insights from test data, perform statistical analyses, and visualize results in a comprehensive manner. This helps in identifying trends, patterns, and areas that require further attention or improvement.

6. Data Migration and Conversion: In software QA, data may need to be migrated or converted from one format or system to another. Data manipulation is essential in ensuring the integrity and consistency of data during the migration or conversion process. This may involve mapping data fields, transforming data structures, or reconciling differences between source and target systems.

Data manipulation in software QA is a critical component that enables effective testing, analysis, and reporting. It helps QA teams ensure the quality, accuracy, and reliability of software applications by working with representative and relevant data sets throughout the testing lifecycle.
Kubernetes Basics for Beginners
Tags: kubernetes, javascript, programming, react
Published: 2023-06-20 18:55:17

_**To read more articles like this, [visit my blog](https://www.mdfaisal.com/blog)**_



### Let's learn the absolute basics of Kubernetes for Web developers

### What is Kubernetes?

Kubernetes is a orchestration tool for microservices.
It helps to scale the services according to the need of the users.

To manage the cloud native microservices we have to make sure some things

- Scale on demand
- Self-heal
- Support zero-downtime rolling updates
- Run anywhere

And Kubernetes provides all of them. It is called the OS of the cloud. What that means is you don't have to worry which service you are using underneath. This can be AWS or Linode. You can just swap out the underlying architecture if you use Kubernetes.

That's why it's so popular and powerful.

### Cluster and Nodes

A Kubernetes cluster is a collection of machines that have kubernetes installed. The machines can be a computer, a VM, a raspberry PI and so on.

We can install kubernetes on the machines and connecting them creates a Kubernetes cluster. And each of the machines are called Nodes

### Master and Worker

There are 2 kinds of nodes.

- Master nodes (Masters)
- Worker nodes (Nodes)

### Masters

Masters host the control pane and Nodes host user applications.
You want to maintain high availability for the master nodes.

### Workers

The Nodes (aka Workers) run 2 main services.

- Kubelet
- Container runtime

#### Kubelet

the **kubelet** is the main kubernetes agent. It communicates with the control pane.

### Hosted Kubernetes services

There are many kubernetes services but [Linode](https://cloud.linode.com/) offers the easiest way to manage them. So we will create a kubernetes cluster with 2 worker nodes on Linode.

Have a great day! :D

**Get in touch with me via [LinkedIn](https://www.linkedin.com/in/56faisal/) or my [Personal Website](https://www.mdfaisal.com/).**
The Unseen Parallels of Teaching and Developer Advocacy
Tags: discuss, career, devrel, learning
Published: 2023-06-20 18:51:13

There's a common question I get asked as a Developer Advocate: "How did you go from being a middle school teacher to tech?" My answer, although surprising to some, is simple: "It’s not as different as you might think."

**It's All About Relationships**

My teaching days revolved around my students—understanding their needs, learning styles, and finding the keys to unlock their potential. In the world of tech, I found myself doing the same but with developers. Instead of parent-teacher meetings, there are now community discussions. It was a shift in context, but the underlying principles of relationship building, empathy, and understanding remained the same.

**The Art of Engaging Content**

A lesson on grammar rules or vocabulary might not always be the most enticing subject for a middle schooler. The challenge was to make it engaging, relatable, and fun. Similarly, in my current role, whether I'm crafting a blog post or designing a product demo, the content must resonate with developers. It must provide them with value while simultaneously engaging their interest—no small task, but one that's remarkably familiar.

**The Power of Data**

As a teacher, the evidence of my effectiveness came through test scores and feedback. Now, data comes in the form of user statistics, engagement rates, and community feedback. In both professions, data is an invaluable ally, guiding my decisions, validating my efforts, and illuminating the path forward.

**Lifelong Learning**

Teaching taught me that to inspire learning, one must be a learner themselves. This couldn't be more true in the tech industry. The landscape evolves so rapidly that being a perpetual student is part of the job description. From learning about new programming languages to keeping up with the latest in AI, every day is a school day.

**Catering to Varied Learning Styles**

One of the most exciting challenges in both roles is meeting the needs of diverse learning styles. In the classroom, lessons had to be dynamic to cater to the visual, auditory, and kinesthetic learners. In tech, I strive to make complex technical content accessible and engaging to all developers, whether that means creating a video tutorial, a hands-on coding challenge, or a detailed blog post.

**Presentation Skills: A Key Ingredient**

The front of a classroom and a conference stage might look different, but the feeling is remarkably similar. The skills I honed while teaching—public speaking, confidence, and the ability to deliver information in an understandable manner—have served me incredibly well in developer advocacy.

While on the surface teaching and developer advocacy seem worlds apart, they share the same heart. They both revolve around building relationships, creating engaging content, leveraging data, continuous learning, adapting to different learning styles, and public speaking. So if you're thinking of making a similar leap, take it from me: the chalkboard might be replaced by a keyboard, but the principles that drive success are universal.
Simplifying developer environments with AI and in-context automation
Tags: development, tools, ai
Published: 2023-06-20 18:40:59

---
title: Simplifying developer environments with AI and in-context automation
published: true
description: an interview between Julian Wood and Chris Heilmann at GOTO Copenhagen 
tags: development,tools,AI 
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t7asfxdyerziishaeiw3.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2023-06-20 18:29 +0000
---

In this episode of GOTO Unscripted, Julian Wood interviews Christian Heilmann, former principal program manager for developer tools at Microsoft. Christian emphasizes the need to break free from the traditional monolithic IDE and debugging tools by leveraging the power of web technology and standardizing extensions. By highlighting the importance of contextual tooling, where interfaces learn from user behavior and provide automated suggestions and simplified workflows, he aims to streamline the development process and make it more accessible, empowering developers to focus on writing code rather than navigating complex environments.

{% youtube o0bYu0HVjNU %}

Full transcript is available at [GOTOPedia](https://gotopia.tech/articles/242/simplifying-dev-environments-with-the-right-tools)
Terminal TOTP Manager
Tags: python, sideprojects, beginners, programming
Published: 2023-06-20 18:36:56

Attention all developers! Are you tired of juggling between your terminal and Google Authenticator whenever you need to login to SSH or other platforms with a Time-Based One-Time Password (TOTP)? Well, fear no more! I present to you Terminal TOTP Manager, the superhero tool that saves the day by bringing TOTPs right to your command line. Let's dive into this epic tale of laziness turned innovation and discover how this handy tool can revolutionize your developer life.

### Embracing the Developer's Lair:
As developers, we spend countless hours in our terminal caves, crafting lines of code that shape the digital world. But those pesky TOTPs often disrupt our flow, forcing us to venture out of the terminal to retrieve them from external apps. Terminal TOTP Manager comes to the rescue, eliminating the need for such distractions. Now you can manage your TOTPs without leaving the sacred realm of the terminal. 

![Funny Gif](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bokxa50hcda1d8cj98ss.png)

My Mind: You should quit programming and join sales😂

Long story short, I was so frustrated jumping between authenticator app & terminal for totps and also wanted to know how TOTPs actually work. Instead of reading articles or watching youtube videos, I directly went to RFC for docs,read it and build a small tool that manage the TOTP in the terminal itself. 

![Screenshot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/adb9qd1ccr6jh7m5tb51.png)

If you found this tool interesting or wanna check out how it works. 
Here's the repo link 👉🏻 [link](https://github.com/The-Robin-Hood/TTM)  - A star could make my day 😁😁

You can also directly install it by pip 
` pip install pyttm `


You can follow me on Twitter - [Ansari](https://twitter.com/Am5orry)
Looking to partner with a chrome extension partner.
Tags: extension, chrome, partner
Published: 2023-06-20 18:33:20

Introducing the perfect collaboration: CodeCrafter and "your chrome extension"! Unite the power of two innovative extensions to supercharge your coding experience. Seamlessly integrate "your Chrome extension's" unique features with CodeCrafter's robust code snippet management capabilities. Together, we're revolutionizing the way developers work, bringing efficiency and productivity to the forefront. Discover the synergy of CodeCrafter and "your Chrome extension", and unlock a whole new level of coding awesomeness.

In short we want to partner with a another chrome extension so we can reach people to install our chrome extension. Our chrome extension(which is also featured) - https://chrome.google.com/webstore/detail/codecrafter/mllegkfjonhcfpbkhokboibclmkibdfl
SOLID Principle in JavaScript
Published: 2023-06-20 18:25:30

### The SOLID principles are a set of guidelines that help developers write clean, maintainable, and flexible code.

Here's a simple explanation of one of the SOLID principles, the Single Responsibility Principle (SRP), in the context of JavaScript:

The Single Responsibility Principle states that a class or module should have only one reason to change. In other words, it should have a single responsibility or purpose.

Here's a brief explanation of each principle:

### Single Responsibility Principle (SRP):
Each class or function should have only one responsibility or job. It means that a module should focus on doing one thing well and not try to handle multiple unrelated tasks.

### Open/Closed Principle (OCP):
Software entities (classes, functions, etc.) should be open for extension but closed for modification. It encourages writing code in a way that allows adding new functionality without changing the existing code.

### Liskov Substitution Principle (LSP):
Subtypes must be substitutable for their base types. In simpler terms, if a program works with a certain type, it should work with any of its subtypes without causing unexpected behavior.

### Interface Segregation Principle (ISP):
Clients should not be forced to depend on interfaces they do not use. This principle emphasizes that classes or modules should not have dependencies on interfaces they don't need, and interfaces should be tailored to the specific needs of clients.

### Dependency Inversion Principle (DIP):
High-level modules should not depend on low-level modules; both should depend on abstractions. It promotes decoupling of modules by introducing abstractions (interfaces or abstract classes) to depend on, rather than relying on specific implementations.

#### By following these principles, developers can create code that is easier to understand, maintain, and extend. They help in achieving modularity, reusability, and reducing the impact of changes in one part of the codebase on other parts.

I have created a GitHub repo to help you understand SOLID principles in JavaScript. It's a beginner-friendly guide with easy examples. 
If you're interested,  check out the repo at:  
[SOLID-Principles-in-JavaScript](https://github.com/AishwaryaMurade/SOLID-Principles-in-JavaScript)

Happy Coding!
Custom E-Paper Dashboard
Published: 2023-06-20 18:24:10

E-Paper is a great low cost display technology for viewing high contrast data which doesn't need to be updated frequently

My original approach included a Python script which ran locally using `requests` to hit several API endpoints and render some text on the display, along with a cron job for scheduling.

This had some limitations:

- Updating the script with visual changes was tedious
- There was no server caching

I wanted to be able to generate the image on a webserver and have a specific route for each resolution.

My new solution was more modular:

![2.7 inch Epaper display](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xedinpkevhw5xivjedkr.jpg)

- NextJS application running on Vercel with Serverless PostgreSQL (optional)
- `canvas` to generate the PNG image (in `servergenerate.js`)
- `getImg.sh` bash script to fetch the PNG image and call the Python script
- The Python script simply converts the PNG to BMP and sends it to the `epd` driver

Room for improvement:

Dashboard to manage which data gets displayed and configuring size
Graphical editor for positioning and preview

Github Repo: https://github.com/bbershadsky/epaperFullStack

Thank you for reading!
How to Display Products with Medusa
Tags: medusa
Published: 2023-06-19 16:26:46

---
title: How to Display Products with Medusa
published: true
description: 
tags: medusa
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2023-06-19 16:16 +0000
---

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

Everyone knows Medusa, the open source Shopify alternative and Product Hunt award winner as the e-commerce solution of 2022

In this little post we are going to see how to list products with Medusa

## Development

Deploy you Medusa backend on a fresh local Ubuntu Server with VirtualBox

Create a latest Nextjs App (talking about /app)

Create a file in the Nextjs App called medusa-client.js (in utils folder for example)

For info: We are just coding what is explained on the API documentation here https://docs.medusajs.com/api/store#tag/Products

```
import Medusa from "@medusajs/medusa-js"

//Create a Medusa instance
const medusaClient = new Medusa({ baseUrl: process.env.BACKEND_URL })

export { medusaClient }
```

Create the Products page.tsx

```
const [products, setProducts] = useState<any[]>([])

const getProducts = async () => {
  try {
    const results = await medusaClient.products.list();
    console.log(results)
    setProducts(results.products)
  } catch (error) {
    console.log(error)
  }
}
    
useEffect(() => {
 getProducts()
}, []);
```
We will discuss that `<any[]>` type in other posts, and how to display the prices and other fields, also why I use results and not data, but why not ...

Now you can just display the products in a TailWind CSS grid

```
<div className="grid grid-cols-1 gap-1">
  {products.map((product) => (
    <ProductCard product={product} key={product.id} />
  ))}
</div>
```

You can pick a ProductCard in hyperui.dev or use the code available on https://github.com/nazimboudeffa/medusa-storefront-coffee-nextjs

Look in next.config.js for more infos on the `BACKEND_URL` with the latest Nextjs version

## Production

* For the backend (demo) I use railway.app $8/Month [check this video](https://www.youtube.com/watch?v=a_EHB1VEkC0) but basically a little OVHCloud VPS is Okey for one store
* For the storefront (demo) I use vercel.com $20/Month
* For the domain name you can choose what you want, OVH, namecheap, ... ~$15/Year

It's still cheaper then Shopify, actually $36 and you can make many many ... many deployments


:tada:
Victorious Club: The Ultimate #FantasyContest Plugin for Your Website
Tags: fantasysports, wordpress, make
Published: 2023-06-20 18:16:46

Victorious Club is a powerful, versatile WordPress plugin designed to boost your website's user engagement by hosting interactive fantasy contests across any niche. This tool enables website owners to transform their platforms into vibrant, engaging spaces where users can participate in contests tailored to their interests, be it sports, entertainment, politics, finance, and more.

One of Victorious Club's standout features is its integration with automated data feeds for all major sports worldwide. This feature not only provides real-time updates for sports-related contests, emulating the experience found on prominent fantasy sports platforms, but also significantly reduces the need for manual data entry. Customers can purchase data feeds directly from Victorious Club, freeing them from the hassle of having to manually enter player rosters, schedules, and updates.

But the power of Victorious Club goes beyond sports. The plugin allows you to create custom contests around any topic of your choice, providing endless opportunities for user engagement.

In addition to its functionality, Victorious Club supports multiple payment gateways and offers an affordable subscription model, with a basic and a premium package. To ensure a seamless user experience across devices, the plugin is accompanied by native mobile apps for iOS and Android. Furthermore, with great emphasis on customer service, Victorious Club ensures that customers receive robust support in setting up and managing their contests.

In a nutshell, Victorious Club is more than just a plugin. It's a comprehensive solution designed to significantly enhance user engagement and retention on your website. Transform your website into an interactive, dynamic platform with Victorious Club today.