teleren/devto huggingface dataset:
Pro tips of using ES6 destructuring assignment and spread operator
Tags: javascript, es6, spread, destructuring
Published: 2020-05-26 22:54:16

Destructuring assignment and Spread operator are my favorite ES6 features. Today I want to show you two pro tips that you can use to write clean code.

### Remove unwanted properties

Sometimes you might need to write a function to convert an object to a different structure, and you might want to remove some properties from the object as you don't need them. Instead of directly deleting the properties from the object, you can use object destructuring to remove unwanted properties. See the code below.
```javascript
function makeVeggieBurger(hamburger) {
  // 😞
  delete hamburger.meat
  return hamburger

  // 😃
  const { meat, ...veggieBurger } = hamburger
  return veggieBurger
}


```
Here it uses object destructuring on `hamburger`, and gets `meat` property and puts all the other properties in `veggieBurger`. When it returns `veggieBurger`, it returns a shallow copy of `hamburger` without `meat`. This approach avoids mutating the original object, but achieves the same result with only a line of code.



### Conditionally add properties to an object

Continue with the example above, but this time we add a new parameter `isSpicy` to indicate if we want to add chili to the burger. If `isSpicy` is true, we want to add `chili` property to `veggieBurger`, but if `isSpicy` is false, we don't want to have `chili` property at all. See the code below.

```javascript
function makeVeggieBurger(hamburger, isSpicy) {
  const { meat, ...veggieBurger } = hamburger

  // 😞
  if (isSpicy) {
    veggieBurger.chili = 'hot'
  }
  return veggieBurger

  // 😃
  return {
    ...veggieBurger,
    ...(isSpicy && { chili: 'hot' }),
  }
}

```

Let's take a close look at this
```javascript
return {
  ...veggieBurger,
  ...(isSpicy && { chili: 'hot' }),
}

```

If `isSpicy` is true, it will be like

```javascript
return {
  ...veggieBurger,
  ...(true && { chili: 'hot' }),
}
```

which is
```javascript
return {
  ...veggieBurger,
  ...{ chili: 'hot' },
}
```

And as we spread it, it becomes
```javascript
return {
  ...veggieBurger,
  chili: 'hot'
}
```
This is how you add `chili` to the returning object.

If `isSpicy` is false, it will become

```javascript
return {
  ...veggieBurger,
  ...(false && { chili: 'hot' }),
}
```
which is

```javascript
return {
  ...veggieBurger,
  ...false
}
```
and when you spread `false`, it returns nothing, so this expression becomes
```javascript
return {
  ...veggieBurger,
}
```
which essentially is
```javascript
return veggieBurger
```
So we won't have `chili` at all. This approach will make you code much cleaner especially when you add multiple properties conditionally.

That's it. I hope you find it helpful. Feel free to let me know if you have any questions. You can also [find me on twitter](https://twitter.com/terrytyli).
Start with Programming, where to start?
Tags: programming
Published: 2020-05-26 22:48:50

So you decided to learn programming, but where to start?

With all the languages it can be overwhelming. If you are totally new, I recommend learning Python or Javascript.

This is a collection of resources to help you out. That can be a good starting point, depending on your mode of learning (some people prefer books)

## Python

Python is a language that is "easy" for new programmers because of the many introductory resources and syntax. 

That said, it will take some time to master if you never programmed before. The language can be used on the Raspberry Pi but also on the desktop computer.

* <a href="https://bsdnerds.org/learn-python/">Introduction to Python</a>
* <a href="https://pythonbasics.org/">Python basics tutorial</a>
* <a href="https://pythonspot.com/">More resources for Python</a>

You can also learn from a book/course, I recommend <a href="https://gumroad.com/l/dcsp">this one</a>.

## JavaScript

JavaScript is the language for the web. Every web app uses JavaScript and it's supported by all web browsers.

Both JavaScript and Python work on all computer systems. But JavaScript will run directly with any website you put it on, on every device (including television, watch, mobile phone etc).

* <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Introduction">Mozillas introduction to Javascript</a>
* <a href="https://javascript.info/intro">An introduction to Javascript</a>
k42s, a full kubernetes cluster running on top of vagrant.
Tags: kubernetes
Published: 2020-05-26 22:18:29

---
title: k42s, a full kubernetes cluster running on top of vagrant.
published: true
description: 
tags: kubernetes
---
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/i1dgbl0yq915esuh15xp.png)

Welcome to my very first post to the wonderfull community of dev.to and the broad audience of the internet. I do apologise whether this would sound as Shameless plug but somehow I would like to share my lates Kubernetes project.

Today I'm proud to present k42s, a full Kubernetes cluster running on top of Vagrant.

Why “k42s”?

This project is the result of getting my hands dirty with Kubernetes trying to fulfil my innate curiosity to understand how things work in the nitty-gritty details. In the beginning I have started poking around with Minikube, which at that time was quite convenient to run my experiments and demos. However, moving forward I have realised that to have a holistic understanding of Kubernetes ecosystem I had to play with something near running it in a real multinode production cluster where would possible to experiment with network policies, load balancers, ingress controllers, storage and more. Hence, I decided to build my own portable Kubernetes lab and share it with the world.

Code repository - https://github.com/p0bailey/k42s
K — exec into your Kubernetes pod easily
Tags: kubernetes, productivity, bash, showdev
Published: 2020-05-26 22:16:00

Hey!
Let me introduce you a tiny and a simple tool — [k](https://github.com/yggheim/k).
That thing can be quite useful if you use Kubernetes and kubectl with several contexts to access your pods.
That tool just only writes several commands for you, giving you simple interface via fzf. So you can exec into your pod just by entering "k" and hit Enter several times.
Little asciinema that shows full functionality and how it can save your time:
[![asciicast](https://asciinema.org/a/334149.svg)](https://asciinema.org/a/334149)
Embed FREE video conferencing into your React app in minutes
Tags: react, jitsi, video, conference
Published: 2020-05-26 22:14:19

---
title: Embed FREE video conferencing into your React app in minutes
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/cb3j4fb8rkoowtpzbdes.jpg
published: true
description: 
tags: [react, jitsi, video, conference]
---

Impossible you say? That's what I thought until I found Jitsi...

## What is Jitsi?

[Jitsi Meet](https://jitsi.org/jitsi-meet/)

> More secure, more flexible, and completely free video conferencing.

Is it really possible to get a video conference up and running in minutes? Lets find out...

## Dev notes

* [Jitsi Meet source](https://github.com/jitsi/jitsi-meet)

* [Web development notes](https://github.com/jitsi/jitsi-meet/blob/master/doc/api.md)

* [React Integration Guide](https://meetrix.io/blog/webrtc/integrate-jitsi-meet-to-react-app.html)


## React Component

There is an (unofficial) React component that wraps the standard Jitsi Meet JS API, we'll use it to speed up the React integration process. 

* [npm](https://www.npmjs.com/package/react-jitsi)
* [Github](https://github.com/gatteo/react-jitsi)


### Install

```
yarn add react-jitsi
```

Add Jitsi to your index.html in my case `public\index.html`

```
<body>
...
  <script src='https://meet.jit.si/external_api.js'></script>
...
</body>
```

### Create a basic meeting window

```
import React, { useState } from 'react';
import Jitsi from 'react-jitsi';

const roomName = 'my-super-secret-meeting-1234567-e89b-12d3-a456-426655440000';
const userFullName = 'Justin';

export const App = () => (
    <>
        <h2>My First Meeting!</h2>
        <Jitsi roomName={roomName} displayName={userFullName}/>
    </>
)
```
Run you app and you should have a running video conference 😀

# Conclusion

We got quite a bit done in a few minutes 😀

If you're looking for an embeddable video conference solution, I say give Jitsi a shot!

* Easy to setup
* Easy to integrate with React
* Open source
* Free servers all for the cost of the Jitsi logo!

What's not to like?

### BONUS End meeting

You may want to run some code when the user clicks End Meeting. You can do that by subscribing to the 'videoConferenceLeft' event.

Here I'm redirecting the user to the root of my site:

```
  <Jitsi
    ...
    onAPILoad={(api: any) => {
      api.addEventListener('videoConferenceLeft', () => {
        navigate('/');
      });
    }}
    ...
  />
```
React + Tailwind Starter
Tags: react, tailwindcss, beginners, tutorial
Published: 2020-05-26 22:10:47

`create-react-tailwind-app` is an npx generator that creates a starter project with tailwind configured without ejecting from `create-react-app`. This means you don't go through configuration hell that usually rains open you when you eject as a beginner.

Similar to using `create-react-app`, Open a terminal and run:

`npx create-react-tailwind-app`

This will prompt you with the name of the new project you'd like to create

```
you@computer: ~/projects $ npx create-react-tailwind-app
Project name:my-app
```

This will generate your new project `my-app` in a directory. Next, you can cd into the directory, install the dependencies and run the project.

```
cd my-app
npm install
```

This will install all the dependencies. To run the project, run:
```
//To build tailwind and run react-scripts
npm start
```
###expected output:

![Output](https://dev-to-uploads.s3.amazonaws.com/i/mpoec6vxeex09ty8os9u.png)


> You may want to change the package name in package.json if you plan to publish the project

Note: The index.css file is autogenerated and will be over-written on every run. If you want to add CSS changes, which I would recommend you not to, you should do them in the tailwind.css file.

```
@tailwind base;
// Base CSS here

@tailwind components;
// Component CSS here

@tailwind utilities;
// Util level CSS here
```

You can refer to (Tailwind CSS)[https://tailwindcss.com] for further reference to using tailwind

{% github gigincg/create-react-tailwind-app %}
Why you still love using linux?
Tags: linux, windows, question
Published: 2020-05-26 21:59:01

Hi ... I am a linux user and I really love linux. I am very comfortable working with linux especially in development.

Lately, many of my friends who have been using Linux have been switching to Windows. Yeah, their reason is because there is already WSL on windows. So they advised me to use Windows instead of linux. Hmmm ... honestly, I'm still hard to leave linux.

There are several points that make me still want to stick with linux, here are the reasons:
- Open source.
- Highly Customizable.
- High security.
- It's Free.
- Better Community Support.
- Privacy.

I think that's all for now. I think there are still many reasons there. Since I have only been using linux since 4 years ago, there may be other strong reasons to support my decision and maybe your decision to keep using linux as the main OS. If there is? please tell me in the comments.

One last thing, I like freedom, and I found it on Linux...
kubernetes installation on CentOS-7 - Part2
Tags: kubernetes, devops
Published: 2020-05-26 21:47:25

Howdy!

<link rel="canonical" href="https://jhooq.com/15-steps-to-install-kubernetes-on-bento-centos7/">

Welcome to my kubernetes series part 2. Again this article is going to be for the newbie who is willing to learn more about kubernetes than I think this hands-on session on installing Kubernetes on CentOS than I guess this article might be right place to start.

There are lots of automation options which for installing kubernetes .e.g kuberspray, terraform but as a beginner I would strongly recommend **go bare minimum** because that will let you fix all the nitty-gritty of the CentOS and kubernetes.

**Prereuisite**
1. Vagrant 
2. Virtual Box 

In my own way of installation, I came up a total of 15 steps which you pretty much follow here - [15 Steps for Kubernetes installation on CentOS](https://jhooq.com/15-steps-to-install-kubernetes-on-bento-centos7/)

But if you are more interested in practical than you can follow along on my hands-on session -

{% youtube w_NgQ2AxExQ %}
When starting a new project, when wouldn't you want to build in a cloud?
Tags: discuss, watercooler, architecture, cloud
Published: 2020-05-26 21:46:09

---
title: When starting a new project, when wouldn't you want to build in a cloud?
published: true
description: Cloud providers are great, but when might you opt for rack-mounting or similar hosting for a project?
tags: discuss, watercooler, architecture, cloud
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/uz8gpsm6nrv9wj41o27f.png
---
# My background
As a newer face when it comes to software development, from the onset AWS was pretty much what I learned and has been my go to since for deployment. I'm certified with them, and feel competent with the basic IT principles the core products are built on. 
# My Question 
While cloud computing has obviously created opportunities for products of all sizes, it typically come with trade-offs that are very unique depending on the products composition and demand. What kinds of products or projects have you worked on where cloud computing didn't work out or was unviable?
State of Technical Interviews - Need Your Help!
Tags: career, discuss, survey
Published: 2020-05-26 20:55:55

---
title: State of Technical Interviews - Need Your Help!
published: true
description: A lot has arisen lately about the state of technical interviews. I think we can do better and this is my contribution.
tags: career, discuss, survey
---

# Technical Interview Suck (my personal opinion)

I don't think I'm the only one who feels this way. There are a variety of ways to ascertain the knowledge of a developer during an interview. It seems to me that there's a mixture of like and dislike for any given method. For example, I can find about as many people who hate whiteboard questions as people who like them.

I believe the real devil is in the details, however.

Overall, technical interviews suck.

I propose that we can all do better.

# A survey for developers

It's my belief that there is actually a very proper way to qualify and quantify *all* the interview methods in use today. In a future post, I will propose an interview structure that anybody can use to determine the "fitness" of a developer regardless of domain, knowledge, seniority or experience.

For now, however, I think it's important that we developers get a voice. I've thus formed a survey that is completely anonymous.

It's broken into two sections. The first section has 13 questions, graded linearly, that should take only a minute to fill out. These are, I believe, critical questions that will give a decent overview of what we experience on our end. There's another section with more questions that are completely optional. However, the more you fill out, the better the quality of the data.

Comments and suggestions are welcome and, of course, THANK YOU to everyone who participates.

Please share this so we can get as many people as possible in the survey.

I promise to share this data publicly and use it in ways that benefit everyone who needs work or needs to employ workers in the technical fields.

[Google Doc Survey Here](https://forms.gle/7oZjGpbq7LtmG1xc8)
Quotes related to Machine learning
Tags: watercooler, machinelearning, datascience, discuss
Published: 2020-05-26 20:34:15

People come across quotes and sayings in their day to day life and some of them leave a deep impact on their minds. Some quotes are so inspiring or impactful that they are etched in the minds of people for eternity.

I am going to share some of the quotes related to machine learning and data science which really had a great impact on me. Do share your quotes which really thrilled you in the comments section.

> "We are drowning in information and starving for knowledge."

This quote describes the current situation of human race. We are generating tons and tons of data everyday but are unable to comprehend something from it. Data science is helping us bridge this gap between information and knowledge and converting raw information to knowledge.

>"There is no true interpretation of anything; interpretation is a vehicle in the service of human comprehension. The value of interpretation is in enabling others to fruitfully think about an idea."

The above quote justifies the fact that you build a however complex model or machine or system if it is not human-comprehensible there is no use building it. If it is not making the life of humans easier it is a waste. So, data must be interpreted by data analysts to help humans think and guide them in the process of thinking.

>"The quiet statisticians have changed our world; not by discovering new facts or technical developments, but by changing the ways that we reason, experiment and form our opinions."

This quote gives us an overview of the life of a statistician. He does nothing very extraordinary but by giving the interpretation of already existing data he helps people think differently. And this small thing has changed the life of many people and helped in enormous discoveries.
Build a warehouse management solution with react, django, react-native and AWS.
Tags: django, python, javascript, react
Published: 2020-05-26 20:30:46

Update on the project. 

I worked on the list views today.
*All Products, Shipments, Customers*

![Fullstack App](https://dev-to-uploads.s3.amazonaws.com/i/8dxpzgyk2af81eftg72p.gif)

Up next I have to work on Authentication from the frontend. My Django Backend already exposes a route '/api-auth' which uses basic authentication as it's authentication scheme. 


![Desmond's Fullstack App](https://dev-to-uploads.s3.amazonaws.com/i/pnbevxpjil8lnn7o73xt.jpg)
100 Days of SwiftUI — Day 6
Tags: 100daysofswiftui
Published: 2020-05-26 20:26:26

---
title: 100 Days of SwiftUI — Day 6
published: true
date: 2020-05-26 20:25:41 UTC
tags: 100daysofswiftui
canonical_url: https://zeitschlag.net/100-days-of-swiftui-day-6/
---

Today's my [sixth day of 100 Days of SwiftUI](https://www.hackingwithswift.com/100/swiftui/6) and today was about closures. I've struggled with them so far as I find them pretty hard. And it seems, [I'm not the only one](https://fuckingclosuresyntax.com). So I felt a bit delighted, when Paul mentions this at the introduction:

> If you find closures hard it’s not because you aren’t smart enough – they _are_ hard [...]

Nevertheless, I watched those five videos, passed the tests, learned something — feels like a lot — and I'm slightly looking forward to giving them a try tomorrow, when I'm working from home. I really liked, that there were only five videos today :-)

Oh, even back in the good ol' days of Objective C, when closures were called blocks, I had issues with them. And again, [I'm not the only one](http://fuckingblocksyntax.com).

<!--kg-card-end: markdown-->
One Month Update
Tags: javascript, webdev, codenewbie, beginners
Published: 2020-05-26 20:02:19

---
title: One Month Update  
published: true
description: 
tags: javascript, webdev, codenewbie, beginners
---

My first month has been successful in documenting my progress with my web development journey. I feel that maintaining a blog as increased my productivity and motivation to stay on track and complete necessary projects. I look forward to many more months ahead as I continue to learn more complicated code. 

Also, meeting many people from the development community has helped introduce me to new ideas and ways of doing things that most tutorials fail to teach. I am also inspired to see what other developers have created.
Lyppy - make fast project
Tags: python
Published: 2020-05-26 19:41:10

hello world ! I post my little article to show you my new little cli interface to quickly create project in python

> github : https://github.com/norrova/Lyppy

## Example
### Version 0.1
```bash
# Create project
$ lyppy -m -p
# Create module
$ lyppy -m -mo
```

Project tree example
```
example
│   .gitignore
│   LICENCE
│   README.md
│   requirements.txt
│   setup.py
│
├───beautiful_module
│       beautiful_module.py
│       __init__.py
│
├───bin
├───data
├───docs
└───tests
```

## Commands
* `lyppy`
    * `-h` : help
    * `-v` : lyppy version
    * `-m` : make
        * `-p` : make project
        * `-mo` : make module

## How to install
```bash
$ git clone https://github.com/norrova/Lyppy
$ cd Lyppy
# Windows...
$ install.bat
# Linux | MacOS
$ sh install.sh
```
14: Jordan Scales on Nostalgia and Not Taking Yourself Too Seriously
Published: 2020-05-29 23:59:03

---
title: 14: Jordan Scales on Nostalgia and Not Taking Yourself Too Seriously
published: true
date: 2020-05-26 19:30:00 UTC
tags: 
canonical_url: https://share.transistor.fm/s/e7a1abae
---

{% spotify spotify:episode:1ktZrmLTJcQ7m3g0FtcDUT %}

Why attempt to faithfully recreate the past? Jordan Scales joins Henry to chat about 98.css, design systems, being pixel perfect, accessibility, the Microsoft Windows User Experience reference manual, using VMs, MSPaint and Figma, whimsy and having fun with coding, creating satire at no one's expense, and even how Babel's Guy Fieri meme could of been Jeff Goldblum in another universe.

Transcript at: https://maintainersanonymous.com/nostalgia
Jordan: https://twitter.com/jdan
Henry: https://twitter.com/left\_pad
How to get money as a developer
Tags: webdev, webmonetization, developer
Published: 2020-05-26 19:21:38

Hi again. So you are a developer (of course you are). Most of us learn programming for a career, as a hobby or just to experiment but the greater percentage will do in order make money out of it for a living. Out there, there are alot of methods to get paid as a developer. Many of them don't even require you to write a line of code. In this "silly" post I will say, I've just listed some ways for you to get paid (but my main purpose is for you to experiment) with it. Your feedback is very important. I've tried some but I've not yet gotten anything so do the experiment and let's see 😜. 

## Ways you can use

- The most obvious one is do freelancing : Platforms like Freelancer, UpWork and Fiverr allow you to do so very easily. You can aswell buy products and many other offers there. Again there are many other platform but they are the most popular.

- YouTube : You probably know it too but just read on, we have another feature you can add to increase it. The most know way is using YouTube monetization and ads.

- AdSense and Admob : They are both for ads and are for web and mobile respectively. All you need is a Google account and sign up on their respective websites. You can build a web app and or mobile app for them.

- The last one is web monetization.: It's something somewhat new that allows you to add monetization feature to any website. There are no ads. It uses the interledger protocol for payments. You need a coil account for that. A user adds money to his account (specifically $5) and you the developer or content creator adds the monetization meta tag and key to all pages you want to monetize. As the user spends time, on your site, his account is charged and you get paid. 
As a bonus, you can add the method above on your YouTube channel and it works simarly. You can do so in your coil account settings to connect to YouTube and all your videos will be monetiezed.

We have reached the end of this "silly" post. If you found it helpful, you can share. I just want you to experiment mostly with the last method. Again, I don't use it.


[You got an invite on fiverr where both of us gain](
http://www.fiverr.com/s2/588112940a). It's my first time trying out this <- way 🐥
Thanks 🙌