teleren/devto huggingface dataset:
React functional components: const vs. function
Tags: react, javascript, webdev, discuss
Published: 2020-06-03 07:50:51

---
title: React functional components: const vs. function
published: true
description: Today I was wondering if there is any real difference in declaring a new component with the const arrow function syntax and function syntax. Tldr: Hoisting, I guess? 
tags: react, javascript, webdev, discuss
cover_image: https://www.pluggedin.com/wp-content/uploads/2019/12/dude-wheres-my-car-1024x556.jpg
---

I have been performance optimizing our app recently and as such, I have been getting into the nitty gritty of Javascript. One of the things I thought about is if there's any real difference between declaring a component like this: 
```js
const MyComponent = () => {
    return(
      ..
    )
}
```
vs.
```js
function MyComponent() {
    return(
      ..
    )
}
```

In this form the `function` syntax is slightly shorter. 

**And then?**

At times, we can write the arrow function like this:
```js
const MyComponent = () => (...)
```
If we put normal parenthesis after the arrow we don't need to write the `return`. So it's shorter if we can return immediately. 

**And then?**

Another thing I have seen people talk about is the `export` of the component.

```js
export default function MyComponent() {}
```
vs. 
```js
const MyComponent = () => {}

export default MyComponent
```

The function syntax gives us the ability to export default the component in place. 

**And then?** (any Dude where's my car fans here?)

### Hoisting ###

Turns out the biggest reason (as what I could find) is due to hoisting. Let's look at an example with Valid syntax:

```js
// I like to write my components before I use them

const MyComponent = () => {}

const AlsoMyComponent = () => {}

const App = () => (
    <>
      <MyComponent />
      <AlsoMyComponent />
    </>
)
```

**And then?** Let's look at invalid syntax:

```js
const App = () => (
    <>
      <MyComponent />
      <AlsoMyComponent />
    </>
)
// I like to keep my components at the bottom

const MyComponent = () => {}

const AlsoMyComponent = () => {}
```

This example 👆 will engage your linter to throw an error. Because the components are used before they are declared. 

So if you like to keep your components on the bottom, and use them before they are declared we can write them with the function syntax, and have them hoisted to the top of the file.

```js
 const App = () => (
    <>
      <MyComponent />
      <AlsoMyComponent />
    </>
)
// I like to keep my components at the bottom

function MyComponent() {}

function AlsoMyComponent() {}
```
This example 👆 will **not** engage your linter, because when we run the file it will look like this to the JavaScript engine:

 ```js
// Components are hoisted to the top.

function MyComponent() {}

function AlsoMyComponent() {}

 const App = () => (
    <>
      <MyComponent />
      <AlsoMyComponent />
    </>
)
// I like to keep my components at the bottom

👀 where did they go?
```
**And then?**

That's it! I think...? If you have a different idea then me, or know more differences please let me know!
Block Chain: The new face of Revolution
Published: 2020-06-03 07:45:38

The present world is becoming the world of Cryptocurrency. Block chain has become an inevitable element of technological advancement. The immutability of block chain network and the security that it offers makes this an extremely reliable way of making transactions.

Block chain technology can be used to create a permanent, public, transparent ledger system for compiling data on sales, tracking digital use and payments to content creators, such as wireless users or musicians.It facilitates collaborative tracking of all sorts of transactions and interactions between business entities. This new block chain technology behind bitcoin is changing how we handle money, conduct business and almost all the transactions done in real world.

Through block chains, companies gain a real-time digital ledger of transactions and movements for all participants in their supply chain network.The benefits to be gained will save you time, money, and effort on several fronts — and have the potential to redefine how you do business.

It's decentralized nature and cryptographic algorithm make it immune to attack. In fact, hacking a Block chain is close to impossible. In a world where cyber security has become a key issue for personal, corporate, and national security, Block chain is a potentially revolutionary technology.
#2: From Idea, to Build, to Launch in 1 week, live on Twitter.
Tags: beginners, react, javascript, webdev
Published: 2020-06-03 07:40:35

---
title: #2: From Idea, to Build, to Launch in 1 week, live on Twitter.
published: true
description: From Idea, to Build, to Launch in 1 week, live on Twitter.
tags: ["Beginners", "React", "JavaScript", "Webdev"]
---

Hey folks,

I'm doing this new project, from idea, to build, to launch in 1 week. I've built all this awesome stuff in my professional developer career, but doing these small solo projects is another kind of journey. 

This is my second project: A tool to simply create a digital accounts card in minutes. No signup needed. Easy to to share different accounts.

The app is built with React, Redux, TypeScript and Firebase in one week. I build my stuff in public, tweeting everyday about the mental and technical hurdles. You can read it [here](https://twitter.com/miku86com/status/1265190217872551942).

Launching feels very intimidating to me. Not that much best practices, I even didn't add that much testing. For a professional perfectionist like me this feels very odd. But adding all best practices leads to more procrastination. A valuable skill to learn:  publishing stuff although it's not even close to perfection.

Also, I tried to build the project very fast, so no hour-long thinking about the architecture and the tooling. Simple Create-React-App with TypeScript, Redux (although no need for it), but nowadays it's very easy to plugin. A simple Netlify deployment.

[Link to app](https://accounts-card.netlify.app/)

I would love to see you using it. And I love your feedback. 
Do you miss some accounts? Do you see some errors?

I would love to hear about your side projects?
What do you build? What are your struggling with?
Web Developer Resources At One Place
Tags: webdev, javascript, ruby, opensource
Published: 2020-06-03 07:26:27

Hi there. 

I just discovered a blog/github-page that is compiling other resources that are frequently needed by web-developers. 
You can find, tutorials, public APIs, suggested podcasts and YouTube channels and more. 

Check this site here:
**https://webdevscom.github.io/**
Rust Web development | Boilerplate free with Rocket
Tags: rust, webdev, tutorial, postgres
Published: 2020-06-03 07:14:23

{% youtube tjH0Mye8U_A %}

An overview of the Rocket web framework for rust.
- Type Safe
- Boilerplate Free
- Easy to use
- Extensible

Including examples:
- Create a Hello World service 
- Create a TODO service with a Postgres database using Diesel ORM.

⏱️TIMESTAMPS⏱️
0:00 Rust Web development with Rocket
0:07 What is Rocket?
0:49 Rocket overview
3:32 A couple of things to consider before using Rocket
4:22 Building a Hello World service
8:37 Define custom configuration
9:29 Building a TODO service with a Postgres database
9:34 Setup a Database service using Docker and Docker Compose
10:12 Diesel to manage database migrations
12:19 Diesel and Serde dependencies
12:58 Rearrange the endpoints
13:20 Use the Schema file generated by Diesel
13:47 Define the models for the TODO service
15:04 Define handler to create new TODOs
15:52 How to get a DB connection with Rocket?
17:09 Create new TODO
18:00 Define handler to list all TODOs
18:54 Define the database configuration
19:20 Testing the TODO endpoints
20:27 Bonus: Define endpoint to mark a TODO as checked

📔 Source Code
https://github.com/nemesiscodex/hello-rocket

🚀 Rocket Web Framework
https://rocket.rs/
PhpUnitGen, testing, the new way!
Tags: showdev, php, testing, opensource
Published: 2020-06-03 07:12:21

You are part of the very exclusive club of PHP developers and you inflict yourself swirls of copy/paste to satisfy PHPUnit?
Unit tests haunt you even in your nightmares?

PhpUnitGen has been designed to make your nights sweater and your apps better tested!

## What is PhpUnitGen?

PhpUnitGen is a development tool for PHP 7.1 and up, which allows you to generate PHPUnit tests skeletons.

The project started in 2017. The first version, named `phpunit-generator` was released in 2018.

Here are some of the main features:

- Detects classes and traits, and instantiates them appropriately.
- Instantiate/mock the classes/traits object/scalar dependencies.
- Automatically generates tests for getter/setter methods.
- Binds with Laravel 5.8+ and the `php artisan make` command.
- Free web application and Restful API.

I started working on a brand new version in 2019, and it is now time to release it!

It is more modular, better coded and has new features.
The web application has been totally revised too, and is now working with Laravel Lumen and VueJS/Typescript.

## How to use it?

There are many ways of using PhpUnitGen: web application, command line, PHP code and even the Restful API.

All those possibilities are described in the web application, [phpunitgen.io](https://phpunitgen.io).

## TL;DR

PhpUnitGen is a tool to generate your PHP unit tests skeletons.

Just checkout the [phpunitgen.io](https://phpunitgen.io) website to quickly try the tool.
Understanding Kubernetes: part 29 – Pod lifecycle
Tags: kubernetes, devops, docker, beginners
Published: 2020-06-03 07:10:04

---
title: Understanding Kubernetes: part 29 – Pod lifecycle 
published: true
description: Serie of sketchnotes about Kubernetes. Explaining in a visual way Kubernetes principles.
tags: Kubernetes, DevOps, Docker, beginners
series: Understanding Kubernetes in sketchnotes
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/tun5igzl1ml5b6roq2qb.jpg
---

Understanding Kubernetes can be difficult or time-consuming. In order to spread knowledges about Cloud technologies I started to create sketchnotes about Kubernetes. I think it could be a good way, more visual, to explain Kubernetes (and others technologies).

We continue the serie of Kubernetes Sketchnotes with a focus on how Pod lifecycle. 

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

If you are interested, I published all the sketchnotes on Kubernetes (and new ones!) to make a "book" of 120 pages: ["Understanding Kubernetes in a visual way"](https://gumroad.com/aurelievache#uCxcr).

As usual, if you like theses sketchnotes, you can follow me, and tell me what do you think. I will publish others sketchs shortly :-).
Why Doesn't Ubuntu and Ubuntu Flavors/Remixes Work Better on ARM Computers?
Tags: arm, linux, ubuntu, hardware
Published: 2020-06-03 07:08:43

I develop Ubuntu Lumina, which recently has been trying to make noise about ARM. Currently Ubuntu has no Desktop editions for Ubuntu, and most of the flavors don't support or barely support ARM? Yes, Lubuntu has an image made for the Raspberry Pi, and Martin Wimpress (who is a Canonical employee with Ubuntu and Ubuntu MATE) has his [desktopify](https://github.com/wimpysworld/desktopify) project that turns the Ubuntu server image into a desktop - that being AFTER you installed the server image, connected to the WIFI or Ethernet, installed GIT, then cloned the thing, then FINALLY run the script and have a desktop environment with modifications for a better desktop user experience.

Lubuntu's Pi image isn't great unless you really like 16.04 LXDE, which Lubuntu doesn't support as of 20.04, and LXDE isn't offically supported anymore as a project (in favor of LXQt). Lubuntu and Ubuntu MATE are the only desktops with some outdated ARM support, Ubuntu MATE having 18.04LTS as the latest and Lubuntu at 16.04 at the latest. 

> However, when I started to fact-check and make sure no stone was unturned, I remembered Ubuntu Kylin was a thing. I checked and they have a 20.04 image for Ubuntu Kylin. Huge TIL (today I learned) for me personally.

This has been a gripe of mine, well before I even had the aspirations to make an Ubuntu remix... even before I used Linux full time when my friend showed me his Pi2 in 2018, a year before I used Linux.

Why doesn't Ubuntu support Raspberry Pi for desktop? Even in 2020, where when the Pi4 released, it had every desire for desktop use. My only possible answer is... laziness, no desire, no want. The reasons don't make sense, even when most light weight desktops like Xubuntu and Kubuntu having no ARM support. It irritates me. Mind you that is SUPPORT! Not including any sort of focus or care (considering the old images).

The title of this article isn't for explanation, it's for question. A question that irritated me so much that I gave in. I decided Ubuntu Lumina remix will have official images built for Raspberry Pi and will be working on Pine64 ARM editions as well. I announced that maybe a week ago.

I can't say if the other flavors or remixes will follow, but I hope they do. ARM is a great architecture, and it wouldn't be difficult to switch. I plan to work with Canonical's tool they used which in the words of Wimpress are "It's all the same debian-cd, live-image stuff the regular image are built from." - and there are alternative solutions as well.

Operating Systems like Manjaro support ARM and have machines that ship with Manjaro ARM. Don't bring in that "well Ubuntu's market doesn't call for it" as unlike with 32 bit systems, the ARM market is growing. So let's support ARM on Ubuntu, and if you want to make community built images, ask permission to use the name and run with it like you got Willy Wonka's golden ticket!
Data Science Course In Bangalore 
Published: 2020-06-03 06:46:44

Knowledge Science course enables you to master abilities like knowledge analytics, R programming , statistical computing, Machine Studying algorithms, time-sequence evaluation, K-Means Clustering, and more. On the end of this Information Science on-line coaching program, there might be quizzes that perfectly mirror the type of questions asked within the respective certification exams and aid you rating better. An ever-growing number of organizations are coming to know the importance of knowledge science, AI and Machine studying Regardless of trade or size, organizations that need to stay centered within the time of huge data have to efficiently develop and implement knowledge science capabilities or threat being left behind.

Information Science is the research of data utilizing scientific approaches as a way to extract useful insights.Often, firms have troves of information from which they can make strategic decisions or predict performance of the business in very exercise of analyzing data, manipulating it, and attempting to get some answers to the questions constitutes Information Science.

Quick-monitor your career with the Certificates Course in Knowledge Science Training in Hyderabad. Everyone can go for this Knowledge Science course no matter their prior skills. Having knowledge within the concepts of R programming, Statistics, Machine Learning algorithms, Regression modules & many different ideas is a must for succeeding within the analytics career of Data Science.

The demand for Information Science professionals will grow an estimated 1581-percent by 2020 and professionals with Python skills could have an extra advantage. Actual time mission primarily based on any of the chosen use instances, involving implementation of the assorted Knowledge Science ideas. So for those who get the proper Knowledge Science coaching in Hyderabad, you will be able to apply for prime positions in the world's main MNCs. <a href="https://g.page/ExcelRSolutionsBanaglore?share">Data science certification</a>   


The course curriculum in this Data Science Training In Hyderabad Program is specifically designed by specialists to enhance the current industry requirements. So, be a part of the very best information science course in hyderabad to reinforce your IT profession. Get accustomed to Knowledge Science & data analytics studying Techniques for novices. When you resolve to enroll in Intellipaat's Knowledge Science certification in Hyderabad, we are going to just remember to not only acquire the exact expertise as per industry requirements but in addition get lucrative jobs.

We are located at : 
Location : 
ExcelR - Data Science, Data Analytics Course Training in Bangalore
49, 1st Cross, 27th Main BTM Layout stage 1 Behind Tata Motors Bengaluru, Karnataka 560068
Phone: 1800-212-2120/ 070224 51093
Hours: Sunday - Saturday 7AM - 11PM
How to run multiple instances of Google Chrome on Mac
Tags: mac, terminal, googlechrome
Published: 2020-06-03 06:37:54

## A quick note on the use case
To have another Google Chrome instance (or many) running alongside your main instance allows you to separate accounts, plugins and bookmarks.
In this case I wanted to use a just-for-work Mac for personal use, but I didn’t want to mix bookmarks, plugins and accounts. I do have other devices in which I run Chrome with my Google account, and I do like the sync feature, but I don’t like the idea of syncing my personal data to the main instance of Chrome on this specific Mac as this is not its main use.
That said, here is a way of launching a separate instance of Google Chrome using the „—user-data-dir“ from the terminal.

## Launching a new instance of Google Chrome from the Terminal

Let’s say you have Google Chrome installed at „/Applications/Google Chrome“ and let’s say you want to save your new profile in „/Users/your-user/Documents/Chrome-Personal“

To do that you just have to run this command in your terminal:

```bash
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --user-data-dir=/Users/your-user/Documents/Chrome-Personal
```

After running the command for the first time the folder will be populated with all the required files and folders for your profile and all future data for this instance will be saved here. After the first launch that folder will look somewhat like this:
![](DraggedImage.png)

Now if you run your _normal_ Chrome instance (the one in /Applications), you will see one configuration, and if you run the previous command again you will see your other configuration, all with different plugins, passwords, bookmarks and accounts.

## Making an alias for the command
To laugh this second instance faster you may want to add an alias for such a command, let’s say `personal_chrome`.

For this you have to edit your terminal profile and add the following

```bash
alias personal_chrome="/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --user-data-dir=/Users/your-user/Documents/Chrome-Personal"
```


### ZSH
If you are on macOS Catalina, then you should, [by default](https://web.archive.org/web/20190826201542/https://www.theverge.com/2019/6/4/18651872/apple-macos-catalina-zsh-bash-shell-replacement-features "Apple replaces bash with zsh as the default shell in macOS Catalina"), be using [zsh](https://www.zsh.org/ "ZSH")  (I recommend using it with the awesome [ohmyzsh](https://ohmyz.sh/)).
 
To add an alias to „zsh“ just edit or create your `~/.zshrc ` by adding the previous alias. After that you have to reload your profile by running 

```bash
source ~/.zshrc
```


### Bash

If you are running and older version of macOS, then „bash“ is the default shell. To add an alias you should edit or create your `~/.bashrc ` by adding the previous alias. Then reload your profile by running 
```bash
source ~/.bashrc
```

After that you can just run `personal_chrome` in any new terminal and you will be opening the new instance (you may add as many instances as you want).
Not another tech X vs tech Y
Published: 2020-06-03 00:39:46

---
title: Not another tech X vs tech Y
published: true
description: In this post I look at things in tech without feelings 
tags: 
//cover_image: https://direct_url_to_image.jpg
---
I'm seeing yet another rise of battles between technologies. So this is my personal architectural opinion about it. It's meaningless. Underneath technology, there are chips that sum, subtract, multiply and divide you know. Computers execute mathematical operations, not personal preferences.

Want software cheap - use free - other people's platforms. They are not good enough? Choose the closest to your needs open source and adapt it. Self-host. 

Want non-ready software fast? Choose no-code tech, generating code framework or scripting languages. 
Want to reach people? Create a web version that will be openable on all form factors. If it's not good enough - use cross platform technology to create apps for the app stores faster.
Want fast software - use native technologies - the mobile platforms SDKs, Go/Rust/C++ for the back end. For the data layer - techs that are better indexed and scalable - even with duplication, that keep things in Ram. Look deeper in how code is executed and optimize every byte.
Want a mix of speed of development and performance - intermediate technologies like Java and .net. 
If You know some programming language and framework, you will develop faster than with other tools, but that is a subjective thing that doesn't change the architectural weaknesses.

My point is, looking logically, basing on what you have and what you need, there is a straight answer. Feed your developer brain with the input parameters - team experience, financial situation, goals, time and the output will be straight forward. Soo, if you dive into technology for money, because of the popularity, because of marketing, branding or some other fetish, this is on you. Please, stop this madness.

Originally posted this article on my blog 
https://tomavelev.com/blog/Making%20sense%20of%20software%20and%20technologies%20from%20little%20beyond%20developer%20%E2%80%93%20business%20point%20of%20view
Vanilla JavaScript String Split
Tags: javascript
Published: 2020-06-03 05:44:53

Today we are going to look at the `JavaScript` `String.split()` method.
This method is called on a string and will return an array of whatever we are splitting on.

## Using the JavaScript string.split() method

```js
var string = 'She sells seashells by the seashore';
var array = string.split(' ');
console.log(array);
// (6) ["She", "sells", "seashells", "by", "the", "seashore"]
```

As you can se we are using the `split` method with a space as argument. This will return an array of all the words.

If you pass an empty string it will split on each character like so:

```js
var stringTwo = 'Magic words';
var arrayTwo = stringTwo.split('');
console.log(arrayTwo);
// (11) ["M", "a", "g", "i", "c", " ", "w", "o", "r", "d", "s"]
```

The `split` comes with a second argument which is the limit of our output array.

```js
var stringThree = 'She sells seashells by the seashore';
var arrayThree = stringThree.split(' ', 3);
console.log(arrayThree);
// (3) ["She", "sells", "seashells"]
```

View or modify it on this Codepen.

<p class="codepen" data-height="265" data-theme-id="dark" data-default-tab="js,result" data-user="rebelchris" data-slug-hash="qBbWLrB" style="height: 265px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; border: 2px solid; margin: 1em 0; padding: 1em;" data-pen-title="Vanilla JavaScript String Split">
  <span>See the Pen <a href="https://codepen.io/rebelchris/pen/qBbWLrB">
  Vanilla JavaScript String Split</a> by Chris Bongers (<a href="https://codepen.io/rebelchris">@rebelchris</a>)
  on <a href="https://codepen.io">CodePen</a>.</span>
</p>
<script async src="https://static.codepen.io/assets/embed/ei.js"></script>

### 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)