teleren/devto huggingface dataset:
Como sobrescrever uma regra do eslint para uma pasta específica
Tags: javascript, todayilearned, braziliandevs
Published: 2022-06-25 21:09:05

---
title: Como sobrescrever uma regra do eslint para uma pasta específica
published: true
description: Nesse artigo vamos aprender a como mudar uma regra do eslint pra uma pasta específica
tags: #javascript #til #braziliandevs
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
---

Hoje passei por uma coisa no projeto onde eu trabalho, no qual minha tarefa foi adicionar o `ESLint`, porém não deveria deixar a regra do no-unused-vars nas migrations.
Essa era basicamente a minha config:
```json
{
  "rules": {
    "no-unused-vars": [
      "error",
      {
        "argsIgnorePattern": "^_",
        "varsIgnorePattern": "^_"
      }
    ],
  }
}
```

Aí eu pesquisei como eu faria isso no meu bom amigo DuckDuckGo(DDG), encontrei várias respostas, mas as principais foram:
- Criar um `.eslintrc.json` dentro da pasta de migration e sobrescrever as regras lá (não gostei muito)
- Usar a opção `overrides` do `ESLint` (gostei muito).

Vamos ver como fica com a opção de overrides:

```json
{
  "rules": {
    "no-unused-vars": [
      "error",
      {
        "argsIgnorePattern": "^_",
        "varsIgnorePattern": "^_"
      }
    ],
  },
  "overrides": [
    {
      "files": [
        "migrations/*.js"
      ],
      "rules": {
        "no-unused-vars": "off"
      }
    }
  ]
}
```

E foi assim que aprendi a sobrescrever uma regra do eslint para uma pasta específica.
Espero que tenham gostado deste artigo curto. Fiquem bem e até a próxima!
Day in a life of a fullstack student #1
Tags: webdev, javascript, typescript, react
Published: 2022-06-25 20:58:35

# Today I learned...
Today, I got an assignment to convert old Sass files to styled components with in React.
I have no idea what Styled Components are, so i pulled up a React course from my old Udemy account and started learning!

# Meanwhile...
Meanwhile we are working on a project, a laptop shop.
I was working on the styles a lot and enjoyed it very much.
I'll share the resault when I'll finish. 

# Whats coming up ?
Well, soon we will be starting to work on a backend to the laptop shop. I think we will do it in NodeJS and MongoDB, so if you have any tips and tricks this is the time to share!

Thanks for reading!
CSS
Published: 2022-06-25 20:25:38

CSS is a core technology for building Web pages. CSS stands for **Cascading Style Sheets** and is a style sheet language we use to style the presentation of a document written in **Hypertext Markup Language** (Html). 

CSS files can define the:
- typography _(font-size, font-color, font-weight, font-family, font-style, line-spacing, letter-spacing)_ 
- size _(background-size, font-size)_ 
- color _(background-color, font-color)_ 
- background _(background-size, background-image, background-position, background-color, background-clip)_
- indentation _(text-indent)_
- borders (border-width, border-style, border-color) 
- location of HTML elements.

There are three types of CSS:
- Inline
- Internal
- External
Hi...
Published: 2022-06-25 20:12:33

# Interests and current projects
- 🏎 I am a huge fan of Formula 1
- ⛏ Minecraft is my go-to game when I am bored 
- 🤖My strongest skillset is Discord bots
- I am currently contributing to [**Reddit TikTok Bot**](https://github.com/elebumm/RedditVideoMakerBot/)

# Big Projects
- I have several bots that I am maintaining and improving on a weekly basis, I have never had an unhappy customer and I hope to keep it that way! 

-  🌟 **LewisBot:** One of my largest projects yet which I am so grateful to lead. LewisBot is a Discord bot I am developing for the aspiring (and inspiring) tech youtuber, Lewis Menelaws. [**https://www.youtube.com/c/CodingwithLewis/**](https://youtu.be/3gjcY_00U1w) { [*Contact Lewis*](mailto:hi@lewismenelaws.com) }

# Tools and Languages

![SQLite](https://img.shields.io/badge/sqlite-%2307405e.svg?style=for-the-badge&logo=sqlite&logoColor=white) ![Visual Studio Code](https://img.shields.io/badge/Visual%20Studio%20Code-0078d7.svg?style=for-the-badge&logo=visual-studio-code&logoColor=white) ![Discord API](https://img.shields.io/badge/Discord%20API-%237289DA.svg?style=for-the-badge&logo=discord&logoColor=white)   
![Python](https://img.shields.io/badge/python-3670A0?style=for-the-badge&logo=python&logoColor=ffdd54)![Git](https://img.shields.io/badge/git-%23F05033.svg?style=for-the-badge&logo=git&logoColor=white) ![GitHub](https://img.shields.io/badge/github-%23121011.svg?style=for-the-badge&logo=github&logoColor=white)

# Contact Me
<img src="https://lanyard-profile-readme.vercel.app/api/744998591365513227"/> 
<a href="https://github.com/FreebieII" target="_blank">
<img src=https://img.shields.io/badge/github-%2324292e.svg?&style=for-the-badge&logo=github&logoColor=white alt=github style="margin-bottom: 5px;" /></a>
<a href="https://twitter.com/FredzDev" target="_blank">
<img src=https://img.shields.io/badge/twitter-%2300acee.svg?&style=for-the-badge&logo=twitter&logoColor=white alt=twitter style="margin-bottom: 5px;" /></a>
<a href="mailto:fred.zapke@outlook.com" target="_blank"><br>
<img src=https://img.shields.io/badge/Gmail-D14836?style=for-the-badge&logo=gmail&logoColor=white alt=gmail style="margin-bottom: 5px;" /></a><br>

[**My Website**](https://freebie.codes)
[**My GitHub**](https://github.com/FreebieII)
React with Typescript or Javascript
Tags: typescript, javascript, react, discuss
Published: 2022-06-25 20:02:29

Which side are you on? Typescript? JavaScript?

![typescript javascript circle](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8a2cycwjizprwhs09gus.png)
 
Typescript is in fact a superset of JavaScript, which means whatever code that runs on JavaScript will also be able to run TypeScript files. All JavaScript are valid TypeScript code but not all TypeScript are valid JavaScript code. Read that again. This concept is similar to how all CSS are valid SASS code, but not all SASS code are valid CSS code. Got it?

If you are familiar with Typescript and React, you are either running a React project with either commands:

`npx create-react-app my-app --template typescript`

OR

`yarn create react-app my-app --template typescript`

And you are transforming React JavaScript projects into TypeScript by running either commands:

`npm install — save typescript @types/node @types/react @types/react-dom @types/jest`

OR

`yarn add typescript @types/node @types/react @types/react-dom @types/jest`

_Tip: For those who want to introduce TypeScript into their projects but don't have the energy to do so: use [Bit](https://bit.dev/). You are able to create, compose, and publish decoupled React components with or without TypeScript. This means you can start introducing TypeScript into an existing React application, one components at a time!_

What's great about TypeScript:
1. Easy to read and understand components
2. Better support for JSX
3. Gradual adoption for existing projects
4. Benefits comes with Statics type checking and IntelliSense in general
5. Less amount of undefined errors
6. Better readability and maintainability

What's great about Javascript:
1. Dynamically types
2. Doessn't need to be compiled
3. Doesn't use declaration files
4. Is perfect for simple web applications
5. Fast re-compliation time

What are your thoughts? Do you prefer working with TypeScript or JavaScript? For which projects and why?

Happy coding!
Revision Python
Tags: python, programming, tutorial, beginners
Published: 2022-06-25 19:53:18

**Quick Summary on Python**

Invented By **Guido Van Rossum** in 1989, but publicly Python was available in _20th February 1991_.

Name Python was drived from a comedy circus show named **_"Monty Python's Flying Circus"_** which comes on BBC in late 1970s.

The main purpose of this Intro is below ---

**11 mind boggling Features of Python :-**

1. Simple and Easy to learn.

2. Free to use and huge community supported.

3. High level language i.e Understandable to anyone.

4. Procedure as well as Object Oriented Programming language.

5. Extensible.

6. Portable.

7. Platform independent.

8. Interpreted language.

9. Dynamically typed language.

10. Embedded.

11. Extensive libraries.


**Bonus** - Python idle shell works on a principle of REPL (Read Evaluate Print Loop)

_Thank you!_
Hope it's helpful.

Stay tune for the next part about **Basics of Python.**
A comprehensive guide to publishing and maintaining javascript libraries part 1
Published: 2022-06-25 19:52:59

As developers, we always have our favorite utilities that we carry around from project to project, usually a `utils` folder that contains snippets and scripts that we created or shamelessly stolen from StackOverflow.

We decided with my friend Youcef to create an npm package that includes those utilities, and after ~~helping him~~ watching him do that, I wanted to share and document the process in a series of articles.

---

## Let's start with the definitions

### what's a package ?:

> A package is a file or directory that is described by a package.json file. A package must contain a package.json file in order to be published to the npm registry 
> -- <cite>source [npm.com](https://docs.npmjs.com/about-packages-and-modules)</cite>

### What's npm?

npm stands for Node Package Manager. It's a :

-   repository of javascript packages that are primarily open-source and publicly available, but you can also create private ones
-   a command-line tool that manages project dependencies (installing packages, updating their version, or uninstalling them)

---

## Before starting:

Make sure you have Node and npm installed.

Run the command `npm --version` on the Terminal; if you don't have a version, then you should install [Node.](https://nodejs.org/en/)

## Creating a package.json file

Now that we know our vocabulary and have the necessary tools, let's create our first package it will be named `yanis-array-utils`, and it's an array utility library.

Create a folder and run `npm init` on the console.
Answer every question the command will ask you (give a different name to your package so you can publish it later as `yanis-array-utils` will be taken).


You will then have a file named `package.json` containing :

```json
{
  "name": "the-name-of-your-package",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \\"Error: no test specified\\" && exit 1"
  },
  "author": "",
  "license": "ISC"
}
```

## writing the code:

our first utility will be a function that returns the last element of an array, create a file named `index.js`

```jsx
function last(array) {
  return array[array.length - 1];
}
// last(["first","last"]) will return "last"
module.exports = last
```

That's it you now have an npm package.

### Publishing the package:

Now that we have the code of the package let's share it with the world.

Go to [npmjs.com/](http://npmjs.com/) and sign up.

In your command line run `npm login` then `npm publish`.

## Using the package

you can create another project and install you package as a dependency

with `npm install yanis-array-utils` and use it as shown below

```jsx
var last = require("yanis-array-utils");

console.log(last([1, 2, 5]));
```
---

in the next article coming soon we will discuss tooling to support exporting to different modules format and then in the third part of this series we will discuss about CI/CD.
GitHub Copilot
Tags: github, git, beginners, programming
Published: 2022-06-25 19:46:48

Disclaimer: My opinion is that GitHub Copilot is such an easy way for beginners going into programming for the first time to cheat their way around learning the basics and fundamentals truly needed to become a master of this craft.

If you are a beginner and learning programming for the first time, **DO NOT USE GITHUB COPILOT. THIS WILL BE YOUR DOWNFALL!!**

[Frequently Asked Questions](#frequently-asked-questions)

> [GitHub Copilot](https://docs.github.com/en/copilot/) uses the OpenAI Codex to suggest code and entire functions in real-time, right from your editor.

GitHub Copilot can be used within VS Code, Visual Studio, Veovim, JetBrains IDEs, etc. All your favorite editors alike. It takes all the guessing in trying to learn a new language or framework away, helping you find your way tackling bugs without having to go through docs or searching through Google.

> Trained on billions of lines of code, GitHub Copilot turns natural language prompts into coding suggestions across dozens of languages.

GitHub Copilot has a 60-day free trial but is $10/month or $100/year per user. 

![prices](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2rqqccgjy5zo8o4rmic9.png)
 
### Frequently Asked Questions
#### How does GitHub Copilot work?
OpenAI Codex was trained on publicly available source code and natural language, so it works for both programming and human languages.

#### What data has GitHub Copilot been trained on?
GitHub Copilot is powered by Codex, a generative pretrained AI model created by OpenAI. It has been trained on natural language text and source code from publicly available sources, including code in public repositories on GitHub.

#### Will GitHub Copilot help me write code for a new platform?
GitHub Copilot is trained on public code. When a new library, framework, or API is released, there is less public code available for the model to learn from. That reduces GitHub Copilot’s ability to provide suggestions for the new codebase.

#### Does GitHub own the code generated by GitHub Copilot?
GitHub Copilot is a tool, like a compiler or a pen. GitHub does not own the suggestions GitHub Copilot generates. The code you write with GitHub Copilot’s help belongs to you, and you are responsible for it. We recommend that you carefully test, review, and vet the code before pushing it to production, as you would with any code you write that incorporates material you did not independently originate.

#### What data does GitHub Copilot collect?
GitHub Copilot relies on file content and additional data to work. It collects data both to provide the service and saves some of the data to perform further analysis and enable improvements



Happy coding!
Try them all
Tags: programming, go, elixir, rust
Published: 2022-06-25 19:45:16

There are so many things we, programmers, want to try out, experience and play around with every day. It is so tempting to start a new project with new technology just because we believe it is cool. Does it really bring much value? How to get a hands-on experience in a rather short time frame without putting your work in danger?

There is actually, a solution. Reserve some time for yourself and pick the task. Make sure, the task is valuable, small and achievable. In one word — just use [SMART](https://en.wikipedia.org/wiki/SMART_criteria). That’s basically it. This way you definitely will get the desired result and spend a fixed amount of time without any risks.

At [XING](https://tech.xing.com/)  every engineer is able to dedicate 2 weeks per year to work on his own idea. We call such time — Hackweeks. I used that opportunity recently to try out 4 programming languages that I wanted to put my hands on for quite some time. I came up with the idea of a small console app and spend some time each day implementing that software using a particular programming language. By the end of the week, I had 4 repositories with the same app but written in Go, Dart, Elixir and Rust. I liked Go, but this is another story 😉
Laravel Pagination Pretty URL Example
Tags: webdev, laravel, php, pagination
Published: 2022-06-25 19:43:37

Hello Brother, In this article, we will talk about laravel pagination pretty url. This tutorial will give you simple lesson of how to make pagination pretty url in laravel. you'll learn laravel paginator pretty url. Here you will learn laravel pagination with pretty url lesson.

You can use this lesson with laravel 6, laravel 7, laravel 8 and laravel 9 version.

Laravel provides pagination default and it's working fine. But they generate URL with query strings and if you need to generate pretty url(seo friendly URL) for your pagination, Then I will help you with how you can do it.

https://www.freecoder.co/post/laravel-pagination-pretty-url-example-9021
Insert an Ellipsis into the Middle of a String
Tags: css, webdev, javascript
Published: 2022-06-25 19:41:23

The `text-overflow: ellipsis;` CSS property is one of those commands that's tricky to get right the first time, but once you've figured out the correct `overflow` and `white-space` options to go alongside it then it's easy to remember.

Occasionally we'll come across a scenario where we'd prefer to add an ellipsis somewhere in the middle of the text.  Displaying long URL's on-screen is a good example of this where it might be easier if we can draw particular attention to the domain name at the start and the and the targeted file at the end without breaking the user flow.

This isn't possible in CSS alone, and even if it were then we wouldn't have much control over where the ellipsis gets added.

I was able to fashion a simplistic solution to this using jQuery, although the approaches would be broadly similar regardless of your chosen flavour of scripting language.

```
if (displayText.Length > 40) {
    var start = displayText.Substring(0, displayText.Length - 25);
    var end = displayText.Substring(displayText.Length - 25);
    $targetObject = $`
       <div class='valueContainer middleEllipsis' title='{displayText}'>
          <div class='start'>{start}</div>
          <div class='end'>{end}</div>
       </div>`;
}
else {
    // fallback to a standard approach
    $targetObject = $`
        <div class='valueContainer' 
             style='overflow:none;text-overflow:ellipsis;white-space:nowrap;'>
            {displayText}
        </div>`;
}
```

The approach here, is to take your text value and split it at an appropriate juncture; we can then render both within separate elements and use a little CSS to ensure that everything flows properly even if the screen is too wide to require an ellipsis.

```
.middleEllipsis {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: flex-start; 
}

.middleEllipsis .start {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 1; 
}

.middleEllipsis .end {
    white-space: nowrap;
    flex-basis: content;
    flex-grow: 0;
    flex-shrink: 0; 
}
```
How to Get All Session Data in Laravel?
Tags: webdev, laravel, php, programming
Published: 2022-06-25 19:40:43

Hello Brother,

This is a short guide on laravel get all session data. I explained simply about how to get all session data in laravel. We will use laravel get all session data lesson. you will learn get all session data in laravel.

You can use this lesson with laravel 6, laravel 7, laravel 8 and laravel 9 version.

If you want to get all session data in laravel then I will help you with how to get it. Laravel provides session() helper or Session facade to getting all session data in laravel. you can get session all data in the blade file, controller file, model file, etc.
https://www.freecoder.co/post/how-to-get-all-session-data-in-laravel-4946
How to Send Automatic Email in Laravel 9?
Tags: webdev, laravel, php
Published: 2022-06-25 19:37:33

Hi Brother,

This article goes in detailed on send automatic email laravel 9. I would like to share with you laravel 9 auto send email. you'll learn auto send email laravel 9. We will use laravel 9 send scheduled emails. Let's get started with laravel 9 send mail automatically.

https://www.freecoder.co/post/how-to-send-automatic-email-in-laravel-9-5033
If you weren't a software developer, then what?
Tags: devjournal, programming, beginners, discuss
Published: 2022-06-25 19:36:58

What is your "what if" plan? What is your "back-up" career? your "lifeline" if software engineering somehow wasn't an option anymore for you?

Maybe one day, you decided you didn't want this lifestyle anymore? That you wanted something different...that you no longer loved creating online as much as you used to, etc. Then what?

Happy coding!
Javascript
Tags: javascript, basics, datatypes
Published: 2022-06-25 19:32:13




Hello👋

It's my first blog so i am not familiar with writing the blog...So could you provide me tips and feedbacks that needs to improved in the comment section .Thanks in advance!!!


Javascript is a scripting language which was used for manipulating dom but now it becomes more powerful with different frameworks.

## Javascript Data types:

1.  **Primitive Types**
       
      In Primitive types the datas are stored as values in memory(Call by value) and are fixed in size

          - Boolean
          - Null
          - Undefined
          - Number
          - String
          - Symbol

2.  **Non-Primitive Type**

       In Non-Primitive types the datas are stored in memory with its address and reference the value(Call by reference).It is not in fixed size

          -Objects


**_Boolean_**
It is either *true* or *false*
**Example**: var isOdd =true;

**_Null_**
In javascript null is an type where it as absence of any type.(i.e no memory was created for that particular value)
**Example**: var name=null;

**_Undefined_**
It means the variable with out any value.
**Example**:var name;

**_Number_**
In javascript both integer and floating values are assigned with 'Number' type
**Example**:var value1=5;/var value2=5.2
             

**_String_**
It is a combination of characters
**Example**:var greeting="hello";


**_Objects_**
In javascript objects are key and value pair
**Example**:var name={firstName:"john",
lastName:"doe"
}
Kadane's Approach
Tags: algorithms, codenewbie, programming, career
Published: 2022-06-25 19:22:03

Most common question for Kadane application is [here](https://leetcode.com/problems/maximum-subarray/).

Kadane Algorithm is an **iterative DP** algorithm which carries out calculation of maximum sum at a position by considering the same at previous position.
<br/>
So in the above mentioned question we are

- Taking `cur_sum=0` & `max_sum=INT_MIN` as variables

- We iterate over the array and check if 

    - *1.* `cur_sum>max_sum` and then 
    - *2* `arr[i]>max_sum` and then
    - *3*  `arr[i]>cur_sum`.



- Once it's done for the whole array, we return `max_sum`.
<br/><br/>

For the complete code check [Arrays/KadaneAlgo.cpp](https://github.com/Aishanipach/Cpp-Codes/blob/main/Arrays/largestSubarraySum.cpp)

Here, `max_sum_current` is the cur_sum and `max_ends` is the max_sum.

<br/>

```
class Solution{
    public:
 
    long long maxSubarraySum(int arr[], int n){
        
        long long max_sum_current=arr[0];  
        long long max_ends=arr[0];  
        
        for(int i=1;i<n;i++){
            max_sum_current+=arr[i];
            
            if(max_sum_current>max_ends){
                max_ends=max_sum_current;
                
            }
            
            if(max_ends<arr[i]) {
                max_ends=arr[i];
                max_sum_current=arr[i];
            }
            
            if(max_sum_current<arr[i]){
                max_sum_current=arr[i];
            }
        }
       return  max_ends;
    }
```