teleren/devto huggingface dataset:
User Secrets in your .NET Project
Published: 2023-05-11 21:07:42

Genarally, we need to include some sensitive data in our appsettings.json file, like a connection string that content a username and password or a something kind of private key: 

```json
{
  "ConnectionStrings": {
    "MongoDb": "mongodb://mongoadmin:secret@127.0.0.1:27017/aurora/?authSource=admin"
  }
}
```

However, the exposure of these credentials is not safe and is not a good practice either. And, when a developer get your repository, maybe they need to do adjust your docker images or change the sensitive data/connection strings to attend the project.

Let's see how can we solve this! 🤓

## User Secrets
This is a way that allows us to manage sensitive data for .NET on local development.

So, to configure it in your project, you'll need something like below in your Startup/Program class:

```csharp
WebApplication 
    .CreateBuilder(args)
    .Host
    .ConfigureAppConfiguration((context, configurationBuilder) =>
    {
        configurationBuilder
            .AddUserSecrets(Assembly.GetExecutingAssembly())
            .AddEnvironmentVariables();
    })
```

Now, we need to configure our secrets, right?
First, let's open the startup project folder and, next open the terminal, and follow the commands below:

* To enable secret storage: 
`dotnet user-secrets init`

* To add a secret: 
`dotnet user-secrets set "ConnectionStrings:MongoDb" "[YOUR CONNECTION]"`

* To add a secret in a list: 
`dotnet user-secrets set "PrivateKey[0]" "[YOUR KEY]"`
`dotnet user-secrets set "PrivateKey[1]" "[YOUR KEY]"`

* To list the secrets:
`dotnet user-secrets list`

* To remove a secret:
`dotnet user-secrets remove "ConnectionStrings:MongoDB"`


---

## Conclusion
* Never store passwords or other sensitive data in source code
* Production/Staging/Development should not be used for local test/development
* Sensitive data should not be deployed with the app
* You should store sensitive data in a protected environment/tool, like Azure Key Vault

---

## References
* https://learn.microsoft.com/en-us/aspnet/core/security/app-secrets?view=aspnetcore-7.0&tabs=windows
Why don’t devop and services have apps?
Tags: devops, webdev, security
Published: 2023-05-11 20:50:57

Companies like Vercel, Firebase, MongoDB, PosgreSQL, Supabase, Prisma, Netlify, Heroku, ect POPULAR COMPANIES….
DONT HAVE MOBILE APPS…

They may have a mobile site, BUT, as far as a more secure, notifications and features…

They fail to modernize


Why?
[Tiny] How to Group List Elements in Java
Tags: java, tiny
Published: 2023-05-11 20:43:34

If you need to group list elements by some property of an element, `Collectors.groupingBy()` methods could help.

Here is an example:

```java
record Comment(Author author, String text, CommentType commentType) { }
record Author(String name) {}
enum CommentType {
    GREETING, QUESTION, OTHER
}
```

Now, we have a list of comments:

```java
List<Comment> comments = ...;
```

And we want to group comments by author, i.e., convert this list into `Map<Author, List<Comment>>`. Here is how we can do this:

```java
public Map<Author, List<Comment>> groupByAuthor(List<Comment> comments) {
    return comments.stream().collect(Collectors.groupingBy(Comment::author));
}
```

And if we want to go further and group comments by author first, and then by comment type, then we can do it like this:

```java
public Map<Author, Map<CommentType, List<Comment>>> groupByAuthorAndType(List<Comment> comments) {
    return comments.stream()
            .collect(Collectors.groupingBy(
                    Comment::author, Collectors.groupingBy(Comment::commentType)
            ));
}
```

There are many more use cases where the three `Collectors.groupingBy()` methods could help. Take a look at Javadocs for more details.

---

_Dream your code, code your dream._
CREATING A VIRTUAL MACHINE SCALE SET AND A LOAD BALANCER IN IT.
Tags: azure, tutorial, beginners
Published: 2023-05-11 20:28:08

**STEP 1**:
a. On your azure portal, search for "Scale set" and click on it.
b. Click on "Create"
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5twe3pqee80xj6ucu340.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dbpsgedrxqkkz93w50t4.png)

**STEP 2**:
a. Select your subscription and your resource group .
b. Choose a name of the virtual machine, give the administrator account a name and password.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nt11gefvypxtv259cqk5.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/de15fk6s8mlb318g113b.png)

**STEP 3**:
a. Go to "Networking" and click on "enable load balancer.
b. Go to "Scaling" and increase it to 2 or more. Here, i used 2 instances.
c. Go to "Health" and click on "enable application health monitoring"
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dj09cnr6kfkju5i0hsrt.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/winqyh1tz4e95qv2ahbb.png)

**STEP 4**:
a. Click on "review+create
b. After validation has passed, click on "Create and wait for it to deploy.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9lmoa8b68b66s96i818p.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gpilvizbwefr2zrkmhm7.png)

**STEP 5**:
a. After  deployment is complete, click on "Go to resource"
b. You can click on instance to see the 2 instances running.
c. Click on "Scaling", then choose either Manual or Custom scale depending on what you want.
d. You can also change your instances to any number you want.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ldwtrc71b3i7gjtazm50.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w9h0x2olg3ksrvuhsore.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qaqi27qbbsrhub0mzmub.png)

* Manual scale means you configure everything yourself.

*Custom means you want everything done automatically for you and you can add your conditions by scrolling down the page then click on "scale condition".
Google My Business: Why It's Perfect for Local Businesses
Published: 2023-05-11 20:17:33

If you're a local business, Google My Business is the perfect platform for you. It's easy to set up and manage, and it gives you a lot of control over how your business is represented online. Plus, it's a great way to connect with customers and attract new ones.

## 1. What is Google My Business?

Google My Business is a free service offered by Google that allows businesses to create a business listing on Google. The business listing includes the business name, address, website, and phone number. Businesses can also add photos, videos, and product information. Google My Business also allows businesses to create a Google+ page.

## 2. Why is Google My Business a good option for local businesses?

Google My Business is a great option for [local SEO businesses](https://perfectdigitals.ie/service/seo/) because it allows you to control how your business is displayed on Google. You can create a free listing with basic information about your business, and you can also add photos, videos, and more. You can also respond to reviews and update your business information whenever you need to. This makes it easy for customers to find your business and learn more about what you offer.

## 3. How can businesses make the most of Google My Business?

There are a number of ways businesses can make the most of Google My Business. One of the most important is making sure all of the information is correct and up to date. This includes the business name, address, and phone number. It's also important to make sure the business is categorized correctly.

Another way businesses can make the most of Google My Business is by using the features Google provides. For example, businesses can add photos, videos, and articles. They can also add a Google+ page and link it to the business listing. This helps create a complete profile and allows customers to find and learn more about the business.

Businesses can also use Google My Business to connect with customers. They can post updates and announcements, and respond to customer reviews. This helps create a connection with customers and builds trust.

## 4. What are the benefits of using Google My Business?

Google My Business is a free and easy-to-use tool that helps local businesses connect with customers on Google. It includes a free website, free business listing, and free Google Maps listing.

The benefits of using Google My Business include:

1. Increased visibility on Google.

2. Increased online visibility and traffic.

3. Increased customer engagement.

4. Improved customer conversion rates.

5. Easier management of customer information.

6. Greater reach to potential customers.

7. More accurate local search results.

8. Better customer retention.

9. Increased brand awareness.

10. Cost-effective marketing tool.

So if you're looking for an easy way to get your business online, Google My Business is a great option. And don't forget, it's free! So why not give it a try?
How do you treat yourself to rest and breaks while working?: CodeNewbie Podcast
Tags: discuss, beginners, codenewbie, productivity
Published: 2023-05-11 20:10:21

## We released our first episode of Season 24 of our podcast yesterday!

In case you missed it, we had on [Tae’lur Alexis](https://twitter.com/TaelurAlexis?ref_src=twsrc%5Egoogle%7Ctwcamp%5Eserp%7Ctwgr%5Eauthor), a self taught software developer, application security enthusiast and content creator. Saron and Tae’lur talked about building a personal brand,   creating your career as a self-taught developer, cultivating good working habits, and much more! 

If you didn’t get a chance to listen yet, have no fear— you can totally still engage in this conversation below! If you do want to listen, here is the link to find the podcast OR find it wherever you like!

{% embed https://www.codenewbie.org/podcast/from-customer-service-to-cybersecurity %}

## Before we get into the #discuss bit of it all, we would love to just share some quick things we liked from the podcast to get your brain moving a bit:

1. Breaks are super important so you don’t get burnt out! Building them into your workday through tools like the [Pomodoro Technique](https://www.techtarget.com/whatis/definition/pomodoro-technique#:~:text=What%20is%20the%20Pomodoro%20Technique,after%20four%20consecutive%20work%20intervals) can help create structure to your day. 
2. Personal branding + social media documentation/presence can help you build networks as a self-taught developer.
3. Stop questioning if you are ready to do/learn something new, there will never be a “right” time to challenge yourself, that time should be now! 

I know for myself, I have a super hard time mitigating burnout while I work, because I get super excited about a project and end up realizing my head hasn’t gone past the screen in, well, too long. I actually **just now** put on headphones to start working and meant to choose music and then I realize I am around an hour in and never actually turned any on…it happens to the best of us. 

## Here are my questions for you all this week, inspired by the podcast. I would love to hear your thoughts!

1. What does self-care look like to you?
2. How do you know when you are ready to burn a bridge with someone who isn’t treating you how you deserve to be treated?
3. How do you treat yourself to rest and breaks while working?

Let us know what helps you create healthy habits and boundaries below and listen to the podcast if you haven't already!
Tech Hiring in 2023: Trends, Predictions & Strategies for Success
Tags: career, devops, interview, podcast
Published: 2023-05-11 20:00:00

The tech industry has seen a significant change in the skills, qualifications, and titles listed in job postings over the past few years. What does that mean for companies - and for the candidates themselves? 

On this week’s episode of Dev Interrupted, we talk to Maryam Jahanshahi co-founder and Head of R&D at Datapeople, who breaks down the biggest hiring trends in tech from title inflation to salary transparency and the skyrocketing costs of recruitment. 

Maryam also discusses how the storytelling skills she picked up from data analysis have improved her abilities as a founder.

>*“In the last year [title inflation] has gone through a crazy uptick. That's tied to the labor market. It's tied to companies trying to lure and attract candidates because it's really hard to hire in tech.” - Maryam Jahanshahi*

{% spotify spotify:episode:54WWS3Qw2YFOgKr4TeW0yC %}

## Episode Highlights:
* (2:05) Introductions
* (6:13) Title inflation trend
* (11:00) Hiring trends: salary transparency
* (16:11) Bringing data to the recruiting process
* (21:55) How Datapeople is leveraging ML
* (27:30) AI job trends
* (31:30) The importance of storytelling
* (35:42) Maryam's advice for founders

[Read the full episode transcript here.](https://devinterrupted.com/podcast/tech-hiring-in-2023-trends-predictions-strategies-for-success/)

---

While you’re here, check out this video from our YouTube channel, and be sure to like and subscribe when you do!

{% youtube 1vfkQ-y9laU %}

---

## A 3-part Summer Workshop Series for Engineering Executives
Engineering executives, [register now](https://linearb.io/events/2023-summer-series/?utm_source=Dev.to&utm_medium=referral&utm_campaign=202306%20-%20Event%20-%20Summer%20Series%20-%20Podcast%20Distribution) for LinearB's 3-part workshop series designed to improve your team's business outcomes. Learn the three essential steps used by elite software engineering organizations to decrease cycle time by 47% on average and deliver better results: Benchmark, Automate, and Improve.

Don't miss this opportunity to take your team to the next level - [save your seat today](https://linearb.io/events/2023-summer-series/?utm_source=Dev.to&utm_medium=referral&utm_campaign=202306%20-%20Event%20-%20Summer%20Series%20-%20Podcast%20Distribution).

[![Register Today](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nd6b3egikvnssdi9x50g.png)](https://linearb.io/events/2023-summer-series/?utm_source=Dev.to&utm_medium=referral&utm_campaign=202306%20-%20Event%20-%20Summer%20Series%20-%20Podcast%20Distribution)
How to get started with github copilot
Tags: github, githubcopilot, webdev, programming
Published: 2023-05-11 19:55:49

Originally published by me at [miracool.hashnode.dev](https://miracool.hashnode.dev/how-to-get-started-with-github-copilot)

GitHub Copilot is an AI-powered code assistant that helps developers write code more efficiently. It makes use of machine learning models that have been trained on a substantial corpus of code to recommend pertinent code fragments, functions, and even entire classes. When working on big projects with several lines of code, this tool can help software engineers save a ton of time and effort. Here's how to get started using GitHub Copilot if you're interested:

**Step 1: Sign up for copilot**

GitHub Copilot is generally accessible to all developers for $10 monthly or $100 yearly , you can also get it for free if you have sign up for github student pack and you have been confirmed as a student by github. Also, project maintainers of well-known open source initiatives can also use it for free. You must register on the GitHub Copilot website in order to access it, when your account is ready, you'll get an email message after you sign up.

**Step 2: Install the VS Code extension**

GitHub Copilot works as an extension for Microsoft Visual Studio Code. If you haven't already, you'll need to download and install VS Code from the official website.The GitHub Copilot addon can be downloaded from the Visual Studio Code Marketplace once VS Code has been installed. Open VS Code, select the Extensions view (Ctrl+Shift+X), and look for "GitHub Copilot" to accomplish this. To include the extension in your VS Code installation, click the "Install" button.

**Step 3: Set up GitHub Copilot**

Before you can start using GitHub Copilot, you'll need to link it to your GitHub account. To do this, open VS Code and go to the Command Palette (Ctrl+Shift+P). Type "GitHub Copilot: Sign in" and press Enter. This will open a web page where you can sign in to your GitHub account and authorize GitHub Copilot to access your repositories.

**Step 4: Start using GitHub Copilot**

Now that you've set up GitHub Copilot, you can start using it to write code. To activate GitHub Copilot, simply start typing code in a new or existing file. As you type, GitHub Copilot will suggest code snippets, functions, and classes that match what you're trying to do. You can select one of these suggestions by pressing the Tab key. GitHub Copilot will then insert the selected code into your file.

In conclusion, GitHub Copilot is an exciting new tool that can help developers write code more efficiently. By following these steps, you can get started with GitHub Copilot and start using it to improve your coding workflow. Remember to provide feedback to the GitHub Copilot team to help improve the tool and make it even more useful for developers.
The Great Debate : Python Vs Java
Tags: discuss, python, java, codenewbie
Published: 2023-05-11 19:55:14

Python and Java are two of the most popular programming languages in the world. While both languages have their own unique features and strengths, they are often compared and contrasted due to their similarities in use cases.

Python is a high-level, interpreted language that is known for its simplicity and ease of use. It is often used for data science, machine learning, and web development, as well as a general-purpose language for scripting and automation. Python's syntax is concise and easy to read, making it a popular choice for beginners.

On the other hand, Java is a class-based, object-oriented language that is known for its reliability and security. It is often used for enterprise-level applications, as well as Android app development. Java's syntax is more verbose than Python's, but it offers a greater degree of control and scalability.

So which language is better, Python or Java? The answer depends on the specific use case and the preferences of the developer. Python may be a better choice for data science and web development, while Java may be better for enterprise-level applications. Ultimately, the choice between the two languages will come down to factors such as personal preference, project requirements, and the developer's experience level.

What are your thoughts on the Python vs Java debate? Have you worked with either language before? Which do you prefer and why? Let us know in the comments below.
What are the essential skills that a beginner developer should learn?
Tags: discuss, tutorial, codenewbie
Published: 2023-05-11 19:50:01

Calling all developers and aspiring programmers! Are you just starting out on your coding journey and wondering what skills you need to succeed? Look no further, because today we're diving into the essential skills that every beginner developer should learn.

As the world becomes more and more digital, the demand for skilled programmers continues to grow. But with so many programming languages and tools out there, it can be overwhelming for beginners to know where to start. That's why we've compiled a list of the must-have skills that will set you on the path to success.

First and foremost, a beginner developer needs to have a strong foundation in programming fundamentals. This includes understanding concepts such as variables, data types, control flow, and functions. Once you have a solid grasp of these core concepts, you'll be able to pick up new programming languages and frameworks much more easily.

Next, it's important to have a good understanding of data structures and algorithms. These are the building blocks of efficient and scalable software. Learning how to work with arrays, linked lists, trees, and other data structures will help you write more complex programs and solve more challenging problems.

Another essential skill for beginner developers is familiarity with version control tools like Git. These tools allow you to track changes to your codebase and collaborate with other developers. Learning how to use Git will help you work more efficiently and effectively as part of a development team.

In addition to technical skills, beginner developers should also focus on developing their communication and collaboration skills. The ability to work well with others, communicate clearly, and give and receive feedback is essential for success in the tech industry.

Finally, it's important for beginner developers to have a growth mindset and a willingness to learn. The world of technology is constantly evolving, and the tools and languages we use today may not be relevant tomorrow. Staying curious, open-minded, and willing to learn will ensure that you stay on top of the latest trends and technologies.

So, there you have it – the essential skills that every beginner developer should learn. But what do you think? Are there any other skills that you would add to the list? Have you found any particular resources or approaches that have been helpful in your own journey as a developer? We'd love to hear your thoughts and experiences in the comments below!
Acknowledgment: this was written with the help of but not by ChatGPT.
How the JavaScript code works behind the scene ?
Tags: javascript, webdev, beginners, frontend
Published: 2023-05-11 19:40:40

 I have seen a lot of people who know frontend but don't know very well how JavaScript works. In this post, I will share my learning so that if anyone asks you about this topic, or if an interviewer asks you a question related to this topic, you will not be confused. Let's start! :
  
**W**hen we run our **JavaScript** code , at that time JavaScript engine execute that code in two phases that is
1-creation phase
2-execution phase

- 
In **creation phase** , memory is allocated to all the variables and functions , for variables a special value **Undefined** is assigned to all **variables** and for **function** entire code gets copied in memory,

- 
in **execution phase** js code is executed line by line and in this phase undefined value of variable is replaced by actual value that we were assigning in that variables

```
for ex:- let a=20 
```
so firstly in creation phase memory is allocated to variable **a** with undefined value 
after that in execution phase value 20 is assigned to **a**.


![wait a minute guys](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3pjsg6b85s4pns9hkr4a.jpeg)

So here very interesting topic comes in picture that is **hoisting** .
In Hositing you can use a variable or function before it is declared, and JavaScript will still be able to find it.

However, variables created using the 'let' and 'const' keywords are also present in the TDZ (temporal dead zone), so we cannot access those variables before defining or declaring them. Attempting to do so will result in an error.
```
 console.log(a);
let a=20;
output :you can not access it before declaring 
```
However, if we use the 'var' keyword with variables, the variables that are created using the 'var' keyword do not exist in the TDZ. Therefore, accessing them before declaring or defining them will not result in an error, but will instead show 'undefined'.
```
console.log(a);
var a=20;
ouput: undefined
```
But It's generally a good practice to declare all variables and functions at the top of their respective scopes
I hope you will get useful information and I welcome your suggestion 😀