teleren/devto huggingface dataset:
Who manages the package managers?
Tags: webdev, javascript, node, tutorial
Published: 2024-01-27 12:13:10

The JavaScript ecosystem is notorious for moving quickly. Just a few years ago Yarn (now Yarn Classic) was ubiquitous. Since then, 3 major `yarn` versions have been released and new competitors have entered the market. While upgrade paths can be straight forward&mdash;with pnpm even providing `pnpm upgrade`&mdash;the problem of managing package managers arises.

Consider an organisation with hundreds of JavaScript repositiories. Some have long been abandoned and others have an active development team keen to use the best-in-class tooling. Maybe at a glance it is obvious which flavour of package manager a repository depends on; we may see a `package-lock.json` or `yarn.lock` file. However, further inspection is needed to determine which version of NPM or Yarn created those. It is too easy for a developer to end up recreating a lock file after running the wrong command. Not a great experience!

A better approach is to use a combination of the following tools. Firstly, fnm (Fast Node Manager) is a well established Node version manager. After [setting up your shell environment](https://github.com/Schniz/fnm?tab=readme-ov-file#shell-setup), navigating to a project folder is all that is required to detect and switch to the correct Node version, provided a `.node-version` file exists. We can take this a step further by adding `packageManager` to our `package.json`:

```diff
+ "packageManager": "pnpm@8.14.3"
```

On its own that isn't going to do much. A developer would still need to open `package.json` to find the correct package manager to download. We can automate that with Corepack. Corepack is an experimental feature of Node that looks for the `packageManager` field and silently downloads the version when running scripts. It also throws an error if the wrong package manager is used in the scope of the project. It is an opt-in feature though, so `corepack enable` must be run after Node is installed. Alternatively, fnm can be configured to do that automatically:

```diff
- eval "$(fnm env --use-on-cd)"
+ eval "$(fnm env --use-on-cd --corepack-enabled)"
```

Now, running any package manager command comes with a guarantee; with the above configuration, `pnpm -v` always resolves to 8.14.3 and `yarn -v` errors. Note that package managers previously installed globally should be uninstalled first. Without doing that, we won't see the wonderful error:

> Usage Error: This project is configured to use pnpm
How add add default roles in Auth0
Published: 2024-01-27 12:04:19


Roles and Permissions
The first step to add authorization to your application is to add authentication. Once you guarantee that only authenticated users can access it, you should have more control over who can access what.

In an organization, a role defines what a user can or can't do. Roles are often used to reflect the organizational structure, departments, etc. In relatively small authorization systems, using roles is a fast way to manage access control of resources.

A permission is a declaration of an action that can be executed on a resource.

In Auth0, a role is a collection of permissions that you can apply to users, which can facilitate how you add, remove, and manage permissions because you handle them as a group rather than assigning them to users individually. For example, you could have a role author, and as permissions, you could have create:article, edit:article, and so on.

Creating and Assigning Roles with Auth0
For this blog post you'll need an Auth0 account and a registered API with Auth0, if you don't have one, you can sign up for free.

Get an Auth0 Account for free.
Get started →
Create a Role on Auth0
From the Auth0 Dashboard, click on User Management on the sidebar, then Roles. Click the + Create Role button to create a new role. Let's say we want a default role for users, so you can name it default_role and add a meaningful description, then click on Create.

## create a login flow in the admin dashboard
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2wp6fref25kfztm9jk81.png)


## add a custom flow

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



![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/okuko49tvumvi3gybc9k.png)
Unihair is #1 Vietnamese Human Hair Factory, Vietnamese Hair Extensions
Published: 2024-01-27 11:32:37

https://unihairvn.com/ Unihairvn is one of the top wholesale hair suppliers in Vietnam✔️ is an internationally known hair extension brand with retail stores and distributors throughout the United States✔️ Europe✔️ Asia✔️ Africa and Central America✔️✔️✔️
+84905971188
40 Thach Lam street, Son Tra district, Da Nang City, Viet Nam.
wholesale@unihairvn.com
https://unihairvncom.zohosites.com/
https://hashnode.com/@unihairvncom
https://hackmd.io/@unihairvncom
Livewire 3 Jetstream Dropdown Menu Not Working [Fixed]
Tags: livewire, laravel, jetstream, php
Published: 2024-01-27 11:32:05

If you're having trouble with your Livewire 3 Jetstream dropdown menu, here's a simple fix:

**Find Livewire Folder:** Look for the Livewire folder in your project. It's usually in vendor/livewire/livewire.


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


**Grab the "Dist" Folder:** Inside the Livewire folder, you'll see one called "dist." That's the one we need.


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


**Copy and Paste:** Copy the "dist" folder and paste it into your Laravel project's "public" folder.


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


**Rename:** Change the name of the pasted "dist" folder to "livewire."


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


**Done!:** That's it! Your dropdown menu should be up and running smoothly again.


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


Give it a try and see if it works for you!
What are you learning about this weekend? 🧠
Tags: codenewbie, learning, beginners, discuss
Published: 2024-01-27 11:00:00

Hey muh peeps!

What's everybody up to this weekend? Learning, chilling, a little bit of both?

Whether you're sharpening your [JS](https://dev.to/t/javascript) skills, making PRs to [your OSS repo of choice](https://github.com/forem/forem) 😉, sprucing up your portfolio, or [writing a new post](https://dev.to/new) here on DEV, we'd like to hear about it.

Share whatever it is you're learning about below and consider leaving some encouraging words for someone else down there while you're at it!

![A scene from Star Wars Episode II... Yoda looks tough and determined after having caught and absorbed force lightning from Count Dooku. He says "Much to learn you still have"](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k8u97gmchltxildl9pz7.gif)
How to Connect Mongo db with Node JS & Express JS
Published: 2024-01-27 10:59:54

Setting Up a Node.js Project
Initialize Node.js Project: Create a new folder for your project and run npm init to initialize a new Node.js project.

Install Dependencies

```
npm install express mongoose
```
Connecting MongoDB with Mongoose
Set up a basic Express application in your index.js file:

```
const express = require("express");
const app = express();
const PORT = process.env.PORT || 3000;
require("./dbconnection.js")

app.listen(PORT, () => {
  console.log(`Server is running on port ${PORT}`);
});
```
Set up a Db connection file dbconnection.js file:

```
const mongoose = require("mongoose");
const express = require("express");
require("dotenv").config();
const app = express();
app.use(express.json());
app.use(express.urlencoded({ extended: true }));
mongoose.connect(process.env.MONGODB_URI, {
  useNewUrlParser: true,
  useUnifiedTopology: true,
});

const db = mongoose.connection;
db.once("open", (_) => {
  console.log("Database connected:", process.env.MONGODB_URI);
});

db.on("error", (err) => {
  console.error("connection error:", err);
});
```
by replacing process.env.MONGODB_URI with you own url

Go to terminal and type npm start

```
npm start
```
Congratulatios! you db has been connected now you can start playaround it
Deployment Options for SAAS App
Published: 2024-01-27 10:36:41

I have a SAAS app and need to deploy it, but I'm unsure of the best options. I have some vague ideas but am curious to know what others think as I'm not that knowledgeable in this area, and don't know what's best cost-wise vs separation of concerns etc. 

## Requirement 1: deploy app and servers
1. Front-end React app
2. Back-end graphql server (the front-end queries this server and my server updates my postgres database) - graphql only exposes a single endpoint
3. A stripe webhook server (that listens for stripe events and then updates my postgres database accordingly) - it must expose a single endpoint that Stripe can access
4. A RESTFUL tracking server (that just listens for REST API calls and updates my postgres database) - exposes multiple endpoints

I also need to have a staging test server that I can push and test code changes to (where the URL is not accessible to the public) and a real production server (with public access).

## Requirement 2: deploy my postgres database
I also have a Postgres database that I need my servers to be able to interact with, which also needs to run a daily stored procedure (that changes my database) and monthly script (that calls stripe APIs and changes my database).

## Requirement 3: my app must access sensitive information
I also have a process.env file that I need to store somewhere safe and have my app be able to access the sensitive information.

I need to know how to deploy everything and satisfy all of the requirements.

What specific AWS deployment options do I have for everything? Any advice would be appreciated, thanks.
Task 1
Published: 2024-01-27 10:05:06

software testing is the way assess the quality of software and its reduce the risk of failure. Software testing is the process of test planning analysis, designing, implements and reports. Analysing the product requirements for the completeness and correctness in various contexts like industry perspective, business perspective, usability, performance, security. 
Reviewing the product architecture and the overall design of the product. Working with the product developers on improvement in the coding technique, design patterns, test can be written as part of code based on various techniques like boundary conditions.

software testing imperative as it identifies any issues and defects with the written code so they can fix before the software product is delivered. Improved the quality

software test is important if there are any bugs or errors in the software, they can be identified early and fixed before the software product is delivered.
The testing of software is the wide array of benefits. The cost effectiveness of the project happens to be the one of the reasons why the companies go software testing servies
How To Use Google Fonts in web app🚀
Tags: google, googlefont, font, webdev
Published: 2024-01-27 09:46:53

As a new web developer, you want to use a different font sometimes so give a chance to Google Fonts it is a very big library for various fonts and I will show you how you can use it on your website.

You can you this Google font in 2 ways:

1. include it in HTML.
2. include it in CSS.

**HTML:**
 1. Go to website https://fonts.google.com/
 2. select any font you want and click on Get Font.
 
![get font](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9c1i8q2pgtaa98cixpuv.png)

3. Then click on Get embed code.
4. then copy the code for HTML and add your head tag in your HTML.
 
![font code](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kzp7m7y791e2qskux79d.png)

**CSS:**

1. After clicking on get embed code.
2. Then click on the import radio button copy the code and add it to your CSS file.

![include in css](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/16ttth6kdwp1zc0m0cjs.png)

After this, you can now use this new font in your styles in the following way


![use font](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ltlsldp4to00cqr2exvz.png)
Enlightr - E-learning multipage theme. Built with Astro, Tailwind CSS & MDX
Tags: webdev, javascript, tailwindcss, astro
Published: 2024-01-27 09:30:19

Enlightr - E-learning multipage theme
Built with Astro, Tailwind CSS & MDX

- 44 Pages
- 50+ Sections
- 80+ Components

See it live and learn what's included:
https://lexingtonthemes.com/info/enlightr/

A bright and inviting design with a mix of pastel colors, tailored for an e-learning platform, providing a friendly and approachable feel.


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

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

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

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p6yflrynej30l03e649j.png)
Why Tesla Homes?
Published: 2024-01-27 09:10:03


Tesla's innovative approach extends beyond electric vehicles. They're making waves in sustainable home solutions, from solar panels to energy-efficient designs. Let's dive into how Tesla is reshaping the landscape of eco-friendly living.

Solar-Powered Homes 🌞
Discover how Tesla's solar panels are transforming homes into energy hubs. Harness the power of the sun to fuel your daily life sustainably.

Smart Home Integration 🏠🔒
Explore [Tesla smart home](https://teslahomesguide.com) technologies, promoting energy efficiency and seamless integration with your lifestyle. From automated climate control to energy monitoring, it's about making sustainable choices effortlessly.

Electric Vehicles for Greener Commutes 🚗🍃
It's not just about homes; Tesla's electric vehicles play a crucial role in reducing carbon footprints. Learn how these vehicles contribute to a sustainable future.

Get Involved!
Share your thoughts on sustainable living and the role of technology in shaping a greener world. Have you integrated sustainable tech into your lifestyle? Any tips or experiences to share?

Connect with Tesla Homes Enthusiasts 💬
Drop your comments, questions, or experiences below! Let's build a community passionate about sustainable tech and eco-friendly living.

Don't forget to check out [Your Website] for more in-depth articles, guides, and resources on Tesla Homes, sustainable technology, and the future of eco-friendly living!

Together, let's make sustainable living the new norm. 🌱💚

#SustainableTech #TeslaHomes #EcoFriendlyLiving #RenewableEnergy #SmartHome #GreenTech
Prestige Rock Cliff: Raising the Bar for Luxurious Living in Hyderabad's Banjara Hills
Tags: prestigerockcliff, hyderabad, apartments, flats
Published: 2024-01-27 09:09:32

[Prestige Rock Cliff](https://www.prestigerockcliff.org.in/), an architectural wonder, dominates the skyline in the vibrant center of Banjara Hills, Hyderabad. This illustrious real estate firm has reinvented luxury living in addition to carving out a name for itself. Tucked away in one of the wealthiest areas in Hyderabad, Prestige Rock Cliff is a symbol of refinement, ingenuity, and an unwavering dedication to quality.
**Unveiling Prestige Rock Cliff**
Situated in the esteemed Banjara Hills neighborhood, [Prestige Rock Cliff](https://www.prestigerockcliff.org.in/) is more than just a residential address—it's a representation of luxury and sophisticated living. The painstakingly crafted buildings, richly detailed, are a testament to the company's commitment to [building](https://us.community.sony.com/s/profile/005Dp000003SFam) residences that are classic works of art as well as functional living quarters.
**Architectural Grandeur in Banjara Hills**
The [architectural](https://hyderabad.craigslist.org/ats/d/prestige-rock-cliff/7711673846.html) magnificence that Prestige Rock Cliff bestows onto Banjara Hills is irresistible. With their Victorian-inspired facades and modern interiors, the apartments exhibit an impeccable fusion of classic and contemporary design features. The outcome is a tasteful combination that appeals to people with a refined sense of style and a taste for opulent living.
**Amenities and Beyond: A Lifestyle Redefined**
Prestige Rock Cliff offers a wide range of amenities to meet the various needs and preferences of its inhabitants, going beyond the traditional notion of [residential](https://www.nicovideo.jp/user/131988552) living. Modern exercise facilities, beautifully designed gardens, and gathering areas for people to mingle are just a few of the features that enhance the enclave's quality of life.
**The Prestige Legacy**
In the [real estate](http://healingxchange.ning.com/video/provident-botanico) business, Prestige Rock Cliff is an essential component of the wider Prestige Group, a company known for reliability and distinction. The Prestige Group has a decades-long history of delivering outstanding projects that are standards for excellence and innovation.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5sy76ve0dab7b9c15q7k.jpg)
OpenAI's Exciting Updates: New Models, Lower Prices, and Enhanced Developer Tools
Published: 2024-01-27 09:08:17

**Introduction**
OpenAI has recently announced a series of exciting updates!

**New Embedding Models**

• **Small Text Embedding Model** (text-embedding-3-small)
  - Upgraded Performance: Significant improvement over its predecessor, text-embedding-ada-002. Performance on MIRACL increased from 31.4% to 44.0%, and on MTEB from 61.0% to 62.3%.
  - Reduced Pricing: 5X cheaper than text-embedding-ada-002, priced at $0.00002 per 1k tokens.
  - Continued Support for text-embedding-ada-002: For those who prefer the previous model.

**Large Text Embedding Model** (text-embedding-3-large)
  - Enhanced Capabilities: Capable of creating embeddings up to 3072 dimensions.
  - Superior Performance: Outperforms text-embedding-ada-002 on MIRACL (54.9%) and MTEB (64.6%).
  - Cost-effective Pricing: Available at $0.00013 per 1k tokens.

**Flexibility in Embeddings Usag**e
The new models allow developers to adjust embedding sizes for a balance between performance and cost. 

👁 Updated Models and Lower Pricing

**GPT-3.5 Turbo Model (gpt-3.5-turbo-0125)**
  - Price Reduction: Input prices cut by 50% to $0.0005 per 1K tokens, and output prices by 25% to $0.0015 per 1K tokens.
  - Enhanced Accuracy: Improved response format accuracy and a fix for a non-English language text encoding issue.

**GPT-4 Turbo Preview Model (gpt-4-0125-preview)**
  - Advanced Capabilities: Better at completing tasks like code generation and fixing previous model limitations.
  - Continuous Upgrades: The introduction of a new model alias for automatic updates to the latest GPT-4 Turbo model.

**New Developer Tools**
• API Key Management: Developers can now assign specific permissions to API keys for more controlled access.
• API Usage Insights: Enhanced tracking and reporting features for API usage, enabling better management and optimization.

**🛡 Enhanced Safety with Updated Moderation Model**
The new text-moderation-007 model, with improved capabilities to identify harmful text.

Source [rozetka.pl](https://rozetka.pl/)
100 Tips from The Pragmatic Programmers Book: Part 1/10
Tags: career, thepragmaticprogrammer, books, programming
Published: 2024-01-27 09:04:50

### 1. Care About Your Craft.
> Why spend your life developing software unless you care about doing it well?
> Why do you write software? Is it just a job, a means to an end, or is it something more? Do you take pride in your work, or do you just churn out code that barely works?

&nbsp;

### 2. Think! About Your Work.
> Turn off the autopilot and take control. Constantly critique and appraise your work.
> Do you ever find yourself writing code without thinking? Do you ever copy and paste solutions from the internet without understanding them? Do you ever follow instructions blindly without questioning them?

&nbsp;

### 3. You Have Agency.
> It’s your life. Grab a hold of it and make it what you want.

&nbsp;

### 4. Provide Options, Don’t Make Lame Excuses.
> Instead of excuses, provide options. Don’t say it can’t be done; explain what can be done.

&nbsp;

### 5. Don’t Live with Broken Windows.
> Fix bad designs, wrong decisions, and poor code when you see them.

&nbsp;

### 6. Be a Catalyst for Change.
> You can’t force change on people. Instead, show them how the future might be and help them participate in creating it.

&nbsp;

### 7. Remember the Big Picture
> Don’t get so engrossed in the details that you forget to check what’s happening around you.

&nbsp;

### 8. Make Quality a Requirements Issue.
> Involve your users in determining the project’s real quality requirements.

&nbsp;

### 9. Invest Regularly in Your Knowledge Portfolio.
> Learning is essential for programmers. Don’t stop at what you know. Explore new topics, skills, and technologies. Invest in your knowledge portfolio regularly. Make learning a habit.

&nbsp;

### 10. Critically Analyze What You Read and Hear.
> Don’t be swayed by vendors, media hype, or dogma. Analyze information in terms of you and your project.

&nbsp;

Thanks for reading, happy coding 😀
Streamlining JavaScript Development with PackageFlex: One-Click Copy for npm Install Commands
Tags: chromeextension, npm, yarn, bunjs
Published: 2024-01-27 08:55:44

Hello fellow developers! Today, I'm thrilled to introduce a tool that's going to revolutionize the way you work with npm packages. Say hello to **PackageFlex Chrome Extension** – your shortcut to streamlined npm install commands!

### The Frustration

As JavaScript developers, we've all been there. You find a fantastic npm package, and you're ready to integrate it into your project. But, oh boy, the process of copying the install command and ensuring it aligns with your preferred package manager can be a bit of a headache. 

### Introducing PackageFlex

PackageFlex is designed with one goal in mind – to simplify the npm package management process. With this Chrome Extension, you can now copy install commands for npm, yarn, pnpm, or bun with just one click! No more toggling between documentation pages or manually adjusting commands.

### Key Features

- **One-Click Copy:** Easily copy install commands for npm, yarn, pnpm, and bun with a single click, saving you time and frustration.

- **Enhanced Experience:** Enjoy a streamlined npm website interface that integrates seamlessly with your preferred package manager.

- **Flexibility:** Whether you're a fan of npm, yarn, pnpm, or bun, PackageFlex adapts to your workflow, making it the perfect companion for every JavaScript developer.

### How It Works

1. **Installation:** Get started by installing the PackageFlex Chrome Extension. Simply clone the repository or download the ZIP file, enable developer mode in Chrome, and load the extension.

2. **Usage:** Visit the npm website and navigate to your desired package. Look for the PackageFlex icon in your browser's toolbar. Click on the icon to open the options menu, choose your preferred package manager, and click "Copy" – it's that easy!

### Before

!["WITHOUT CHROME EXTENSION 😭"](https://raw.githubusercontent.com/bhumit070/PackageFlex/main/images/before.webp)

### After

!["WITH CHROME EXTENSION 😎"](https://raw.githubusercontent.com/bhumit070/PackageFlex/main/images/after.webp)

### Ready to Try PackageFlex?

Head over to the [PackageFlex GitHub repository](https://github.com/bhumit070/PackageFlex) to explore the code, and installation instructions, and contribute to the project.

### Conclusion

PackageFlex is not just a tool; it's a game-changer for JavaScript developers looking to streamline their workflow. Try it out, share your thoughts, and let's make JavaScript development even more enjoyable together!

Happy coding! 🚀💻