teleren/devto huggingface dataset:
Installing Apache or Nginx on Amazon EC2 Linux 2 AMI using a user data script
Tags: aws, webdev, ec2, linux
Published: 2023-10-13 04:47:02

When you're going to host a website on an Amazon EC2 instance by using an Amazon Linux 2 AMI, you need to set up a web server.

It can be either Apache or Nginx.

Installing a web server manually by SSH into the instance later once you spin up the instance will be easier when you are dealing with only 1 instance.

But when you're going to deal with a fleet of instances that will have 3-4 instances, this will be a time-consuming thing. 

Ex:- You're going to configure an ALB (Application Load Balancer) with different target groups. In that case, you'll need to maintain the same web server across several EC2 instances.

Therefore, the most efficient way is to add a bash script under "User data" section in "Advanced details" when you're going to create an EC2 instance, and before you spin up the instance.


![Advanced details](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qbwmlr6yh4zjlfwmik4w.png)

Add the script here.


![User data](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wm2weo7o0nx72lnplf5d.png)

Script to install Apache web server.

`#!/bin/bash
yum update -y
yum install -y httpd
systemctl start httpd
systemctl enable httpd`

Script to install Nginx web server.

`#!/bin/bash
yum update -y
amazon-linux-extras install nginx1 -y 
systemctl enable nginx
systemctl start nginx`
JavaScript Shorthand Techniques
Tags: javascript, tutorial, webdev, react
Published: 2023-10-13 04:41:37

In today's fast-paced world of web development, efficiency and readability are essential. Have you ever found yourself wading through lines and lines of JavaScript, feeling overwhelmed? Or perhaps, while coding, you've wished for a more concise way to express common patterns. Bloated code not only reduces readability but can also impact performance and maintainability.

Long-winded JavaScript expressions can:

- **Increase Development Time:** Writing and reading extended versions of common operations can drastically reduce your coding speed.
- **Compromise Code Quality:** More verbose code can introduce more chances for errors. It's easy to lose track amidst the clutter.
- **Hinder Collaboration:** Your teammates might find it challenging to navigate and understand your code, leading to inefficiencies in team-based projects.
- **Impair Performance:** Inefficient code can sometimes be a bottleneck, especially in performance-critical applications.

The solution? JavaScript shorthand techniques. These are concise ways to represent common operations, allowing you to write cleaner, more efficient, and more readable code.

**Here are some powerful JavaScript shorthand techniques:**

**1.Variable Assignment:**

Traditional:
```javascript

let newName;

if (name) {
  newName = name;
} else {
  newName = 'Default';
}

```

Shorthand:
```javascript
const newName = name || 'Default';
```

**2.Conditional (Ternary) Operator:**

Traditional:
```javascript
let result;

if (isValid) {
  result = 'Valid';
} else {
  result = 'Invalid';
}
```

Shorthand:
```javascript
const result = isValid ? 'Valid' : 'Invalid';
```

**3.Default Parameters:**

Traditional:
```javascript
function multiply(val1, val2) {
  val2 = typeof val2 !== "undefined" ? val2 : 1;
  console.log(val1 * val2);
}
```

Shorthand:
```javascript
function multiply(val1, val2 = 1) {
  console.log(val1 * val2);
}
```

**4.Arrow Functions:**

Traditional:
```javascript
const add = function(x, y) {
  return x + y;
}
```

Shorthand:
```javascript
const add = (x, y) => x + y;
```

**5.Template Strings:**

Traditional:

```javascript
console.log('Hello, ' + name + '! Welcome to our platform.');
```

Shorthand:

```javascript
console.log(`Hello, ${name}! Welcome to our platform.`);
```

These are just a few examples. The world of JavaScript is filled with such shorthand techniques, especially with the latest ES6 features.

## Conclusion:
Don't let bloated code weigh down your JavaScript projects. Embrace shorthand techniques to make your code more concise, efficient, and readable. These techniques will not only make your development process smoother but will also elevate the quality of your applications. Dive into shorthand techniques today and transform your JavaScript journey!
My First Open Source Journey: Adding a TLDR Page to the tldr project
Tags: opensource, developer, programming
Published: 2023-10-13 04:35:14

I decided to Start the path towards creating open-source software with the "TLDR" project, a repository that contains a number of community's-maintained help pages for CLI tools. 
I started the investigation when I made the decision to look at the "Good First Issue" Difficulties. I narrowed down my choices till I found one that caught my attention and offered a satisfying challenge. 
The [issue](https://github.com/tldr-pages/tldr/issues/6141) opened me to a new concept about Azure Kubernetes Service(AKS). The 'AKS' command is the official CLI tool for controlling Azure Kubernetes Service clusters is the subject of the project to developed a 'TLDR' Page.
I have also went into the TLDR community in order to address this enormous problem, looking for advice and assistance. Through the project's Matrix group chat group. I made connection with other contributors, sharing my experience and seeking guidance from others who had already successfully navigated these big projects.
The centerpiece of my contribution was a painstakingly written 'az-aks.md' file that adhered to the exact structure and rules specified in the TLDR manual. In order to help command-line users learn this potent tool, it needed reducing a profusion of 'AKS' command nuances into a succinct collection of usage examples. The procedure was a learning experience like no other. Along with learning about the Azure Kubernetes Service, I also gained knowledge about good documentation and the subtleties of working with open-source communities. I experienced both roadblocks and lightbulb moments along the way, and each helped me become a more knowledgeable advocate for open-source software. It was time for me to submit my masterpiece after all of the hard work. I started a pull request and sent the 'aks.md' file to the TLDR repository, which is available the [PULL REQUEST](https://github.com/tldr-pages/tldr/pull/10964). This moment was unmatched in its thrill and fulfilment. My introduction to the world of open-source contributions began with this. I want to give readers an honest look at the world of open source in this story. I discuss my challenges, insights, and ultimate success in the hopes of motivating other beginners to go off on their own open source experiences.
Top 3 Flutter Packages for Seamless PDF Creation: A Developer's Guide
Published: 2023-10-13 04:30:00

Flutter has become a popular choice for mobile app development due to its versatility and ease of use. When it comes to document management and creation, PDFs remain an essential format. Fortunately, Flutter offers a range of packages that make working with PDFs a breeze. In this blog, we'll explore the top 3 Flutter packages for PDF creation, along with their features and use cases.

Note: All the following packages are Dart 3 compatible, as of 12th October.

**pdf - A Comprehensive PDF Manipulation Package**

The [pdf](https://pub.dev/packages/pdf) package is a versatile and feature-rich Flutter library for PDF generation and manipulation. It allows you to create, modify, and render PDF documents with ease. 

Some key features of 'pdf' include:

- Text and image rendering support.
- Vector graphics capabilities.
- Page layout and formatting options.
- PDF document encryption and protection.

Use Case: 'pdf' is an excellent choice for creating PDF reports, invoices, or documents that require detailed formatting and customization.

**printing - Printing and PDF Generation in One Package**

The [printing](https://pub.dev/packages/printing) package is a handy Flutter library that simplifies PDF generation and printing. It seamlessly integrates printing capabilities into your app, enabling you to print documents or save them as PDFs. 

Key features of 'printing' include:

- Print PDF documents directly from the app.
- Save generated documents as PDF files.
- Easily customize the layout and appearance of your PDF.

Use Case: 'printing' is ideal for apps that need to generate and print PDFs on the fly, such as note-taking apps, receipt generators, or document management tools.

**syncfusion_flutter_pdf - A Professional PDF Generation Solution**

The [syncfusion_flutter_pdf](https://pub.dev/packages/syncfusion_flutter_pdf) package offers advanced PDF creation and manipulation tools for Flutter developers. It's a comprehensive package with a wide range of features:

- Text, image, and table rendering.
- Support for digital signatures.
- Advanced PDF editing capabilities.
- Document security features, including encryption.

Use Case: 'syncfusion_flutter_pdf' is suitable for applications that require professional-quality PDF documents, such as e-signature solutions, legal document management, or complex report generation.

**Conclusion**

Working with PDFs in your Flutter app has never been easier, thanks to these top 3 Flutter packages. Whether you need to create detailed reports, generate PDF receipts, implement e-signature functionality, or simply view and share PDFs, there's a package that suits your needs. Choose the one that aligns best with your project requirements and start creating impressive PDF documents with Flutter today. Happy coding!
After spring upgrade from 2.x to 3.1.0, encountering error for Mono "Operator called default onErrorDropped"
Tags: springboot
Published: 2023-10-13 04:12:30

After spring upgrade from 2.x to 3.1.0, encountering error for Mono "Operator called default onErrorDropped".

However, the expectation is to call "onErrorResume" for any error and not "onErrorDropped".

OnErrorDropped is killing the main thread.

Would like to understand if there was any changes to Reactor library along with Spring upgrade.
Simplifying Date Handling in Swift with Date Extensions
Tags: swift, ios, xcode, apple
Published: 2023-10-13 04:09:05

Date extensions are a valuable feature in Swift, allowing you to add custom methods and properties to the Date type. These extensions can simplify common date-related tasks, making your code more readable, reusable, and efficient.

Full article on medium:

https://medium.com/@vikramios/date-handling-in-swift-with-date-extensions-9642cbd76720
Central Foundations Ltd
Published: 2023-10-13 03:49:12

At Central Foundations Ltd, we take pride in being the top concrete contractors in Tauranga and Canterbury regions. Our team of skilled professionals and state-of-the-art equipment ensure that every project we undertake is completed with the highest quality and efficiency. We specialize in concrete foundations, driveway and patio and more for both commercial and residential buildings. Our years of experience in the industry have allowed us to gain a reputation for our exceptional workmanship and attention to detail. We understand that every project is unique, which is why we work closely with our clients to understand their specific needs and desires. This collaborative approach has resulted in countless successful projects throughout the region. If you're looking for dependable and expert concrete contractors, look no further than Central Foundations.

Visit: https://centralfoundations.co.nz

Email : rob@centralfoundations.co.nz

Ph. No.:- 027 490 6473

Address  : 6/130 Maleme Street, Greerton, Tauranga 3112, New Zealand
My transition from Medium to Dev.to
Tags: webdev, medium, devto
Published: 2023-10-13 03:32:02

As writers, we often find solace in the comfort of a familiar platform, where our words flow freely, and our thoughts find a home. For me, that platform has been Medium. Over time, I've been fortunate to build a following of 113 readers and watched with gratitude as my articles garnered thousands of views. Yet, change is a constant companion in the world of digital content, and I believe it's time to embrace a new chapter in my writing journey.

## Why the Move?

You might be wondering why I'm making this switch, considering the comfort and success I've experienced on Medium. The truth is, while Medium has been a fantastic platform, DEV.to offers a unique and refreshing environment that aligns better with my values as a writer.

**Community-Centric Approach:** DEV.to is renowned for its strong and supportive community, particularly in the tech and development niches. It's a place where writers and readers engage in meaningful conversations, and I'm eager to be part of that.

**Open Source and Flexibility:** DEV.to is open source, which means more control over my content. I can even customize my DEV.to blog to match my personal branding, giving me the freedom to express my unique style.

**No Paywall:** Unlike Medium, DEV.to doesn't have a paywall. My content remains freely accessible to everyone, ensuring that knowledge and ideas are shared without barriers.

**Editorial Freedom:** On DEV.to, I have the freedom to choose my content's licensing and retain full control over my articles. It's all about putting the writer in charge of their own work.

## What to Expect

In the coming weeks and months, I'll be moving my articles from Medium to DEV.to. You can expect to find the same thoughtful insights, in-depth explorations, and discussions on topics that matter to me and, hopefully, to you.

I invite you to follow me on this journey. Join me on DEV.to, where we'll continue the conversation, explore new horizons, and engage with a community that's passionate about writing, learning, and growth.

## Conclusion

Change can be daunting, but it can also be incredibly rewarding. Transitioning from Medium to DEV.to is a step I'm taking with optimism and excitement. I hope you'll come along for the ride, and together, we'll embark on a new chapter of exploration, learning, and connection. Thank you for being part of this journey.

So, without further ado, let's turn the page and dive into this new adventure on DEV.to. I look forward to what lies ahead, and I hope you do too.
From Zero to Full Stack Developer: A Path of Patience and Learning
Published: 2023-10-13 03:30:22

Becoming a full stack developer is a dream for many. It means you can work on both the look of a website (front-end) and the behind-the-scenes mechanics (back-end). However, starting from scratch with no knowledge about coding can seem tough. In this article, we will break down the steps to go from being a complete beginner to a full stack developer. Remember, this journey needs patience as you will face many errors and failed attempts, but with time and effort, success will come.

**Step 1: Get the Right Mindset**
    First, believe that you can learn and improve. Understand that learning to code will take time and effort.

**Step 2: Start with the Basics**
    Begin with learning a simple programming language like Python or JavaScript. Understand the basics like variables, data types, and simple commands.

**Step 3: Move to Web Design**
    After understanding basic coding, learn how to create simple web pages using HTML, CSS, and JavaScript.

**Step 4: Learn Front-end Tools**
   Once you're comfortable, learn tools like React or Vue.js that help make better and interactive web pages.

**Step 5: Explore Back-end Coding**
   Now, learn back-end coding with languages like Node.js or PHP. This will help you understand how to manage data and servers.

**Step 6: Understand Databases and Servers**
   Learn about databases and how to manage servers. This knowledge is key to becoming a full stack developer.

**Step 7: Create Real Projects**
   Start creating your own projects. Begin with small, simple projects and slowly take on bigger challenges. This will help you learn and also build a portfolio of your work.

**Step 8: Join a Coding Community**
   Become part of a community of coders. Learn from others, get feedback on your work, and improve.

**Step 9: Keep Learning**
   Technology changes fast. Keep learning and staying updated on new tools and best practices in web development.


**Enjoy the Journey**
   On this journey, you will face many challenges. There will be errors and failed attempts, but remember, each mistake is a lesson. With patience and continuous learning, you will improve and move closer to your goal of becoming a full stack developer. Each line of code you write takes you one step closer to a successful career in web development.
How to provide detailed type information using "as" and "&"
Tags: typescript
Published: 2023-10-13 03:18:20

Let's say you have created the following callback function:

```ts
const getMyPet = () =>
  document.documentElement.getAttribute('myPet')
// const getMyPet: () => string | null
```

The return value of the function is `string | null`. However, since the argument is specified as myPet, there is a possibility that the returned value is a specific string.

Suppose you have created the following type in advance

```ts
type MyPet = 'tama' | 'pochi'
```

Let's consider how to include the type `MyPet` in the return type of the `getMyPet()` function.

First, let's use the `as` keyword to specify the return type of the function:

```ts
const getMyPet = () =>
  document.documentElement.getAttribute('myPet') as MyPet
// const getMyPet: () => MyPet
```

We have successfully specified the `MyPet` type. However, the `null` type is lost, so let's add it back:

```ts
const getMyPet = () =>
  document.documentElement.getAttribute('myPet') as MyPet | null
// const getMyPet: () => MyPet | null
```

But with this, when we refer to the type information later, the specific contents of the `MyPet` type, i.e., `'tama' | 'pochi'`, will not be displayed. So let's use the `intersection type: &` to display the detailed information to TypeScript:

```ts
const getMyPet2 = () =>
  document.documentElement.getAttribute('myPet') as (MyPet & {}) | null
// const getMyPet2: () => "tama" | "pochi" | null
```

The `(MyPet & {})` part can also be written as `(MyPet & string)` to obtain the same type.

[Please refer to the official documentation for more details on intersection types.](https://www.typescriptlang.org/docs/handbook/2/objects.html#intersection-types)

Although this may be sufficient, let's leave the possibility of receiving other strings besides `'tama'` and `'pochi'`:

```ts
const getMyPet3 = () =>
  document.documentElement.getAttribute('myPet') as (MyPet & {}) | null | (string & {})
// const getMyPet3: () => "tama" | "pochi" | (string & {}) | null
```

By adding `(string & {})`, we get a hint for creating a conditional statement in case a string other than `"tama"` or `"pochi"` is returned.

That's all.

You can check this example on the [TS playground](https://www.typescriptlang.org/play?#code/C4TwDgpgBAsiAKFhQLxQOTAIYFsvqgB8MwB7AYwAsBLdAKDvNIDsBnZAcyTkWTQAoAlKgB8dKFAAmFAK44IzYADpp5OQuABRADYR5ipV2ABBYMABO1AEYzgEfuhwIk6YVlaxnwOgHofUJjZObi8ALighUU9eBkD2KCMeJAAmVAjhFDEJVXUDHP0tXQLDJFMLa1t7Ry9XKHcIpOQAMigAbwBfYWJmGW1tX3844OBG5PDIzKgAImw8KaJpsipqee7e-rpQSGikAHVqYEoAOTkrCHM0zFx8BfQlmgJiAEYGLegAeWZtLyPcaDRGvtDiccGcLi0OgxGCx4okvABmNITLJSWTFfIaHR6DQlExmSw2OwOJy8Wr1fiNKAQzoLHp9Bb8diWZgcKltToDAIw4aNeHjDIiaazLCrRYUGiixnlFlsjpdKB0jZ0IA).
Opinions on the new Fedora Slimbook Ultrabook?
Tags: discuss, linux, opensource
Published: 2023-10-13 03:00:00

Okay, that's quite a mouthful. But recently, Fedora Project has announced its [collaboration ](https://fedoramagazine.org/fedora-slimbook-available-now/)with Slimbook to deliver a new [Fedora Slimbook Ultrabook](https://fedora.slimbook.es/) that comes exclusively with Fedora Software.


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

Aside from the supposed better user experience that goes with shipping laptops with Fedora OS, the specs are also not too bad:

- 16” 16:10 sRGB 99%
- 3K display 90Hz
- Intel® Core™ i7-12700H 20 threads
- NVIDIA GeForce RTX 3050 Ti
- Up to 64GB RAM
- Up to 4TB Nvme SSD
- 82WH battery
- 1.5 kg weight

There don't seem to be any price points or estimates provided yet though.


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


Personally, I love Open Source Software and even though there is quite a learning curve when it comes to switching from Windows or MacOS to Linux, I've loved how easy-to-use and flexible Fedora has been. The GNOME community is also active with bug fixes and feature releases.

But, there are also other devices that ship with Fedora out-of-the-box, like [Lenovo ](https://fedoramagazine.org/lenovo-fedora-now-available/), so I'm wondering what kind of change this product release will bring to the market.

Let me know your opinions!
VNAZ888 - VNAZ888CO
Published: 2023-10-13 02:54:22

VNAZ888 - VNAZ888CO là một tòa nhà đồ sộ của giới giải trí trực tuyến, mang trong mình một sứ mệnh rõ ràng đó là: tạo ra những trải nghiệm giải trí tốt nhất và đa dạng nhất cho người chơi trên khắp nơi trên thế giới. Với tập trung vào lĩnh vực cá cược và trò chơi trực tuyến, VNAZ888 đã nhanh chóng ghi điểm và trở thành điểm đến ưa thích của cả những người yêu thích cờ bạc truyền thống và những game thủ đam mê công nghệ.
VNAZ888 không chỉ là một trang web cá cược thông thường; đó là một cộng đồng đa dạng của những người đam mê giải trí. Với giao diện trực quan và thân thiện, VNAZ888 tạo ra một môi trường trực tuyến an toàn và hấp dẫn. Người chơi có thể dễ dàng duyệt qua một loạt các sự lựa chọn đa dạng, từ cược thể thao đến casino trực tuyến, slot game, bài bạc và nhiều trò chơi giải trí khác. Bất kỳ ai cũng có cơ hội tìm thấy trò chơi mà họ yêu thích và có thể thử thách tài năng của mình.
Đội ngũ phát triển của VNAZ888 không ngừng làm việc chăm chỉ để cung cấp các trò chơi mới và thú vị nhất cho cộng đồng của mình. Từ những tiến bộ công nghệ mới đến các tính năng độc đáo, VNAZ888 luôn luôn mang đến cho người chơi những trải nghiệm đỉnh cao.
Một trong những điểm đặc biệt của VNAZ888 là cam kết đảm bảo an toàn và tính minh bạch cho người chơi. Hệ thống bảo mật tiên tiến và quản lý chuyên nghiệp được đặt lên hàng đầu để bảo vệ thông tin cá nhân và tài khoản của người chơi. VNAZ888 cũng cam kết đảm bảo tính công bằng và minh bạch trong các giao dịch cược, mang đến cho người chơi cảm giác yên tâm và tin tưởng khi tham gia vào hành trình giải trí của họ tại VNAZ888.
Địa chỉ:4a/13 Trường Chinh, Phường 14, Tân Bình, Thành phố Hồ Chí Minh, Việt Nam
Postcode:72506
SDT: 0568 423 871
Email:vnaz888co@gmail.com
Website: https://vnaz888.co/
Hashtag: #VNAZ888#VNAZ888link #VNAZ888apk #CodeVNAZ888 #VNAZ888web
 
Social Links:

https://www.facebook.com/vnaz888co

https://twitter.com/vnaz888co

https://www.pinterest.com/vnaz888co/

https://500px.com/p/vnaz888co?view=photos

https://www.flickr.com/people/vnaz888co/

https://www.youtube.com/channel/UCvohso34ncYPSxyt6Aa4X1w

https://www.reddit.com/user/vnaz888co

https://www.blogger.com/profile/08618743894962479475

https://vnaz888co.blogspot.com/

https://vnaz888co.tumblr.com/