teleren/devto huggingface dataset:
How to use loop in React.js?
Tags: react, beginners, codenewbie, webdev
Published: 2020-07-30 07:42:38

This article was originally published at https://www.blog.duomly.com/6-most-popular-front-end-interview-questions-and-answers-for-beginners-part-2/#how-to-use-loop-in-react-js

---

{% youtube DZ3n3nGxF_U %}

Like the if/else statements, when we would like to do loops in the JavaScript or TypeScript logic, we do not need to bother about any special rules.

It’s just a JS loop, as always, and we can use all types of loops (of course, not all of them are good for all cases, but it’s possible).

Anyway, we have a special reason why we should focus on the iteration methods when we develop apps for React.js.

We use iteration methods to render elements. For example, we can use iteration to render the whole list of products from the product array.

To do that, we can use few methods, one of the most popular is the map method, but we will cover the map in the separate section, and now we should focus on the other methods like loops or forEach method.

It is very popular to use loops like for-loop (in most cases the fastest one), for-in, or for-of to iterate through elements.

That method is useful when we use separate functions to render part of components, and it’s the best method for performance.

The second method that I’ve included in the example is the method with array.forEach().

This method, compared to the for-loops and map method, is the slowest one and doesn’t return the values like a map, so you need to have a special case to use it.

Let’s take a look at the code example with two for-loop and forEach methods:

```js
// First one with For of loop
function renderComponent() {
  const products = ['orange', 'apple', 'watermelon'];

  const list = []

  for (const [i, product] of products.entries()) {
    list.push(<li>{product}</li>)
  }

  return (
    <div>
      {list}
    </div>
  )
}

function Parent(props) {
  return renderProducts();
}

// Second with forEach method
function renderComponent() {
  const products = ['orange', 'apple', 'watermelon'];

  const list = []

  products.forEach((product) => {
    list.push(<li>{product}</li>)
  })

  return (
    <div>
      {list}
    </div>
  )
}

function Parent(props) {
  return renderProducts();
}
```
<a href="https://www.duomly.com/?code=lifetime-80">![Duomly - Programming Online Courses](https://dev-to-uploads.s3.amazonaws.com/i/bde89cw4h64z765g2l4r.png)</a>

Thank you for reading,
Radek from Duomly
Rails 6.1 adds annotate_rendered_view_with_filenames to annotate HTML output
Tags: rails, ruby
Published: 2020-07-30 06:33:35

---
title: Rails 6.1 adds annotate_rendered_view_with_filenames to annotate HTML output
published: true
description: Rails 6.1 adds annotate_rendered_view_with_filenames to annotate HTML output
tags: rails, ruby
---

{% reddit https://www.reddit.com/r/rubyonrails/comments/i0gyxe/rails_61_adds_annotate_rendered_view_with/ %}
The keyboard of the future
Tags: keyboard
Published: 2020-07-30 07:40:46

---
title: The keyboard of the future
published: true
description: mechanical keyboard Ergonomics
tags: keyboard 
//cover_image: https://direct_url_to_image.jpg
---



![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/ezv8f50ceqcedphp6fwn.jpg)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/9uleh391m62e4lgr2ka7.jpg)

It is manufactured using 3D printing, and the manufacturing documents can be found in warehouses such as github.
SCSS @import
Tags: css
Published: 2020-07-30 07:30:55

To get cracking with `SCSS`, I think a good and maybe the most useful starting point is `@import`.

SCSS uses a DRY (Don't Repeat Yourself) methodology. And one way to help with this is to separate code in specific files and folders.

Some files you can split up are: reset, variables, colors, fonts, etc.

## SCSS Import Usage

To use the `@import` we use the following syntax:

```css
@import 'variables';
```

As you can see, we don't use an extension.

We can ofcourse also import multiple files this way:

```css
@import 'reset';
@import 'variables';
@import 'fonts';
```

## How SCSS Import Works

So let's say we have a reset like such:

`reset.scss`

```css
* {
  margin: 0;
  padding: 0;
}
```

And then our `main.scss`

```css
@import 'reset';

body {
  color: #333;
  background: #efefef;
}
```

This will result in the following `main.css`

```css
* {
  margin: 0;
  padding: 0;
}

body {
  color: #333;
  background: #efefef;
}
```

## Using SCSS Partials

One powerful aspect is the use of partials.
You have to keep in mind `SCSS` will compile the normal `SCSS` files. But if we start our files with an underscore like: `_reset.scss` it will not be compiled directly.

To use a file let's say `_variables.scss` we can do the following:

```css
@import 'variables';

body {
  font-size: $defaultFontSize;
}
```

As you can see, we don't include the underscore in our import.

## Making use of Folders

Another thing we can do is use folders like such:

`base/_reset.scss`
`base/_fonts.scss`
`component/_buttons.scss`
`component/_dropdown.scss`

These can we used as follows:

```css
@import 'base/reset';
@import 'base/fonts';
@import 'component/buttons';
@import 'component/dropdown';
```

This gives our project way more clarity and organise our code.

### Thank you for reading, and let's connect!

Thank you for reading my blog. Feel free to subscribe to my email newsletter and connect on [Facebook](https://www.facebook.com/DailyDevTipsBlog) or [Twitter](https://twitter.com/DailyDevTips1)
The no hello policy
Published: 2020-07-30 07:25:02

*Original article : https://brainsorting.dev/posts/the-no-hello-policy/*
<!--
.. title: The no hello policy
.. slug: the-no-hello-policy
.. date: 2020-07-30 09:07:23 UTC+02:00
.. tags:
.. category:
.. link:
.. description: The no hello policy is a way to stop wasting time with good manners when having a specific question.
.. type: text
.. medium: yes
.. devto: yes
.. previewimage: /images/nohello.png
-->

# Please Don't Say Just Hello In Chat

``` txt
2010-07-19 12:32:12 you: Hi
2010-07-19 12:32:15 co-worker: Hello.
# CO-WORKER WAITS WHILE YOU PHRASE YOUR QUESTION
2010-07-19 12:34:01 you: I'm working on [something] and I'm trying to do [etc...]
2010-07-19 12:35:21 co-worker: Oh, that's [answer...]
```

It's as if you called someone on the phone and said "Hi!" and then put them on
hold!

Please do this instead:

``` txt
2010-07-19 12:32:12 you: Hi -- I'm working on [something] and I'm trying to do [etc...]
2010-07-19 12:33:32 co-worker: [answers question]
```
<!-- TEASER_END -->
Note that you get help minutes sooner, and you don't make them wait. Instead,
the co-worker can start thinking about your question right away!

You're trying to be polite by not jumping right into the request, like you
would do in person or on the phone. But Chat is neither of those things. Typing
is much slower than talking. Instead of being polite, you are just making the
other person wait for you to phrase your question, which is lost productivity.

The same goes for "Hello -- Are you there?", "Hi Bob -- quick question.", "Do
you have a sec ?", "yt?" and "ping". Just ask the question!

If you feel it's brusque to simply say "Hi" and ask the question, you can do
something like this:

``` txt
2010-07-19 12:32:12 you: Hi -- if you're not busy I was wondering if I could ask a question. I'm working on [something] and I'm trying to do [etc...]
```

Additionally, asking your question before getting a reply allows asynchronous
communication. If the other party is away, and you leave before they come back,
they can still answer your question, instead of just staring at a "Hello" and
wondering what they missed.

Some people like to probe with an initial "hello" to verify whether the presence
status shown is true, hoping they can determine whether the recipient is near a device,
then will immediately follow up with a call. Don't do that either.
If someone is able and willing to answer a chat message, it does not mean that they are also available for
a voice or video call.

Instead of sending a call probe, or asking "hey, do you have time for a call?"
(which is better but not great), you can try something like this:

``` txt
2020-07-08 12:32:12 you: Hi - do you have X min for a quick call to talk about XYZ? [etc...]
```

This does three things: it time bounds the request, it gives the recipient some context, and
it helps you remember what you wanted to talk about if the recipient can't or doesn't respond
until later.

This version was inspired by the original website [nohello.com](http://www.nohello.com/).
Acknowledgements go to the original anonymous author.
Show your portfolios
Published: 2020-07-30 07:19:50

# Hello!
## Today is great time to show work that You are proud off. Show yours portfolios,  get inspired  and reviewed. Constructive callback is welcome!

(here is my portfolio, RWD not done yet, so please visit in on desktop. Also i think that "logo" in left top corner is unnecesary: https://kamilmichna.github.io/) 

# Can`t wait to see Your work!
Building a job board and running it for FREE (🚨Warning : Very Hacky)
Tags: react, python, django, javascript
Published: 2020-07-30 07:17:56


### **A job board to solve my own problem**
As someone who has worked in multiple countries and still fond of it, I really wanted to find job board for a niche - **visa sponsored jobs for software engineers**. 

### **Yeah that's cool, but from where do I get job posts** 🤔
Job boards have a chicken and egg problem. You need traffic to bring in the job posts and job posts to bring in the traffic. So I decided to scrap some jobs from Stackoverflow job posts and eventually when I get ample job post of my own I can move on from it.

### **And so I began writing a web-scrapper**
I Started building a web scraper using Python and Django Rest Framework. It scrapped all the jobs and gave me back in a nicely formatted JSON format. Then I build the Job board UI in ReactJs. All very simple enough architecture, React fetches the list of jobs from Django RESTful backend.

### **Time for deployment (now here's the twist)**
Front end hosting is a seamless process these day. Numerous free options like Netlify, Render and Vercel. 🤔 But Backend hosting isn't free anywhere and it made me think should I really be paying for project which has no traffic and making no money. I mean I already have plenty of non monetized projects in my Github "Museum". 

### **I Finally took the El-Cheapo way**
I realized that there's no need to add new job everyday, I can simply to it every 5 days by just making my django project locally (on my machine) scrap all jobs and then I just dump it in a json file on the front-end manually.

### **Lesson Learnt**
🤖 Automation is cool, but at times the cost of automation is more than good'ole manual ways. My site is now live and running free of cost. you can check it out [here](https://www.visabyte.xyz/) and I have also open sourced the [front-end](https://github.com/TrakBit/visabyte-frontend) code.
Delete All Mess OF Academic Writing Via Assignment Help In Ireland

Published: 2020-07-30 06:26:49

When you are studying in Ireland universities and don’t want to take the stress of your assignment writing, you should opt for the best solution. In this context, you must count <b><a href="https://www.greatassignmenthelp.com/ie/">Assignment Help</a></b> even if you are studying in Ireland. When I in the same mess and couldn’t find someone to ask my questions, I placed an order for hiring an academic writer. I found these services are very effective and productive. I didn’t have to write a single word if you choose academic writing services. Because of the assistance of assignment helpers, I don’t need to take tensions of information or missing due dates until I have the support of professional writers. As I also checked many platforms and found the reviews of students on the online assignment help, they get enough time to tackle other activities. So, choose to connect with the reliable service provider of assignment writing and keep stress away from your reach in Ireland as well.
Free Web Development Resources
Tags: webdev, html, design, javascript
Published: 2020-07-30 06:21:30

First of all, this is my first post, I hope to post more things here, today I will share a post I saw on Instagram.

## Free Hosting 💾

* netlify.com
* firebase.google.com
* aws.amazon.com
* heroku.com
* pages.github.com
* vercel.com
* surge.sh
* render.com

## Illustrations ✏️

* undraw.co/illustrations
* drawkit.io
* icons8.com/ouch
* iradesign.io
* interfacer.xyz
* blush.design

## Icons 📱

* fontawesome.com
* flaticon.com
* icons8.com
* material.io/resources/icons
* iconmonstr.com

## Fonts ✍️

* fonts.google.com
* fontspace.com
* 1001fonts.com
* fontsquirrel.com

## Color Palettes 🦄

* pcoolors.co
* colorhunt.co
* paletton.com
* color-hex.com
* mycolor.space

I will add more features soon

Credits: twitter.com/denicmarko
toTimeString(), a JavaScript function to make sense of millisecond values
Tags: javascript
Published: 2020-07-30 06:03:07

From time to time I'm subtracting two `Date().valueOf()`s and trying to make sense of the string of numbers left behind. So first, this is what the output looks like. 
```javascript
> toTimeString(1010)
1s 10ms
> toTimeString(10101)
10s 101ms
> toTimeString(101010)
1m 41s 10ms
> toTimeString(1010101)
16m 50s 101ms
> toTimeString(10101010)
2h 48m 21s 10ms
> toTimeString(101010101)
1d 4h 3m 30s 101ms
> toTimeString(1010101010)
11d 16h 35m 1s 10ms

> toTimeString(0)
instantaneous
```
Looks like something you can use/adapt? Here's the code
```javascript
const toTimeString = (ms) => {
        if (ms === 0) {
            return "instantaneous";
        }
        const mss = ms % 1000;
        ms = Math.floor(ms / 1000);
        const scs = ms % 60;
        ms = Math.floor(ms / 60);
        const mns = ms % 60;
        ms = Math.floor(ms / 60);
        const hrs = ms % 24;
        ms = Math.floor(ms / 24);
        const dys = ms;
        const lst = [
            dys > 0 ? dys + "d " : "",
            hrs > 0 ? hrs + "h " : "",
            mns > 0 ? mns + "m " : "",
            scs > 0 ? scs + "s " : "",
            mss > 0 ? mss + "ms " : "",
        ];
        return lst.join("").trim();
};
```
First off, it checks for zero and if so returns "instantaneous". If not zero, then it uses division/remainder arithmetic to peel off the millisecond, second, minute, hour and day values. These are put into an array if they're greater than zero. If they're not, the slot gets filled with an empty string. Finally the array is joined with an empty string, trimmed and returned.

There may be a better way of doing this and if there is, please tell me!
Two major polyfill interview question's every js developer face.
Tags: javascript, interview, polyfill, reduce
Published: 2020-07-30 06:00:11

Js interviews are pretty much tricky in nature. Since js realm consist of myriad libraries and frameworks it demands a huge time for brief preperation itself. But many companies focus only on your core domain and technical understanding, here comes the importance of fundamentals. 
           Two importance areas companies evaluate are design patterns and your ability to write robust and reusable code.
           That is the primary reason most of the interviewer 've this question in their bag. Here i try to explain two commonly asked polyfill questions.One is bind and another one is reduce

Let's start with bind. Bind method enable us to call a function with different context.Bind primarily return a new function which has context provided as first argument and parameters as second.
```
Function.prototype.customBind=function(...args){
  let params = args.slice(1);
  let tempObj= {
    fn:this,
    ...args[0]
  }
    return ()=>tempObj.fn(...params);
}
```

The catch here is the `this` value of our customBind , since it is getting called on another function we 'll receive a function as `this`. 
```
const obj={
  name:"Adam"
}
function show(age){
  console.log(this.name,age)
}
let outFn = show.customBind(obj,29);
```

Considering above code snippet , we 'll receive function show as `this` value inside cutomBind.

Reduce is another one ,find my custom reduce function here
```
Array.prototype.customReduce = function(fn,acc){
  let contextArr = this;
  for(let i=0;i<contextArr.length;i++){
    acc = acc!==undefined?fn(acc,contextArr[i]):contextArr[0];
  }
  return acc
}
```

Here reduce method has two parameters 1. function 2. accumulator  later one is optional. In this case we need to add this function to Array prototype since it is an array function , thus value of `this` become the provided array upon which we called the reduce method. we can then iterate over the array and make an accumulated value by running the function provided.
Resolve issues of dissertation writing using online help
Published: 2020-07-30 05:59:20

Are you getting issues in write your dissertation? Do you need the help of an academic writer for writing your dissertation? Sometimes, it can’t a piece of cake to write an error-free dissertation for famous universities. When you can’t handle their time and find it tough to get the right ideas for dissertation writing, you may lose marks without any Dissertation Help. Nothing can be easy at the beginning, you need to put your efforts in the right direction and think about how to make your writing interesting for the reader. When you are studying in universities, you never want to take risk of losing your marks or performance. Think profoundly and deeply when things come to craft a dissertation in a constructive way so you can get full marks. Are you having issues while composing your dissertation? Do you want to get the right solution for your writing your dissertation? As a suggestion, take dissertation help service and connect with native academic writers in just a few steps. Before it gets too late for submission of your dissertation, place an order for experts, and get requisite assistance at the right time.

For More Relevant Information Visit here-
https://www.greatassignmenthelp.com/dissertation-help/
Use this - GrepWin [Windows]
Tags: usethis, dev, windows, tools
Published: 2020-08-26 00:59:26

---
title: Use this - GrepWin [Windows]
published: true
date: 2020-07-30 05:45:00 UTC
tags: Usethis,Dev,Windows,Tools
canonical_url: https://robbinespu.gitlab.io/blog/2020/07/30/use-this-grepwin-windows/
---

If you are linux enthusiast users then you know how to “grep” and how useful this tools.

Sadly, there is no built - in tool on Windows that can beat “grep”. So I looking for third party software and found this tool called as “ **GrepWin** ”.

It licensed under “GPL-3.0 License”. Oh, please take note it only can be use if you are using Windows 7 SP1 and above, It won’t work on Windows XP or Vista!

![](https://images2.imgbox.com/70/d5/IiU7XVUO_o.png#center) **My favourite assistant**

As you see, this tool support regular expression (regex) when searching or replacing operations. From screenshot, you can see `^(docs|bin|.metadata|.git|_site|.jekyll-cache|.git_none|build|.cvs|CVS|antsim|.recommenders|.class|(^/bin/.*$))$` are use to filter and exclude directory. After that `-*.html|*.class|-*.jar|-*.bin|-*exe|.project|*.xml | cuby.log*` are use to filter what file I don’t want it to check.

Plus option like file size, include hidden folder, include system folder, include binary file etc. The best part is it allow you to create backup when replacing text / strings is there if you need.

It also fast and not hang up when executed. I already tried searching with 18,000 files and it work very well. Bravo! Bravo! Bravo!

Since it opensource, you can visit [https://github.com/stefankueng/grepWin](https://github.com/stefankueng/grepWin) repository to fork and contribute. For binary file, you can download from [github release](https://github.com/stefankueng/grepWin/releases/latest) page directly.
Outlook VS Gmail- Which One Keeps Your Inbox Organized
Tags: outlookgmail, emailmanagement
Published: 2020-07-30 05:38:07

Want to speed up the workflow and improve productivity?


Keep your inbox organized!


As a business owner, you might be receiving 130 emails per day as an average. Managing them all requires a robust email client.


So, have your inbox organized well with productive features of email clients such as contact management, email management, calendar and scheduling, and filtering, etc. and get more time for other important business operations.


Outlook or Gmail? Which one keeps your inbox organized?
There is no clear cut verdict for this. Let’s dive into Outlook vs Gmail by its features, design, user experience, cost, integrations, etc. to decide it at last.


At a glance...
Both Outlook and Gmail are email providers. Incepted in 2004 by Google, Gmail has become a popular email provider in no time whereas Outlook (2013), the product (an email client) of Microsoft is giving a strong competitive edge to Gmail.


Interface!. The first impression!
Outlook:
This email-centered Outlook has a clean interface with a three-tabbed toolbar and is clutter-free than Gmail. The default color theme for this is Blue. Its inbox is filled with different ads that can be customizable and the size of the panels can be adjusted. And the users can open the message in a separate window.


Gmail:
Gmail also has a clean UI with a five-tabbed view and the default color theme is red and white. Users can personalize ads and access the chat window to manage communication in one place. Gmail users can customize the display of their inbox using predefined themes.


Storage space and cost! The 2 key factors that gain the majority!
Storage:



Which one is affordable?
Both Outlook and Gmail are free for personal use and costs for work or business accounts. Office 365 and G-Suite decide the cost of the email service.
https://www.mailtrim.com/blog/outlook-vs-gmail-which-one-keeps-your-inbox-organized
GitHub Actions: Manual triggers with workflow_dispatch
Tags: github, automation, devops
Published: 2020-07-30 05:27:46

In this video, I walked through my use case for manually triggering my [lighthouse-action](https://github.com/bdougie/live/blob/master/.github/workflows/lighthouse.yml).

Last July, GitHub shipped a way to create manual workflow dispatch for GitHub Actions, giving users the ability to create workflows manually triggered with the new `workflow_dispatch` event.

You will then see a 'Run workflow' button on the Actions tab, enabling you to trigger a run easily.

{% twitter 1280293501536735232 %}

I've actually wanted this for some time because it is helpful for running a workflow without cluttering up the commit history.

You can read more about `workflow_dispatch` in the [announcement on the github.blog](https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/).

For more action traction videos, [check out to my YouTube channel](https://www.youtube.com/watch?v=GhhoHOpp9HY). 

{% link https://dev.to/github/generate-semantic-release-with-github-actions-2lll %}
Book Bus Online with YoloBus
Tags: yolobus
Published: 2020-07-30 05:27:31

YoloBus offer Stringent cleaning & sanitization is followed. All high contact touch-points in the bus undergo deep cleaning and sanitization. Travelers can wait in the safe distance inside clean lounges, away from contamination. Strict physical distancing protocol will be followed with ample seating.
Visit- https://www.yolobus.in/bus-tickets/