teleren/devto huggingface dataset:
Commonly Used npm Flags
Tags: webdev, javascript, beginners, programming
Published: 2024-05-23 18:21:39

## **Commonly Used npm Flags**

**-g (global)**

- **Cmd:** `npm install -g <package-name>`
- **Usage:** Installs the package globally on your system, making it available from any directory. This is useful for tools and utilities you want to use across different projects.
- **Example:** `npm install -g create-react-app` allows you to use the create-react-app command from anywhere on your machine.


**-p (prefix)**

- **Cmd:** `npm install -p <directory> <package-name>` 
- **Usage:** Installs the package to a specific directory rather than the default `node_modules` in the current project. This can be used to manage packages for different environments or users.
- **Example:** `npm install -p /usr/local <package-name>` installs the package to /usr/local.


**-d (save-dev)**

- **Cmd:** `npm install -D <package-name>` or `npm install --save-dev <package-name>` 
- **Usage:** Adds the package as a development dependency. Development dependencies are only needed during development and testing, not in production. 
- **Example:** `npm install -D jest` adds jest to your devDependencies in `package.json`
 
```json
{
  "dependencies": {
    "express": "^4.17.1"
  },
  "devDependencies": {
    "jest": "^27.0.6"
  }
}
```

## **Other Common npm Flags**


**--save(-S)**

- **Cmd:** `npm install -S <package-name>` or `npm install <package-name>` 
- **Usage:** Adds the package as a dependency in your `package.json`. This is the default behavior when you run `npm install <package-name>` 
- **Example:** `npm install express` will add express to the dependencies in `package.json` 


**--save-optional (-O)**

- **Cmd:** `npm install -O <package-name>`
- **Usage:** Adds the package as an optional dependency. These dependencies are not critical for the project to function but can add optional features.
- **Example:** `npm install -O fsevents` adds fsevents to optionalDependencies.


**--save-exact (-E)**

- **Cmd:** `npm install -E <package-name>` 
- **Usage:** Installs the exact version specified without updating to newer versions.
- **Example:** `npm install -E lodash` installs the exact version listed, e.g., `lodash@4.17.21`


**--production**

- **Cmd:** `npm install --production`
- **Usage:** Installs only the dependencies listed under dependencies and skips devDependencies. Useful for deployment.
- **Example:** `npm install --production` ensures only necessary packages for running the app are installed.


**Summary**

- -g: Global installation
- -p: Specify installation directory
- -d: Development dependencies
- --save: Default dependency installation (often implicit)
- -O: Optional dependencies
- -E: Exact version installation
- --production: Production-only installation

These flags help configure your environment and dependencies according to your project needs.


Thank You!!!


Follow on: [Linkedin](https://www.linkedin.com/in/sanjay-r-ab6064294/), [Instagram](https://www.instagram.com/_sanjayxr_12_/), [Medium](https://medium.com/@sanjayxr)
Github fundamentals training + free exam vocher
Tags: github, certification, git
Published: 2024-05-23 18:20:33

🌟 GitHub and Microsoft helping you to boost your career in tech by launching Get Certified with GitHub Live series! 

 💻 🌎 From June 5th to June 26th we will help you get prepared to take the GitHub Foundation Certification with the support of Microsoft and GitHub experts! You will learn how to collaborate on a project and with teams to grow your knowledge by using different tools like GitHub Copilot, GitHub Codespaces and more!

🎉 Plus, you'll have the chance to earn a free certification voucher for the GitHub Foundation Certification. Registrer here: https://lnkd.in/gHbje8F8
 
 💡 Find out how you can get a free voucher to take this certification https://lnkd.in/gZcCCYD2 and share this amazing news with your friends!





Initial Post Reference :

https://www.linkedin.com/posts/srinivasuluparanduru_learn-live-get-certified-with-github-activity-7197547214007586817-B_ps?utm_source=share&utm_medium=member_ios
سایت حضرات بدون فیلتر
Tags: webdev, javascript, programming, beginners
Published: 2024-05-23 18:19:14

سایت حضرات [https://hazaratiha.com/](https://hazaratiha.com/) دارای انواع درگاه‌های معتبر بانکی، درگاه کارت به کارت، پرفکت مانی و ارز دیجیتال است.
برداشت فوری جوایز: این سایت همیشه سعی می‌کند تا پس از برداشت پول از حضرات توسط کاربران، جوایز آنها را در سریع ترین زمان ممکن واریز کند.
An Ultimate Guide On How To Mine Dogecoin
Tags: mine, dogecoin, mining
Published: 2024-05-23 18:18:56

Going through this article, you will learn if Dogecoin is mineable, and what hardware and software you will need. Moreover, we will focus on how long it takes to mine Dogecoin if it is profitable and much more. 

**How To Mine For Dogecoin?
**Mining doesn't mean that you have to go into a mine and search for the crypto, and similarly, you won't need to transform into a mining attire. Mining Dogecoin means the transactions are confirmed on the DOGE blockchain and rewards are given in return. 

Dogecoin mining includes recording and validating the transactions on the Dogecoin blockchain, a public ledger necessary for the operations of cryptos. In this mining operation, the users are given new DOGE crypto for mining each block successfully, catering to the supply of crypto. Mining is crucial to maintaining the decentralization of the DOGE network and to maintaining the integrity of the process. 
Miners can use different methods, including GPU mining, CPU mining, pool mining and others. Once the DOGE has been mined they can be safely stored in software wallets, providing easy management and access. Such mining activities are necessary for the Dogecoin ecosystem, to maintain its security and stability. [Read more; ](https://blockdag.network/blog/how-to-mine-dogecoin)
How to Add a Canonical URL to Your dev.to Post
Published: 2024-05-23 18:13:21

---
title: How to Add a Canonical URL to Your dev.to Post
published: true
description: How to Add a Canonical URL to Your dev.to Post using Metadata
tags: 
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2024-05-23 18:10 +0000
---

Hello dev.to community! 👋

If you're here, you probably already have a few posts under your belt and are familiar with using front matter to add metadata to your dev.to articles. Adding a canonical URL is a crucial step for those of us who cross-post content from our personal blogs or other platforms. It helps with SEO by indicating the original source of your content, ensuring search engines know where the content was first published.

## Step-by-Step Guide to Adding a Canonical URL

1. **Open Your Post in the Editor**
   - Navigate to your dev.to dashboard and open the post you want to edit. If you’re creating a new post, start a new draft.

2. **Access the Markdown Editor**
   - Make sure you’re in the markdown editor. This is where you’ll add your front matter.

3. **Modify the Front Matter**
   - At the top of your post, you should already have some front matter in YAML format. This is where you add metadata like the title, description, and tags.

4. **Add the Canonical URL**
   - Include the `canonical_url` field in your front matter. Here’s how your front matter should look:

   ```markdown
   ---
   title: "Your Post Title"
   published: true
   description: "A brief description of your post"
   tags: programming, tutorial, devto
   canonical_url: "https://yourwebsite.com/your-original-post"
   ---

   Your post content goes here... 
   ```

Replace `https://yourwebsite.com/your-original-post` with the actual URL of your original content.

5. **Save and Publish**
After adding the canonical URL, save your changes and publish your post. This will tell search engines that the original source of the content is the URL you provided, helping to avoid duplicate content issues.

If you liked this post, give it a 🦄 :)
Introducción a Pydantic para Principiantes.
Published: 2024-05-23 18:05:22

Pydantic es una poderosa biblioteca en Python diseñada para la validación y gestión de datos. Es especialmente útil cuando trabajas con datos que necesitan ser validados y transformados, como datos de entrada de API o formularios. Aquí te explico cómo empezar con Pydantic de manera sencilla.

¿Qué es Pydantic?
Pydantic permite definir modelos de datos utilizando anotaciones de tipo, y automáticamente valida y transforma los datos según estas anotaciones. Esto significa que puedes asegurarte de que tus datos tienen el formato correcto antes de usarlos en tu aplicación.

Instalación:
Primero, necesitas instalar Pydantic. Puedes hacerlo usando pip:

```cmd
pip install pydantic
```

Creación de un Modelo o Esquema:
Un modelo en Pydantic es una clase que hereda de BaseModel. Definimos los atributos de esta clase con sus tipos, y Pydantic se encarga del resto.

```py
from pydantic import BaseModel

class User(BaseModel):
id: int
name: str
signup_ts: Optional[datetime] = None
friends: List[int] = []
```

En este ejemplo, User es un modelo con cuatro atributos:

id: un entero obligatorio.
name: una cadena de texto obligatoria.
signup_ts: una marca de tiempo opcional.
friends: una lista de enteros, que por defecto es una lista vacía.

Validación de Datos:
Una vez definido el modelo, podemos crear instancias del mismo y Pydantic validará automáticamente los datos proporcionados.

Una vez definido el modelo, podemos crear instancias del mismo y Pydantic validará automáticamente los datos proporcionados.

```py
from datetime import datetime

user = User(id=123, name='John Doe', signup_ts=datetime.now(), friends=[1, 2, 3])
print(user)
```

Si los datos no son válidos, Pydantic generará un error.

Transformación de Datos:
Pydantic también puede transformar los datos según las anotaciones de tipo. Por ejemplo:

```py
user = User(id='123', name='John Doe')
print(user)
```

Aquí, Pydantic convertirá el id de cadena de texto a entero automáticamente.

Configuración Avanzada
Pydantic ofrece muchas opciones avanzadas, como alias para nombres de campos, validaciones personalizadas, y uso con JSON.

Alias
Podemos usar alias para los campos, lo que es útil cuando los nombres de los datos de entrada no coinciden con los de nuestro modelo.

```py
class User(BaseModel):
    id: int
    name: str = Field(alias='username')

user = User(id=123, username='John Doe')
print(user)
```

Integración con JSON
Pydantic facilita trabajar con JSON, permitiendo la exportación e importación de modelos a/desde JSON.

```py
user = User(id=123, name='John Doe', age=30)
user_json = user.json()
print(user_json)

user_from_json = User.parse_raw(user_json)
print(user_from_json)
```

Conclusión
Pydantic es una herramienta poderosa para la validación y transformación de datos en Python. Facilita el trabajo con datos estructurados y ayuda a asegurar que tus datos sean correctos y consistentes. ¡Empieza a usar Pydantic en tus proyectos y simplifica la gestión de datos en tus aplicaciones!
TS is a liar
Tags: typescript, javascript, webdev, learning
Published: 2024-05-23 18:01:27

## Motivation
Sometimes I hear from people such an amazing opinion about `typescript` and the reliability of this. My motivation is to clarify some cases, cuz our best language is becoming modern every day and we use some things that we couldn't use a couple of years ago.

## Prerequisites

- `typescript`

## Cases

**First** and my favorite is `ts` and `Map`:

```typescript
const map = new Map<string,string>()

map.set('tsIsAmazing','thinkNot')

// some
// a lot of
// code
// here

const data = {...map}

data.set('isItWillWork','NOPE')
```

In this case, we have no errors from the typescript in the last line, but if we run this code it will bring an exception like: `data.set is not a function`. Be careful

**Second**:

```typescript
const merge = <T, F>(source: T, target: F) => ({...source, ...target});

const str = {func: () => '42'};
const num = {func: () => 42};
const fn = {func: () => Function};

const merged = merge(str, merge(num, fn)).func()
console.log(merged);
```

You can guess what will me in the last `console.log`, but, sadly it will be a `string` (as typescript guessing), but in the runtime, it will be `Function`.

**Third**
```typescript
const test = NaN as const
```
It will throw an `ts` exception like: `A 'const' assertions can only be applied to references to enum members, or string, number, boolean, array, or object literals.(1355)`, but from the typescript: `var NaN: number`.

**Fourth**
```typescript
class Person{
  age: number
  constructor(age:number){
    this.age = age
  }

  getAge(){
    return this.age
  }
}

const {getAge} = new Person(18)

getAge()
```
Looks like normal code, but in this case, we will have an error from the `getAge` invocation like: `Cannot read properties of undefined (reading 'age') `

## Outro

There are a lot of cases like this and a lot of issues in `ts` repo, this is only 4th and I can write more and more but it's not my point. My point is to keep in touch with ourselves that typescript is not safe and not reliable in some cases.

<img width="100%" style="width:100%" src="https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExY2dqajE4czhuYnFnajRvbHVkdnBwcW1ocXZiZW41YWtrcGx3Z2lhOCZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/2KAGlmkPywhZS/giphy.gif">
Does GPS need internet to work?
Tags: gps, internet, tech, explanation
Published: 2024-05-23 17:59:36

Ever wonder how GPS works without the internet?
I am here to explain how it exactly works.

## GPS: The Magical Map

**1. Satellites in the Sky:**

- Up high in the sky, there are lots of satellites. Think of them as magic helpers flying around the Earth.

- These satellites are constantly sending signals to the ground.

**2. Your GPS Device:**

- Your phone or GPS device is like a special receiver that listens to these signals.

- It doesn't need the internet to hear these signals because they're always being sent from the satellites.

**3. How It Finds You:**

- When your GPS device picks up signals from at least four satellites, it can figure out where you are.

- It's like the device is talking to the satellites, asking, "Where am I?" and they help it figure out the answer.

## The Process in Simple Steps:
**Listening to Satellites:**

- Imagine you're in a big open field, and you hear a voice from each corner of the field.

- Your GPS device does something similar. It hears signals from different satellites.

**Measuring Time:**

- Each signal takes a tiny bit of time to travel from the satellite to your device.

- By figuring out how long each signal took to arrive, the GPS device can tell how far away each satellite is.

**Drawing a Map:**

- Your device uses this distance information to draw imaginary circles around each satellite.

- Where these circles overlap is where you are. It's like connecting dots to find your spot on a map.

## Why No Internet Needed?

- Radio waves don't need the internet to travel. They move directly from the satellites to your device.

- Your device just needs to listen to the signals and do some quick math to figure out your location.

- Just like you don't need the internet to listen to the radio in your
 car.







So, the medium for sending data between your mobile device and the satellites is radio waves. These waves travel directly through space and air, bringing the satellite's location information to your device.

---

I hope this article helps you❤️
Check out my other handles: richard.is-a.dev/about
Top Packers & Movers in Rajajinagar, Bangalore
Published: 2024-05-23 17:58:56

Relocating can be a daunting task, whether it's moving to a new home or shifting your office space. The stress of packing, loading, transporting, and unpacking can often overshadow the excitement of starting afresh in a new location. However, with the right assistance, this process can become significantly smoother and more manageable. This is where **[Ferry Go Logistics Packers and Movers](https://ferry-go.com/)** steps in as your reliable partner for all your packing and moving needs in Rajajinagar, Bangalore.

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

Ferry Go Logistics is a renowned name in the industry, known for its professionalism, efficiency, and commitment to customer satisfaction. With years of experience under their belt, they have mastered the art of relocation, ensuring a seamless transition for their clients every time.

What sets Ferry Go Logistics apart is their attention to detail and personalized approach to each move. They understand that every relocation is unique, with its own set of challenges and requirements. Hence, they offer customized solutions tailored to meet the specific needs of their customers. Whether you are moving within the city or across the country, they have the expertise and resources to handle it all with ease.

One of the biggest concerns during relocation is the safety of your belongings. Ferry Go Logistics prioritizes the security of your possessions and employs stringent safety measures to ensure that everything reaches its destination intact. From sturdy packing materials to well-maintained vehicles and skilled personnel, they leave no stone unturned to safeguard your valuables throughout the journey.

Moreover, Ferry Go Logistics takes pride in their punctuality and reliability. They understand the value of time and strive to deliver prompt and efficient services, adhering to the agreed-upon schedule without any delays. This reliability has earned them the trust and loyalty of countless satisfied customers over the years.

Customer satisfaction is at the core of **Ferry Go Logistics**' business philosophy. They believe in building long-lasting relationships with their clients based on trust, transparency, and integrity. From the moment you reach out to them for assistance until the last box is unpacked at your new destination, they are dedicated to providing you with a stress-free moving experience.

So, if you're planning a relocation in Rajajinagar, Bangalore, look no further than Ferry Go Logistics - Packers & Movers. With their expertise, professionalism, and commitment to excellence, they will turn your moving day into a hassle-free affair, allowing you to focus on the excitement of starting a new chapter in your life.
Drainage Services Windsor Co
Published: 2024-05-23 17:51:05

In the charming town of Windsor, Colorado, where picturesque landscapes and varying elevations are a part of everyday life, effective water management is crucial for safeguarding your property. At Grey Rock Landscape, we specialize in providing top-tier **[drainage services Windsor CO](https://www.greyrocklandscape.com/windsor-colorado-drainage-services)**, to help you protect your home or business from water-related issues.
Easy Notes in VSCode: Scraps
Tags: vscode, extensions
Published: 2024-05-23 17:30:31

Hello, I'm [K@zuki.](https://x.com/corrupt952).

Today, I want to introduce a new VSCode extension I developed called `Scraps`. This extension is a handy tool for taking quick notes while coding.

## What is `Scraps`?

`Scraps` is a simple extension that allows you to write notes in the sidebar of VSCode. This extension helps you quickly jot down ideas or reminders that come up during development.

https://marketplace.visualstudio.com/items?itemName=corrupt952.scraps

### Key Features

- **Easy Note Creation**: You can write notes directly in the sidebar, making it easy to jot down thoughts quickly.
- **Save Functionality**: Notes are saved even after closing VSCode, so you can safely store your thoughts.
- **Simple UI**: The intuitive editor allows you to input notes in Markdown format.

## How to Install

Search for `Scraps` in the VSCode Extensions marketplace and install it.

You'll see an icon in the Activity Bar that looks like a notepad with a pencil. Click this icon to open the sidebar.

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

## How to Use

1. Open VSCode and click the `Scraps` icon in the Activity Bar.
2. Enter your text freely in the note area displayed in the sidebar.
3. No special save operation is needed; your notes are automatically saved.

## Background of Development

`Scraps` was born out of my need to take quick notes during daily coding sessions. Although I use other main note-taking tools, I often need to temporarily store notes that don't need to be kept long-term. I developed `Scraps` to fulfill this need for a simple, VSCode-contained note-taking tool.

## Use Cases

Some possible use cases for `Scraps` include:

- Writing notes or tasks that you don't want to include directly in your code.
- Temporarily storing commands or tokens until you can save them elsewhere.
- Keeping a simple to-do list for the day's tasks.

## Conclusion

`Scraps` is still in its early stages, but I plan to continue adding features and making improvements. If you have any feedback or suggestions, please let me know through the marketplace review section or the GitHub repository.

I hope `Scraps` enhances your coding experience!

https://github.com/corrupt952/scraps
Learning AWS Day by Day — Day 73 — AWS Organizations
Tags: aws, cloud, cloudcomputing, beginners
Published: 2024-05-23 17:10:30

Exploring AWS !!

Day 73

AWS Organizations

Lets you centrally manage multiple AWS accounts added to our ‘organization’.
If we are admins of an organization, then we can invite the existing customers of AWS to join Organization, or we can create it directly.

Features:
Centralized management system
Consolidated billing for all member accounts
Control over account’s usage
Integration with IAM
Consistent data replication
Standardized tags across accounts

Pricing:
No additional charges. Charges apply only to the usage of other AWS services by all member accounts.

Ways to access:
Console — Organizations can be managed through AWS management console or browser.
Command-Line Tool: Can use the services through CLI, and is faster than console.
AWS SDKs: have libraries for writing codes as well as access Organizations.
HTTPS Query API: gives programmatic access to Organizations and its services.

Quotas:
Maximum and Minimum values:

Number of roots in an Organization: 1
Number of OUs: 1000
Number of policies: 1000
OU maximum nesting in a root: 5
Number of member accounts created concurrently: 5

Expiration time for Handshakes:
Invitation to join Organization: 15 days
Request to enable all features in Organization: 90 days
Handshake is deleted and no longer appears: 90 days

How IAM works with Organizations?
1. Creates groups of accounts with Organizations
2. Attaches SCPs (service Control Policies) to those groups to centrally control the accounts.
3. Entities in AWS can only use services allowed by both SCP and IAM policies for each account


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