teleren/devto huggingface dataset:
How to config ESLint rules based on eslint:all
Tags: eslint
Published: 2021-08-14 02:40:41

用CRA创建的项目，在``package.json``中默认会有一个``eslintConfig``对象，引入CRA的默认ESLint设置：
```
"eslintConfig": {
  "extends": [
    "react-app",
    "react-app/jest"
  ]
}
```

在这个基础上，我们可以扩展和覆盖规则，比如这里我们通过``eslint:all``将所有ESLint的规则引入进来，规则很多，难免有一些规则不符合需要，根据自己的情况做一些修正。

修正规则按照文件扩展名来操作，防止将修改应用到自己不可预知的情况，一个文件可能会匹配多个规则，更加灵活。

```
"eslintConfig": {
  "extends": [
    "eslint:all",
    "plugin:react/recommended",
    "plugin:react-hooks/recommended",
    "plugin:import/recommended",
    "plugin:jsx-a11y/recommended",
    "plugin:flowtype/recommended",
    "react-app",
    "react-app/jest"
  ],
  "overrides": [
    {
      "files": [
        "**/*.{js,jsx}"
      ],
      "rules": {
      }
    },
    {
      "files": [
        "**/__tests__/**/*",
        "**/*.{spec,test}.*"
      ],
      "rules": {
      }
    }
  ]
},
```

先是禁用一些规则：不管是排序对象的keys，还是排序imports，实际代码都挺繁杂的，而且没有发现对运行效率的提升；在代码块内部前后都加一个空行，反而影响美观；多个变量设置一个const，很久以前就有的规则，但是会让写代码受到制约。几个规则都会影响开发效率，而不是提升，就去掉了。
```
"sort-keys": 0,
"sort-imports": 0,
"padded-blocks": 0,
"one-var": 0
```

将缩紧数量调整为2个空格，默认是4：
```
"indent": [
  "error",
  2
],
```

如果对象定义在一行，那么在对象内部保留空格，会增加可读性
```
"object-curly-spacing": [
  "error",
  "always"
],
```

和``padded-blocks``相关的另外一条规则，就是代码块之间的空行，默认是2：
```
"no-multiple-empty-lines": [
  "error",
  {
    "max": 1
  }
]
```

再有就是涉及到代码自动换行的规则，一个是数组元素，三个以后才多行，这样``useState``的情况就可以保持一行；另外一个是函数参数，保持一致，要么都换行，要么都在一行。
```
"array-element-newline": [
  "error",
  {
    "ArrayExpression": "consistent",
    "ArrayPattern": {
      "minItems": 3
    }
  }
],
"function-call-argument-newline": [
  "error",
  "consistent"
]
```

禁用测试代码函数长度的限制，测试代码本来就是描述行为，尤其是describe函数，就是用来分组用的，很容易超过默认的50行上限。
```
"max-lines-per-function": 0
```

### Related ESLint Rules
* https://eslint.org/docs/rules/sort-keys
* https://eslint.org/docs/rules/sort-imports
* https://eslint.org/docs/rules/padded-blocks
* https://eslint.org/docs/rules/one-var
* https://eslint.org/docs/rules/indent
* https://eslint.org/docs/rules/object-curly-spacing
* https://eslint.org/docs/rules/no-multiple-empty-lines
* https://eslint.org/docs/rules/array-element-newline
* https://eslint.org/docs/rules/function-call-argument-newline
* https://eslint.org/docs/rules/max-lines-per-function

### References
* https://www.npmjs.com/package/eslint-config-react-app
Diagram AWS Org Accounts
Tags: aws, python, javascript
Published: 2021-08-14 02:32:08

[Repo for code](https://github.com/rowlinsonmike/aws-org-mapper)

Many enterprises in AWS are leveraging AWS Organizations and AWS SSO for central management of accounts and access.

In larger organizations with many accounts, it can require a lot of clicking to figure out what the applied SCPs and permission sets are for a given account. 

Enter aws-org-mapper. 

This simple python script collects information from both the Organization and SSO services and produces an HTML document that contains a diagram for each account. Each account diagram shows the associated OUs, SCPs, and permission sets. 

Diagraming courtesy of [Mermaid JS](https://mermaid-js.github.io/mermaid/#/)

To get started, 
1. clone down the repo
2. ensure you have python 3.8+ and boto3 installed
3. [ensure aws credentials are available](https://boto3.amazonaws.com/v1/documentation/api/latest/guide/credentials.html)
4. execute the script `python aws-org-mapper.py`
5. open `aws-org-mapper.html` file generated in directory

Thanks for reading. Peace!
Simplicity = Opportunity
Tags: programming, youtube
Published: 2021-08-14 01:49:18

This is what I learned form the great talk by Rich Hickey at Rails Conf 2012

Rails Conf 2012 Keynote: Simplicity Matters by Rich Hickey - YouTube: {% youtube rI8tNMsozo0 %}

## Learnings

- **Simplicity is a choice**, we need to choose to have it
  ⇒ It is a work which has a major payoff

- Separate "Simple" and "Easy"
  ⇒ We(Programmers) tends to focus on ourselves by making "Easy" choices, but choose "Simple" to make it easy

- **Simplicity enables change**
  ⇒ Simplicity = Opportunity

## Memo

- Simplicity is a choice, we need to choose to have it
- Simplicity is prerequisite for reliability
- Simple vs Easy ⇒ Two very different things
⇒ Separate those two things
- Simple is objective
- Easy is relative
- Design is about pulling things apart
- Programmers focus on ourselves not Programs
- Make challenges easy by making it simple
- Simplify things is a work that has a big pay-offs
- Order creates complexity
⇒ use maps(hashes, objects)
- Don't lean on your tools, your tools don't care if your program is simple or not
- Simplicity enables change
⇒ Simplicity = Opportunity
The TRUTH about sexy; hot questions with real answers!  Podcast
Tags: podcast, relationships, advice
Published: 2021-08-14 00:55:42

We should all strive to keep our relationships alive and flourishing. We must ALL make a conscious effort of this in order to be successful at it. Relationships cannot be one-sided. Both parties must equally be committed to strengthen their qualities. So what is Sexy? The Truth conversation!



Wings In Relationships is our site, come visit!
[Part 2/4] ⚛️ Senior React Coding Interview, By A Professional React Developer 👨‍💻
Tags: react, javascript, webdev, tutorial
Published: 2021-08-14 00:48:39

**About Me:** I've been a professional web developer for just over 10 years now. I'm currently the lead web development instructor at [Better Coding Academy](https://codebetter.com.au), and as part of what I do, I post videos on our YouTube channel at [https://www.youtube.com/c/BetterCodingAcademy](https://www.youtube.com/c/BetterCodingAcademy).

_(Subscribe for awesome web development content!)_

Here's part 2 of the mock React coding interview! I go through table design in a bit more detail, showing how I'd start putting together some mock data and then transitioning it to a reusable, hooks-based approach – I hope you enjoy!

{% youtube 3X4TUQsjHbA %}

Happy coding!
How to search and find a specific keyword or term from the contents of a file in the Linux terminal?
Tags: resource
Published: 2021-08-14 00:00:00

---
  title: How to search and find a specific keyword or term from the contents of a file in the Linux terminal?
  published: true
  tags: Resource
  date: Sat Aug 14 2021 05:30:00 GMT+0530 (India Standard Time)
  canonical_url: https://melvingeorge.me/blog/search-find-specific-term-keyword-from-file-linux
  cover_image: https://melvingeorge.me/_next/static/images/main-c3e37d854e52aeb8b2401afee74e9c6a.jpg
  ---
  [Originally posted here!](https://melvingeorge.me/blog/search-find-specific-term-keyword-from-file-linux)
  
For searching and finding a specific keyword or a term from the contents of a file in the Linux terminal, you can run the `cat` command followed by the `path` to the file, then the `|` operator (aka pipe operator), then the `grep` command and finally the keyword you want to search for.

### TL;DR

```bash
# Search and find the occurrence of a specific
# word from the contents of a file
cat <PATH_TO_FILE> | grep <YOUR_SEARCH_TERM>
```

For example, let's say we have a file called `myFile.txt` which has some content like below,

**Example Content**

```txt
Wikipedia is a free content, multilingual online encyclopedia written
and maintained by a community of volunteer contributors through a
model of open collaboration, using a wiki-based editing system.
```

Now, we want to find the occurrence of the word `encyclopedia` from the contents of the `myFile.txt` file. We can do that using the `cat` and `grep` commands like this,

```bash
# Search and find the occurrence of a specific
# word from the contents of a file
cat myFile.txt | grep encyclopedia
```

The output of running the above command may look like this,

![output of running the command to search and find specific keyword](https://melvingeorge.me/_next/static/images/output-search-find-command-linux-d4f3ce530860406019ac489282a47d88.png)

As you can see that the word `encyclopedia` is highlighted in the output which shows us that it is present.

See the execution of the above command live in [repl.it](https://replit.com/@melvin2016/search-and-find-specifc-word-from-contents-of-file-linux#main.sh).

That's all 😃!

### Feel free to share if you found this useful 😃.

---
Mixing metaphors
Tags: softwareengineering, softwarecraftsmanshi
Published: 2021-08-20 09:44:56

---
title: Mixing metaphors
published: true
date: 2021-08-14 00:00:00 UTC
tags: softwareengineering,softwarecraftsmanshi
canonical_url: https://jhall.io/archive/2021/08/14/mixing-metaphors/
---

Software development is full of mixed metaphors. We talk about “engineering” and “architecture” a lot. Yet what we do has very little in common with the engineering and architecture we see in other industries (for example, bridge or house building).

In the last couple of decades, [craftsmanship](https://en.wikipedia.org/wiki/Software_craftsmanship) has taken hold as a metaphor for software development, complete with proposals for how developers should act as apprentices and journeymen on their path to software development mastery.

But software developers don’t have a trade guild in the sense that existed in medival Europe, which enabled and necesitated the apprentice/journeyman progression.

I’ve also seen attempts at using gardening as a metaphor for software development, because code and projects tend to grow in seemingly organic ways that can be influenced, but never completely controlled.

The trouble is that none of these metaphors really seems to capture the essence of the joys and frustrations of software development, software delivery, and software maintenance.

So what is the right metaphor?

Well, there isn’t one.

Or they’re all good.

Huh?

There’s no literally _accurate_ metaphor for software development for the simple reason that metaphors are never literally accurate. By definition:

> **metaphor** _noun_  
> a figure of speech in which a word or phrase is applied to an object or action to which it is not literally applicable.

But metaphors still serve a purpose. That purpose, though, is often hard for those of us trained in logic and exactitude to appreciate.

The whole purpose of a metaphor is to communicate. We use a metaphor as a stand-in for a complex or not-yet-understood reality, so that we can communicate about that reality in ways that the hearer can more easily grasp.

In this sense, talking about “engineering” is perfect, if the aspect of software development you’re attempting to communicate about relates to the design of a bridge in some way.

It’s probably less useful if you’re trying to describe the organic, fluid growth of a software project.

So there’s no need to banish one metaphor in favor of another (as the Software Craftsmanship Movement seems to have tried to do with the “engineering” metaphor). But we should be mindful about using metaphors that help us communicate in the moment. And if we can get our point across more effectively by mixing otherwise incompatible metaphors, why not?

Maybe we need more metaphors, not fewer.

* * *
_If you enjoyed this message, [subscribe](https://jhall.io/daily) to <u>The Daily Commit</u> to get future messages to your inbox._
Create a reactjs social media clones to impress your clients as a beginner and to get a job
Tags: reactnative, javascript, devjournal, redux
Published: 2021-08-13 23:00:26

This is a LinkedIn clone for beginners to impress your first client even get your dream job as a frontend developer.

Check out for my repository for the source code:

https://github.com/Khaireddine-tech/linkedin_clone0.1
ExpressWebJs 3 Is Now Released!
Tags: expresswebjs, node, javascript, typescript
Published: 2021-08-13 22:59:03

ExpressWebJs team is proud to announce the release of ExpressWebJs 3 and it’s now available to everyone. This release marks the start of the ExpressWebJs framework using Typescript. 

Also, this release includes improved authentication and authorization responses, job, middleware, route collections, sub-query improvements, among many other improvements.

Here are some of the new features included in ExpressWebJs 3:

* Model Types for SQL and NOSQL
* Maker Command
* Persistent Repository
* Multi Tenancy
* Social Authentication
* Encryption
* Hashing
* Route Groups and middleware
* Request Validation (Inline and external)
* Dependency Injection
* Service Providers
* Events And Listeners
* Queues
* Task Schedulers
* Web Socket


Please visit [Expresswebjs Docs](https://docs.expresswebjs.com/3.0/guide/introduction.html) for documentation and usage.

Thanks to everyone  who have contributed with issue reports and pull requests. Our next set of releases are due March 19, 2022.

How can you help?
If you’re interested in helping out, or if you have general questions, please ask on stackoverflow.com using the ExpressWebJs tag or chat with the community on [Discord](https://discord.com/invite/vrPGZCgJuj)
Day 430 : Invincible
Tags: hiphop, code, coding, lifelongdev
Published: 2021-08-13 22:52:28

_liner notes_:
- Professional : Whew... What a way to end the week. Worked on finishing up some projects. Didn't get everything done because I spent some time on a Twitch livestream with a coworker. They asked me on to talk about side projects. I said sure. Always down to talk about coding. Normally, the interviews are around 30 minutes but we went almost 2 hours. haha Once you get me talking about code, HIPHOP and side projects, I'll just keep talking and showing demos. haha It was a really good conversation. Had a good time, but I was wiped out afterwards. haha.

- Personal : So last night, I installed PM2 on my Google Cloud Compute Engine Virtual Machine. In my research, I came across it as a solution that will restart your server if it shuts down for any reason. For reasons beyond me, my server stopped working a little while me starting it up and tested streaming to it. Good news is that after using PM2 to manage my server, it's been up and running since last night. I even got to do a quick demo on the livestream that I was on earlier today and it worked just fine. I just streamed from my phone to the server and was able to show a video of the feed in a CodePen. Other than that, I started watching "Invincible". It's an animated show about super heroes. The ending of the 1st episode was wild! I'll see where it goes in future episodes.

![Looking into from the top of a very high waterfall in Sewu Waterfall, Indonesia that is covered in lush green plants and trees](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3190s7tj8czbakn1rini.jpg)

Still tired from the livestream show earlier, haha. Probably watch another episode of "Invincible", finish putting together tomorrow's radio show, look into topics for Sunday and maybe continue designing the layout for my next side project.

Have a great night and weekend!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube -7hwrEDjikA %}
DailyUI #003 - Landing Page (CodePen)
Tags: codepen, css, design, 100daysofcode
Published: 2021-08-13 22:48:57

DailyUI Challenge #003 - a landing page for my bear puppy Coconut.

Font: 
    - Raleway

[Color Scheme](https://coolors.co/604a4c-f6e7cb-f4d1ae-a7abdd-708d81-00272b): 
    - #604A4C - the shade of brown
    - #F6E7CB - page background color
    - #F4D1AE - shade of tan for bottom left blob
    - #A7ABDD - shade of purple for top left blob
    - #708D81 - shade of green for bottom right blob
    - #00272B - dark colored text

## How I made the color blobs for the background

The color blobs are made on Figma, exported as SVGs, and uploaded to a GitHub Gist. 

Then in the CSS for `.landingpage`:
1. Set the background color
2. Set the background image with the 3 gist URLs
3. Set the size for how big you want each blob to be
4. Set the position of where you want each blob to be placed.
5. We want no repeat and no overflow.

```
background-color: #f6e7cb;
background-image: url("https://gist.githubusercontent.com/anniedotexe/8ab1f7baa078c8024144e232dc3e6763/raw/913759318c00a3110706509c566e9da5335dfa3c/purple-blob.svg"),
		url("https://gist.githubusercontent.com/anniedotexe/8ab1f7baa078c8024144e232dc3e6763/raw/913759318c00a3110706509c566e9da5335dfa3c/tan-blob.svg"),
		url("https://gist.githubusercontent.com/anniedotexe/8ab1f7baa078c8024144e232dc3e6763/raw/913759318c00a3110706509c566e9da5335dfa3c/green-blob.svg");
background-size: 35%, 48%, 11%;
background-position: right top, left bottom, right bottom;
background-repeat: no-repeat;
overflow: hidden;
```

## CodePen

{% codepen https://codepen.io/anniedotexe/pen/poPYWbp %}
Persisting Data on Firebase Emulator
Tags: flutter, firebase
Published: 2021-08-16 12:51:41

---
title: Persisting Data on Firebase Emulator
published: true
date: 2021-08-13 22:30:00 UTC
tags: flutter,firebase
canonical_url: https://mukhtharcm.com/firebase-emulator-persist-data/
---

[Firebase Emulator Suite](https://dev.to/mukhtharcm/firebase-emulator-setup-for-flutter-5e81-temp-slug-9286537) is a great tool to develop with Firebase locally. It allows us to even use Firebase Functions without the _paid_ Blaze plan.

But by default, Firebase Emulators don’t store any data. That is, if I ran Firebase Auth Emulator and created a User when I run It next time, The User would’ve been deleted.

Or, All those [Notes you created in Firestore](https://dev.to/mukhtharcm/flutter-listview-from-firebase-firestore-59bl-temp-slug-3367788) would’ve wiped.

I don’t know about you, It is a mess to play with Emulator UI to add mock Data. So I’d rather save them.

Even though Firebase Emulators Don’t have something like Saving Data, Luckily, they Can Export and Import Data. Let’s dig into it.

## Exporting Firebase Emulator Data

While the Emulators are running, run the below command in another terminal to export emulator Data. Of course, it should be in the same folder as you’re running the Emulators

```
firebase emulators:export <export-directory>

```

This will export the emulator data to the Directory you specify.

There is another method to do it. If we start the Emulators with an `--export-on-exit` flag, the Firebase Emulator will automatically export Data when we shutdown it.

```
firebase emulators:start --export-on-exit

```

## Importing Emulator Data

We can import data from an earlier export by starting the emulator by running the below command.

```
firebase emulators:start --import <export-directory>

```

This will import data from the directory we earlier exported.

## Combined method

What if we can do both of these in a single command?

We can combine the above commands to make another command which will do both the functions. ie, Importing and Exporting.

```
firebase emulators:start --import <export-directory> --export-on-exit

```

The above command will import data from the directory we specify at `<export-directory>` and exports the emulator data on Exit to the same directory.

## Wrap

You can find more articles related to Firebase [Here](https://mukhtharcm.com/tags/firebase/)

Hope you found something useful here.

I’m always open to suggestions!

Let me know your suggestions and opinions on [Twitter](https://twitter.com/mukhtharcm) DM or drop a mail a [mukhtharcm@gmail.com](mailto:mukhtharcm@gmail.com).

If you’re feeling too generous, you can support me through [Buy Me a Coffee](https://buymeacoffee.com/mukhtharcm).

Finally, if you found this helpful, please share this within your reach so that more people can benefit from this. And Follow me on [Twitter](https://twitter.com/mukhtharcm) for getting more posts like these 😉.
Mengenal Goodreads dan Save Buku kamu di Sana
Tags: turorial, writing, reading, books
Published: 2021-08-13 22:22:54

Goodreads adalah platofrm terbaik untuk menyimpan buku para penulis. Setelah buku dipublikasikan di Goodreads maka buku Anda bakal muncul di pencarian Google. Tentu Goodreads bagus banget untuk eksistensi buku para penulis.

Ada banyak kelebihan ketika Anda menyimpan buku di Goodreads, selain bakal muncul di Google, buku Anda juga punya kesempatan untuk kemudian dikasih banyak bintang oleh para pembaca buku. Dan Anda hanya perlu menjaring mereka untuk mereview buku Anda di Goodreads.

Bagi yang belum tahu, mari mengenal Goodreads dan save buku di sana!

Apa itu Goodreeads?

Menurut Wikipedia (klik di sini: https://id.wikipedia.org/wiki/Goodreads), Goodreads sangat memungkinkan anggotanya menampilkan daftar buku yang sudah dibaca, buku yang sedang dibaca, dan akan dibaca. Dalam situs perbukuan ini, pengguna Goodreads dapat saling berbagi rekomendasi buku dengan memberikan review, dan juga komentar.

By the way, GoodReads mempunyai konten untuk friend, group, maupun discussion. Perlu diketahui bahwa, Goodreads adalah website referensi judul buku, bukan untuk baca buku online. Maka dari itu, Anda tidak bisa membaca buku di sini. Yang ada bisa, hanya untuk menyimpan buku dan mereview buku.

Lalu bagaimana cara menyimpan buku kamu di Goodreads? Atau buku yang sudah kamu baca?

Cara Menyimpan Buku Kamu di Sana

Untuk menyimpan atau masukin buku di Goodreads, sangat lah mudah. Caranya, silakan klik (https://www.penulisgarut.web.id/2021/08/memasukkan-buku-di-goodreads.html), yaitu dengan cara manual. itu pun kalau buku yang Anda cari tidak ada. Kalau ada, Anda tinggal mengulas saja buku tersebut

Tapi, bagi penulis yang baru menerbitkan buku, biasanya bukunya tidak ada. Maka dari itu, langsung saja tambahkan buku Anda secara manual. Ikuti langkah-langkahnya dengan mengklik link di atas tadi.

Goodreads mewadahi komunitas pembaca

Dengan adanya Goodreads dan memang platform ini sudah sangat lama, maka ia akan mewadahi komunitas membaca. Oleh sebab itu, Goodreads bagus banget untuk memajukan komunitas literasi di Indonesia.

Anda sebagai penulis dan pembaca, silakan stalking di Twitter tentang Goodreads. Lalu temukan komunitas pembaca Anda.

Semoga bermanfaat.