teleren/devto huggingface dataset:
Write tests for your type definitions
Tags: 100daystooffload, typescript, testing, typesafe
Published: 2024-04-15 19:02:01

Say hello to the [tsd](https://www.npmjs.com/package/tsd) npm package, the tool that lets you write tests for your type definitions.

Lets explore the package by first adding it to an existing project.

```bash
npm install --save-dev tsd
```

Then we begin with a simple example by adding this TypeScript file `tsd-examples.ts`.

```typescript
export const asString = (n: number) => n.toString()
```

Now we can add a happy path test in a file called `tsd-examples.test-d.ts`, **note** the naming convention here with the `.test-d.ts`.

```typescript
import { expectType } from 'tsd'
import { asString } from './tsd-examples'

expectType<string>(asString(42))
```

Here we test that the function `asString` is typed to return a value of the type `string`. Run the test by executing following command in the terminal:

```bash
npx tsd -t ./tsd-examples.test-d.ts
```

If there is no output then everything is ok, 🟢, however if you change the test like this instead.

```typescript
import { expectType } from 'tsd';
import { asString } from './tsd-examples';

expectType<string>(asString("42"))
```

Notice the change for the input parameter, `42` to `"42"`. Execute the test again with `npx tsd -t ./tsd-examples.test-d.ts`.

![test error](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q5v7v828xmsrdc5xjcoj.PNG)

We could update our test like this if we want to cover that case too.

```typescript
import { expectError, expectType } from 'tsd';
import { asString } from './tsd-examples';

expectType<string>(asString(42))
expectError<string>(asString("42"))
```

Here we import the `expectError` so that we can verify the type error with the string `"42"`. Now when we rerun the `tsd` command it once again passes all the tests.

So far it has been pretty straight forward and perhaps these test do not bring much value over the linting tool available in your IDE.

However types in TypeScript can be much more complex, the issue [TypeScripts Type System is Turing Complete](https://github.com/microsoft/TypeScript/issues/14833) might give a hint about this.

So this example just scratch the surface, If you want to see a more advance use of `tsd`, then take a look at, [TypeLang](https://github.com/ronami/typelang/tree/master), which implements an interpreter with TypeScript type annotations.

Happy TypeScripting!
Type of Lists in HTML
Tags: webdev, web, html, design
Published: 2024-04-15 18:51:39

**There are three types of Lists in HTML:**
>
1. Ordered List
2. UnOrdered List
3. Definition List
4. Nested List

`Note:Nested List is not a type of list but we call the merges list as Nested List`

## _1.Ordered List_
In Ordered List all the items are in a specific ordered...
**_There are 5 list-style type of Ordered list_**

## A-for capital
```
<ol type="A">
  <li>Coffee</li>
  <li>Tea</li>
  <li>Milk</li>
</ol>
```
> A. Coffee
> B. Tea
> C. Milk

## a - for small letter

```
<ol type="a">
  <li>Coffee</li>
  <li>Tea</li>
  <li>Milk</li>
</ol>
```
> a. Coffee
> b. Tea
> c. Milk

## I - For Big Roman
```
<ol type="I">
  <li>Coffee</li>
  <li>Tea</li>
  <li>Milk</li>
  <li>Juice</li>
</ol>
```
> I. Coffee
> II. Tea
> III. Milk
> IV. Juice

## i - For Small Roman
```
<ol type="i">
  <li>Coffee</li>
  <li>Tea</li>
  <li>Milk</li>
  <li>Jauce</li>
</ol>
```
> i. Coffee
> ii. Tea
> iii. Milk
> iv. Jauice

## 1 - For Numeric(By Dafualt)
```
<ol type="1">
  <li>Coffee</li>
  <li>Tea</li>
  <li>Milk</li>
</ol>
```
> 1. Coffee
> 2. Tea
> 3. Milk


## _2.Unordered List_
In Unordered List there is no specific Order...
_**There are three list-style type in unordered List**_

- disc - By Dafault (Filled Dark Circle)

```
<ul style="disc">
  <li>Coffee</li>
  <li>Tea</li>
  <li>Milk</li>
</ul>
```

- circle - Empty Circles
```
<ul style="list-style-type:square;">
  <li>Coffee</li>
  <li>Tea</li>
  <li>Milk</li>
</ul>
```

- square - Rectangular Square
```
<ul style="list-style-type:square;">
  <li>Coffee</li>
  <li>Tea</li>
  <li>Milk</li>
</ul>
```

- none - mostly used in navbar
```
<ul style="list-style-type:none;">
  <li>Coffee</li>
  <li>Tea</li>
  <li>Milk</li>
</ul>
```
Elixir
Tags: webdev, javascript, beginners, programming
Published: 2024-04-15 18:40:21

Elixir


**Introduction:**

There is a never ending search for more effective, scalable, and maintainable solutions in the field of programming languages. Out of all the options, Elixir stands out as a modern option since it combines the beauty of functional programming with the durability of concurrent and distributed systems. Together, we will explore the mysteries of Elixir and discover why developers all around the world are falling in love with it.

**Functional programming**

Based on the powerful Erlang Virtual Machine (BEAM), Elixir fully adopts the functional programming paradigm. Declarative programming approaches, pure functions, and unchanging data structures are highlighted in this paradigm. Developers can write code that is expressive, clear, and naturally resistant to errors resulting from changeable states by using Elixir.

def drive(%User{age: age}) when age >= 16 do
  # Code that drives a car
end

drive(User.get("Khamal"))

#=> Fails if the user is under 16


**Concurrency and Distribution**

Elixir's native support for distribution and concurrency is one of its best qualities. Thanks to Elixir, developers may easily create thousands of separate, concurrent processes through using the Erlang VM's lightweight processes. Due to its concurrency paradigm, which promotes reliability and scalability, Elixir is a great choice for developing extremely responsive and solid systems, such as distributed databases and real-time web applications.

**Pattern Matching and Metaprogramming**

With strong language features like pattern matching and metaprogramming, Elixir gives developers more power. While metaprogramming makes it possible to create domain-specific languages and generate runtime code, pattern matching makes it easier to manipulate data elegantly and manage flow. With the help of these tools, developers can write more creative and expressive code, which boosts output to levels never before achieved.



**A growing ecosystem**

Elixir's vibrant community, which is well known for its openness, enthusiasm, and teamwork, is its core. A wide range of resources and support are available to Elixir developers, whether they are attending community events, contributing to open-source projects, or asking for assistance on forums. This vibrant community enhances everyone's Elixir experience by encouraging education, creativity, and friendship.
BUN
Tags: beginners, programming, tutorial
Published: 2024-04-15 18:39:17

**What is Bun?**

Bun is a next-generation package manager built with simplicity and speed in mind. Bun was created by a company named Oven, but the real mastermind Jarred Sumner created it as a Node.js drop in alternative. Bun employs JavaScriptCore as its JavaScript engine, as opposed to V8 used by Deno and Node.js.

**Key features:**
 Lightweight and Fast:
 Bun prides itself on its lightning-fast performance. Node.js and Deno use Chrome's V8 javascript engine. Bun decided on using Javascript core engine which powers browsers such as safari. Bun itself is written in Zig, a low-level programming language that uses manual memory management and native threading to support multiple computations are happening at the same time. The end result is a lightweight runtime with a reduced memory footprint, faster start-up times, and up to four times the speed of Node.JS and Deno. 

**Dependency Resolution**
 Bun automatically resolves version mismatches and installs the most compatible versions of dependencies, saving developers from headaches. It also helps prevent common dependency conflicts, making it easier to manage your project’s dependencies over time. By reducing the amount of time that developers spend waiting on test suites to run, for instance, you also reduce the time needed to iterate on those tests.

**Centralized Repository**
 Bun maintains a centralized repository of packages, making it easy for developers to discover and install dependencies with a simple command. Bun also employs symlinks, packages for each project are linked to a centralized location. This means that modules occurring or coming later or after projects do not have to be downloaded again.

**Getting Started with Bun:**

Using Bun is straightforward. After installing the Bun CLI, developers can initialize a new project and start managing dependencies with a few simple commands. Here's a quick guide to get started:

**Install Bun:**

npm install -g bun
 
Initialize a new project:

bun init my-project

Install dependencies:

bun install package-name

**Conclusion**

In conclusion, Bun redefines the landscape of package management with its emphasis on speed, simplicity, and reliability. Whether you're a seasoned developer or just starting with programming, Bun empowers you to manage dependencies effortlessly, allowing you to focus on building remarkable software.Give Bun a try today and experience the future of package management!
TeamPass a Self-hosted Password manager to increase organization’s CyberSecurity
Tags: cybersecurity, devops, developers, webdev
Published: 2024-04-15 18:15:35

In today’s digital age, securing sensitive information within organizations is paramount. With cyber threats becoming increasingly sophisticated, the need for robust password management solutions has never been more critical. TeamPass, a web-based password management system, offers an effective solution to this challenge. This article explores the importance of password security, the benefits of implementing TeamPass in an organization, and best practices for maintaining a secure digital environment.

In an era dominated by digitalization, organizations store vast amounts of sensitive data, ranging from financial records to customer information. With cyberattacks on the rise, safeguarding this data is crucial to maintaining trust and integrity. One of the fundamental aspects of cybersecurity is password management. Weak passwords and improper handling of credentials pose significant risks to organizational security. In this article, we delve into the importance of password security, the role of password management solutions like TeamPass, and best practices for maintaining robust digital defenses.

The full setup you can view in my YouTube video. Don't forget to follow:

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

**Understanding Password Security:
**
Passwords serve as the first line of defense against unauthorized access to sensitive information. However, the effectiveness of passwords relies heavily on their strength and uniqueness. Weak passwords, such as “123456” or “password,” are easily guessable and vulnerable to brute-force attacks. To mitigate such risks, organizations must enforce password policies that promote complexity and uniqueness. Strong passwords typically comprise a combination of uppercase and lowercase letters, numbers, and special characters. Additionally, longer passwords are inherently more secure than shorter ones.

TThe full article and installation instructions can be found on YouTube and here: [https://www.valters.eu/teampass-a-self-hosted-password-manager-to-increase-organizations-cybersecurity/](https://www.valters.eu/teampass-a-self-hosted-password-manager-to-increase-organizations-cybersecurity/)
CONTACT A TRUSTED CRYPTO SCAM RECOVERY SERVICE LIKE MUYERN TRUST HACKER
Published: 2024-04-15 17:59:52

With MUYERN TRUST HACKER, you can expect a quick and efficient recovery process if you have lost your Bitcoin, ensuring you regain access to your assets promptly. This service provides a streamlined solution for retrieving lost cryptocurrency by leveraging advanced data recovery techniques and a team of highly skilled experts. The process begins with an in-depth analysis of your situation to pinpoint exactly where and how your Bitcoin was lost or stolen. The experts will then utilize proprietary data retrieval software and manual recovery methods to systematically scan storage devices, servers, or the blockchain to locate and restore missing keys or wallets. You will be assigned a dedicated case manager to provide updates and support throughout the recovery. They understand the stress of losing crypto assets and will work diligently to reunite you with your funds. The team works rapidly yet meticulously to reconstruct access to wallets or decrypt corrupted files. Depending on the complexity, most cases are resolved within days or weeks rather than months. Experience the ease of quick recovery times to swiftly resume trading and utilizing your cryptocurrency without unnecessary delays. MUYERN TRUST HACKER has a reliable history of successfully retrieving lost or stolen Bitcoin, reassuring you that your assets can be swiftly recovered. Their streamlined recovery process ensures minimal disruption and a secure pathway to regain access to your valuable holdings. Trust MUYERN TRUST HACKER for a seamless and efficient solution to safeguard your digital assets by dialing:  muyerntrusted [at] mail-me[dot]com and signal +1/585'22'88-605

Friendly greeting.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n2lho96pghhi56e07o8a.jpg)
Master C# with advanced tutorials
Tags: csharp, dotnet, tutorial
Published: 2024-04-15 17:46:38

💡If you want to 𝐌𝐚𝐬𝐭𝐞𝐫 .𝐍𝐄𝐓/𝐂# with easy-to-follow and practical examples like a Senior, I have a list of video tutorials for you:

𝐀𝐝𝐯𝐚𝐧𝐜𝐞𝐝 𝐂# 𝐭𝐮𝐭𝐨𝐫𝐢𝐚𝐥𝐬:

✅ 𝐌𝐚𝐬𝐭𝐞𝐫𝐢𝐧𝐠 C# 𝐚𝐬𝐲𝐧𝐜/𝐰𝐚𝐢𝐭 𝐰𝐢𝐭𝐡 𝐢𝐧𝐭𝐞𝐫𝐧𝐚𝐥𝐬: https://lnkd.in/ebZH88Pr

✅ 𝐀𝐝𝐯𝐚𝐧𝐜𝐞𝐝 C# 𝐃𝐞𝐥𝐞𝐠𝐚𝐭𝐞𝐬 𝐟𝐨𝐫 𝐒𝐞𝐧𝐢𝐨𝐫𝐬: https://lnkd.in/ew57SvvY

✅ 𝐀𝐝𝐯𝐚𝐧𝐜𝐞𝐝 C# 𝐆𝐞𝐧𝐞𝐫𝐢𝐜𝐬: https://lnkd.in/eBJAn2SC

✅ 𝐂# 𝐝𝐞𝐥𝐞𝐠𝐚𝐭𝐞𝐬 𝐥𝐢𝐤𝐞 𝐚 𝐒𝐞𝐧𝐢𝐨𝐫: https://lnkd.in/eBgFwGej

✅ 𝐂# 𝐞𝐯𝐞𝐧𝐭𝐬 𝐥𝐢𝐤𝐞 𝐚 𝐒𝐞𝐧𝐢𝐨𝐫: https://lnkd.in/evj38M_5

✅ 𝐂# 𝐢𝐧𝐭𝐞𝐫𝐟𝐚𝐜𝐞𝐬 𝐥𝐢𝐤𝐞 𝐚 𝐒𝐞𝐧𝐢𝐨𝐫: https://lnkd.in/e7PqnP7w

✅ 𝐀𝐝𝐯𝐚𝐧𝐜𝐞𝐝 𝐂# 𝐚𝐭𝐭𝐫i𝐛u𝐭𝐞𝐬: https://lnkd.in/es_MRc8D

✅ 𝐀𝐝𝐯𝐚𝐧𝐜𝐞𝐝 𝐂# 𝐞𝐱𝐭𝐞𝐧𝐬𝐢𝐨𝐧𝐬: https://lnkd.in/eFtcP4hr

✅ 𝐀𝐬𝐲𝐧𝐜 𝐔𝐈 𝐰𝐢𝐭𝐡 𝐂𝐨𝐧𝐟𝐢𝐠𝐮𝐫𝐞𝐀𝐰𝐚𝐢𝐭: https://lnkd.in/ebKGcRqj

✅ 𝐃𝐞𝐞𝐩 𝐝𝐢𝐯𝐞 𝐢𝐧𝐭𝐨 𝐓𝐚𝐬𝐤 𝐂𝐚𝐧𝐜𝐞𝐥𝐥𝐚𝐭𝐢𝐨𝐧: https://lnkd.in/ed2EY9QP

✅ 𝐁𝐚𝐜𝐤𝐠𝐫𝐨𝐮𝐧𝐝 𝐓𝐚𝐬𝐤𝐬 𝐢𝐧 𝐂# : https://lnkd.in/eyu8N2Gh

✅ 𝐓𝐏𝐋 𝐢𝐧 𝐂# : https://lnkd.in/ed-3bk7g

✅ 𝐌𝐚𝐬𝐭𝐞𝐫𝐢𝐧𝐠 𝐂# 𝐫𝐞𝐜𝐨𝐫𝐝𝐬: https://lnkd.in/ec5ZDkUU

✅ 𝐂𝐋𝐑 𝐚𝐧𝐝 𝐉𝐈𝐓 𝐜𝐨𝐦𝐩𝐢𝐥𝐞𝐫 𝐢𝐧𝐭𝐞𝐫𝐧𝐚𝐥𝐬: https://lnkd.in/eKv6m_JQ

✅ 𝐃𝐞𝐞𝐩 𝐝𝐢𝐯𝐞 𝐢𝐧𝐭𝐨 𝐃𝐞𝐩𝐞𝐧𝐝𝐞𝐧𝐜𝐲 𝐈𝐧𝐣𝐞𝐜𝐭𝐢𝐨𝐧: https://lnkd.in/eum3ny3F



.𝐍𝐄𝐓 𝐈𝐋 𝐭𝐮𝐭𝐨𝐫𝐢𝐚𝐥𝐬:

✅ 𝐎𝐛𝐣𝐞𝐜𝐭-𝐎𝐫𝐢𝐞𝐧𝐭𝐞𝐝 .𝐍𝐄𝐓 𝐈𝐋 : https://lnkd.in/enNJbkuA

✅ 𝐋𝐞𝐚𝐫𝐧𝐢𝐧𝐠 .𝐍𝐄𝐓 𝐈𝐋: https://lnkd.in/gMCVTPRC

✅ 𝐖𝐫𝐢𝐭𝐢𝐧𝐠 .𝐍𝐄𝐓 𝐈𝐋 𝐜𝐨𝐝𝐞: https://lnkd.in/ePYNxKxh



𝐂# 𝐌𝐢𝐜𝐫𝐨𝐬𝐞𝐫𝐯𝐢𝐜𝐞𝐬 𝐭𝐮𝐭𝐨𝐫𝐢𝐚𝐥𝐬:

✅ 𝐂𝐨𝐧𝐬𝐮𝐦𝐞𝐫 𝐌𝐢𝐜𝐫𝐨𝐬𝐞𝐫𝐯𝐢𝐜𝐞 𝐰𝐢𝐭𝐡 𝐂# 𝐚𝐧𝐝 𝐊𝐚𝐟𝐤𝐚: https://lnkd.in/eXG5ybFj

✅ 𝐏𝐫𝐨𝐝𝐮𝐜𝐞𝐫 𝐌𝐢𝐜𝐫𝐨𝐬𝐞𝐫𝐯𝐢𝐜𝐞𝐬 𝐰𝐢𝐭𝐡 𝐂# 𝐚𝐧𝐝 𝐊𝐚𝐟𝐤𝐚: https://lnkd.in/eiF_mDYD


𝐂# 𝐟𝐮𝐧𝐜𝐭𝐢𝐨𝐧𝐚𝐥 𝐩𝐫𝐨𝐠𝐫𝐚𝐦𝐦𝐢𝐧𝐠:

✅𝐑𝐚𝐢𝐥𝐰𝐚𝐲-𝐎𝐫𝐢𝐞𝐧𝐭𝐞𝐝 𝐏𝐫𝐨𝐠𝐫𝐚𝐦𝐦𝐢𝐧𝐠: https://lnkd.in/eXyu54kb

✅ 𝐁𝐞𝐭𝐭𝐞𝐫 𝐞𝐱𝐜𝐞𝐩𝐭𝐢𝐨𝐧 𝐡𝐚𝐧𝐝𝐥𝐢𝐧𝐠: https://lnkd.in/eUs65xK6

✅ 𝐏𝐫𝐢𝐦𝐢𝐭𝐢𝐯𝐞 𝐎𝐛𝐬𝐞𝐬𝐬𝐢𝐨𝐧 𝐟𝐨𝐫 𝐃𝐃𝐃 𝐩𝐫𝐨𝐣𝐞𝐜𝐭𝐬: https://lnkd.in/eC6gs9Wx
How to build a DevTools Extensions - Flutter News 2024 #15 ʚїɞ
Tags: flutter, news, dart, discuss
Published: 2024-04-15 17:38:16

> New to Flutter News: [New Flutter Packages](#new-flutterpackages)

Hey Flutter enthusiasts!

Ever worry about missing key Flutter updates? Well, worry no more!
Starting 2024, I'm here to keep you informed with a weekly Monday report. Let's stay ahead in the world of Flutter!

## Table of Contents

 * [Mayor Flutter updates](#mayor-flutter-updates)
 * [New Flutter Videos](#new-flutter-videos)
 * [New Flutter Packages](#new-flutterpackages)
 * [New Dev Posts](#new-devposts)
 * [New Medium Posts](#new-mediumposts)

---

## Mayor Flutter updates:

> There are no mayor flutter updates this week!
-> Currently [Flutter Version Valentine’s-Day-adjacent 3.19](https://docs.flutter.dev/release/whats-new)

## New Flutter Videos:

> The [Flutter YouTube Channel](https://youtube.com/@flutterdev?si=RZyl1nLVnSt373Vu) did post new Videos:
{% embed https://www.youtube.com/watch?v=gOrSc4s4RWY %}


---

## New Flutter-Packages

{% embed https://pub.dev/packages/dart_minilog %}

{% embed https://pub.dev/packages/interactive_viewer_2 %}

{% embed https://pub.dev/packages/autologin %}

{% embed https://pub.dev/packages/recipe_extractor %}

{% embed https://pub.dev/packages/camera_multi_picker %}


---

### New Dev-Posts

{% embed https://dev.to/devsnorte/desenvolvendo-um-widget-de-upload-com-flutter-54oi %}

{% embed https://dev.to/suamirochadev/5-dicas-de-flutter-36ee %}

{% embed https://dev.to/navalnyteam/kak-my-dielali-prilozhieniie--2ba0 %}

{% embed https://dev.to/drashmk/omnilingual-ai-29la %}

{% embed https://dev.to/koukibadr/flutter-elegant-notification-2714 %}


---

### New Medium-Posts

{% embed https://medium.com/@zigdanis/part-1-setting-up-dev-and-prod-flavors-for-flutter-app-on-ios-and-android-platforms-a6ef6245a1e2 %}

{% embed https://medium.com/@asfaqueahmedsakkar/optimizing-asset-management-in-flutter-dynamic-inclusion-for-platform-specific-and-common-assets-4879e891e94d %}

{% embed https://medium.com/@saddamhossain7759/udemy-face-recognition-and-detection-in-flutter-the-2024-guide-getpaidcoursefree-com-98371277e9d0 %}

{% embed https://medium.com/@vmgarciahurtado/construyendo-experiencias-de-realidad-aumentada-con-flutter-unity-soluci%C3%B3n-para-dispositivos-da7eb8bbe3b5 %}

{% embed https://medium.com/tech-iiitg/fluttering-forward-a-fresh-approach-to-mobile-app-development-1822b53fe917 %}


---

Last Flutter News: [Flutter News 2024 #14 ʚїɞ](https://dev.to/lucianojung/series/26008)
_Did I miss any recent updates? Feel free to share any important news I might have overlooked!_
JT Plumbing Heating & Air
Published: 2024-04-15 17:27:58


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

JT Plumbing heating & Air is a full Service Plumbing & HVAC company located in Loveland, CO. Our goal as a locally-owned family Plumbing & HVAC company is to build relationships with our new and existing customers and make sure they have a local, reliable Plumber they can trust for all of their Plumbing needs.

JT Plumbing Heating & Air
Address: [193 E 71st St, Loveland, CO 80538](https://www.google.com/maps?cid=13803470543624334642)
Phone: 970-633-1956
Website: [https://jtplumbingservicesllc.com/](https://jtplumbingservicesllc.com/)
Contact email: jt@jtplumbingservicesllc.com

Visit us: 
[JT Plumbing Heating & Air Facebook](https://www.facebook.com/Plumbing.Services/)
[JT Plumbing Heating & Air Instagram](https://www.instagram.com/jtplumbingandhvac/)

Our service:
Plumbing services
HVAC repair
Emergency plumbing
Heating installation
Air conditioning maintenance
Day 15/366
Tags: 1percentplusplus, 100daysofcode
Published: 2024-04-15 17:18:40

🚀 **Today's Learning:**

🌟 DSA

- Sentence Palindrome
- Longest Substring Without Repeating Characters

🌟 Dev

- Asynchronous JS

🔍 **Some Key Highlights:**

DSA

### **Sentence Palindrome:**

To determine if a sentence is a palindrome, we can utilize a recursive approach. We begin by processing the current sentence, which involves removing any spaces and converting all characters to lowercase to ensure case insensitivity. Then, we check if the processed sentence is a palindrome by comparing the characters at the beginning and end of the sentence. If they match, we continue checking the inner characters recursively until either the sentence becomes empty or we find a mismatch. If all characters match, the sentence is a palindrome.

### **Longest Substring Without Repeating Characters:**

For finding the longest substring without repeating characters, we employ a sliding window approach. We start by initializing two pointers, one at the beginning and the other at the end of the string. As we process the string, we maintain a set or a hashmap to keep track of characters encountered within the current window. If we encounter a repeating character, we shrink the window from the left side until the repeating character is no longer in the window. Meanwhile, we keep track of the maximum length of the window encountered so far. We continue this process until we reach the end of the string, ensuring that each substring within the window contains unique characters. Finally, the length of the longest substring without repeating characters is the maximum length encountered during the process.

DEV

### **Asynchronous Programming in JavaScript:**

JavaScript is a single-threaded, non-blocking, asynchronous language, meaning it can handle multiple operations concurrently without waiting for each one to finish before moving on to the next. Asynchronous programming is crucial for handling tasks such as network requests, file I/O, and user input without blocking the main thread and causing delays in the user interface.

### Callbacks:

Traditionally, asynchronous operations in JavaScript were managed using callbacks. A callback is a function that is passed as an argument to another function and is executed once the asynchronous operation completes. However, managing multiple nested callbacks can lead to callback hell, making code difficult to read and maintain.

 #100daysofcode #1percentplusplus #coding #dsa
How to Serve an Angular App with Nginx
Tags: angular, nginx, config, webdev
Published: 2024-04-15 17:17:56

**Installing Nginx on Windows**

1... - Download the latest version of Nginx for Windows from the official Nginx website.

2... - Extract the downloaded archive to a directory of your choice, such as C:\nginx.

**nginx.conf Configuration**

- Next, let's configure Nginx to serve our Angular application. Below is a basic configuration file (nginx.conf) for serving an Angular app:

```
http {
    include mime.types;
    server {
        listen 2292;
        root /Users/vivek/Desktop/SAAS/saas_client/dist/sfms/browser;
    }
}
events{}
```
**Explanation of Configuration**

**The provided Nginx configuration file consists of the following directives:**

- **http** This directive marks the beginning of the HTTP block, which defines global settings for Nginx.

- **include mime.types;** This directive includes the mime.types file, which maps file extensions to their corresponding MIME types.

- **server** This directive defines a server block within the HTTP block. A server block defines how Nginx handles requests for a specific domain name or port.

- **listen 2292;** This directive specifies the port (2292) on which Nginx should listen for incoming connections.

- **root** /Users/vivek/Desktop/SAAS/saas_client/dist/sfms/browser; This directive sets the root directory from which Nginx should serve static files. [above location is location of build artifacts]

- In this case, the Angular application's built output is located in the specified directory.

**Replacing Default nginx.conf**

- To use the above configuration, follow these steps:

3... Locate the default nginx.conf file in the Nginx installation directory (typically C:\nginx\conf on Windows).

4... Replace the contents of the default nginx.conf file with the configuration provided above.

5... Save the changes to the nginx.conf file.

**Basic Nginx Commands**

- To start Nginx: Open Command Prompt and navigate to the Nginx directory (cd C:\nginx) and then run nginx.exe.

- To stop Nginx: Use the command nginx.exe -s stop.

- To reload Nginx configuration: Use the command nginx.exe -s reload.

6... go to browser and hit localhost:2209

7... its done!!!😀