teleren/devto huggingface dataset:
5 Habits That a Developer Should Give Up
Published: 2021-11-12 10:50:31

A bad habit is a harmful and unproductive habit. A bad habit is basically a non-productive or negligent habit. These habits include over eating, gambling, exercising, socializing with too many people, procrastination, and watching television. Bad habits can prevent you from achieving your goals and at times can even get you fired. Thus if you are a developer what are some bad habits you have and how can you overcome them? In this article we will look at 3 bad habits and how you can overcome them.

The first habit a developer should avoid is having an excessive amount of coffee. You should try to limit your intake or cut back on it every time you go home or leave work. Having an excess of coffee can interrupt you flow and may prevent you form achieving your goals. In addition, developers have an increased risk of being late in their work compared to others, this means you also have a high chance of being late when you have to meet deadlines, so a cut back on coffee will help you in this aspect as well.

Another habit that a developer should stop doing tobacco. This doesn't mean to replace cigarettes with some other forms of tobacco consumption but [quit dipping](https://www.killthecan.org/), using snuffing tobacco, and other stuff as well - even vapes and so on. Tobacco products have huge negative impact on health including increasing chances of getting cancer and reducing your lifespan. Sure thing, being a developer is quite a nervous job but there are a lot of ways you can fight stress without negative (or even with positive) effects on your health.

Another habit that a developer should give up is having a glass of alcoholic beverages. Alcohol is proven to increase your lethargy and attention span and this causes a lot of bad habits to be developed such as smoking and eating junk food.

Developers should remember that there is always a reason behind why a certain thing occurs. Even bad habits can be broken if you persist in changing them and do not let yourself fall into a pattern and into doing the same thing every time you do them. It is important for developers to be consistent and try to develop new things each time. If a certain code structure works well for you, then try to stick to it but do not be afraid to experiment with the other patterns that exist. You should not be afraid of experimenting because you can never know until you try it out.

Cover image by [Andres Ayrton/Pexels](https://www.pexels.com/photo/woman-showing-apple-and-bitten-doughnut-6551415/)
Benefits of Ephemeral Environments in the Dev Cycle
Tags: kubernetes, devops, agile
Published: 2021-11-12 10:45:15

The main reason organizations adopt ephemeral environments is because they accelerate the software development cycle; developers can review changes visually and also share their work with non-technical team members (such as designers, for example) using a link to the proposed revision.

Other benefits of ephemeral environments include:

> removing the staging / QA bottleneck: 
traditionally, organizations use a staging or QA environment to merge and test all code before pushing it into production. The problem is, they only have one or very few of these environments, so, as the organization grows, this becomes a bottleneck that slows down the development cycle. Enter ephemeral environments - now you have a limitless supply of environments you can use for testing. As every code branch is contained in its own isolated environment, it becomes its own integration environment, so you no longer need a single testing and integration environment to merge all code before pushing it into production.

> allowing early and often feedback: 
the earlier in the development cycle you identify quality issues, the more you can reduce rework and improve development velocity. Ephemeral environments help minimize rework by enabling all stakeholders to become part of the development process. For example, QAs, designers, product managers, or even customers no longer have to wait until a developer finishes coding to see changes, they can offer feedback as the feature is being built.

> limiting rework, thus increasing development velocity:
Continuous Integration (CI) focuses on the idea that you should continuously test your code as it’s being pushed. The problem is, most CI systems only perform unit tests (they test small units of code, not the entire system), while Integration and Smoke tests (which test the system as a whole) are left until the code is merged to the main branch in the staging environment. If any issues are found at that stage, it’s already too late; you’ll need rework to get them fixed. Even more, if there’s only one staging environment available, this will create bottlenecks. Ephemeral environments allow Integration and Smoke tests to be run right after the environment is created, thus ensuring they’re performed as frequently as unit tests and allowing you to find issues early in the development process.

> allowing for experimentation with infrastructure:
infrastructure changes are costly both in terms of money and time, and they can slow down your team’s velocity. But with ephemeral environments, testing the new infrastructure can be done in isolation, so it doesn’t affect other developers. 

> they enable Agile / Scrum: today, many organizations follow Agile / Scrum practices, but their infrastructure and technology are not always adapted to iterative software development. These workflows focus on early and frequent feedback, and ephemeral environments are the perfect tool to enable that.
Installing Linux on Windows (WSL) is easier than ever
Tags: linux, windows, tutorial, beginners
Published: 2021-11-12 10:07:40

**TL;DR:** Open a terminal with admin rights and execute the following command: `wsl --install`. If you want to choose a distro, continue reading!

Until very recently, you had to go through multiple steps to enable WSL in your system. The worst part was that some of them were in the control panel, others in a terminal, and you also had to use the Microsoft Store to choose the Linux distribution you wanted.

With the recent changes they've made for the release of both Windows 11 and the latest Windows 10 update, installing WSL has become a straightforward task.

You only need to run one command if you're happy with using Ubuntu as your Linux distribution:

```bash
wsl --install
```

If you prefer another distribution, with this other command, you can list all the available distros:

```bash
wsl --list --online
```

And then, run the installation command:

```bash
wsl --install -d <distro name>
```

That's it! You'll have to restart your computer, and then it will ask you for a username and password. Once you create your user, the process will be completed.
Introducing the new OEE App for Cumulocity IoT
Tags: iot, cumulocity, connectivity
Published: 2021-11-16 09:51:32

---
title: Introducing the new OEE App for Cumulocity IoT
published: true
date: 2021-11-12 10:07:17 UTC
tags: #iot, #cumulocity, #connectivity
canonical_url: https://tech.forums.softwareag.com/t/introducing-the-new-oee-app-for-cumulocity-iot/245748
---

[![image](https://aws1.discourse-cdn.com/techcommunity/optimized/3X/b/9/b9cf66fb152362a6973ef87dbdaf9a7df4479aa6_2_462x375.png)](https://aws1.discourse-cdn.com/techcommunity/original/3X/b/9/b9cf66fb152362a6973ef87dbdaf9a7df4479aa6.png "image")

## Overview

Introduction to the new Overall Equipment Efficiency (OEE) app from Software AG which aims to provide reports as frequently as every minute, helping organizations identify problems or opportunities in time to react effectively to them.

> [Visit the event page](https://groups.softwareag.com/e/mwnzat/)

> Join the [Cumulocity IoT Developers group](https://groups.softwareag.com/cumulocity-iot-developers/) for more IoT events that are coming up

## Video:

YouTube: {% youtube u1n2yY5ZpSk %}

[Read full topic](https://tech.forums.softwareag.com/t/introducing-the-new-oee-app-for-cumulocity-iot/245748)
AI in Instagram Chat
Tags: ai, python, programming, react
Published: 2021-11-12 09:55:29

<a href="https://www.instagram.com/protecgames_help_centre/">

Have you ever talked to a bot? May be your answer will be 
<b>Yes</b> May be mean AI as Google Assistant or Siri. Isn't it but what if you get a chance to chat with a BOT on INSTAGRAM DIRECT MESSAGE? Click 👇🏻https://www.instagram.com/protecgames_help_centre/ on this link and try out our Bot...

Thanks
</A>
Software books!
Tags: books, programming, productivity, codequality
Published: 2021-11-12 09:54:43

There goes a list with every book I've read about coding. I truly recommend all of them!
* Clean Code - Robert C. Martin
* The Pragmatic Programmer - Andy Hunt
* Design Patterns - Erich Gamma
* Inteligencia Artificial: Un enfoque moderno - Stuart Russell
* Designing Software Architectures - Humberto Cervantes
* Clean Architecture - Robert C. Martin
* Pragmatic Thinking and Learning - Andy Hunt

These are mopre like novels, for entertainment 
* Cult of the dead cow - Joseph Menn
* Countdown to Zero Day - Kim Zetter
* The Best of 2600 - Emmanuel Goldstein
* Warcross Saga - Marie Lu (*LOVE THIS*)
remove already attach item on laravel nova
Tags: laravel, nova
Published: 2021-11-12 09:36:38

on nova resource class check the relatableQuery function

add this

```
 /**
     * Build a "relatable" query for the given resource.
     *
     * This query determines which instances of the model may be attached to other resources.
     *
     * @param  \Laravel\Nova\Http\Requests\NovaRequest  $request
     * @param  \Illuminate\Database\Eloquent\Builder  $query
     * @return \Illuminate\Database\Eloquent\Builder
     */
    public static function relatableQuery(NovaRequest $request, $query)
    {
        if ($request->is('nova-api/*/*/attach*/*')) {
            if (! $request->current) {
                $query = self::removeAlreadyAttachItem($query, $request);
            }
            else if ($request->current && ! $request->first) {
                $query = self::removeAlreadyAttachItem($query, $request);
            }
        }

        return parent::relatableQuery($request, $query);
    }
```

remove already attach item function
```
private static function removeAlreadyAttachItem($query, $request)
    {
        $relationName = Str::plural(Str::snake(class_basename($query->getModel())));

        $model = $request->findResourceOrFail()->model();

        $model->load($relationName);

        $items = $model->getRelation($relationName)->map(function ($model) {
            return collect($model->toArray())->only('id')->all();
        });

        return $query->whereNotIn('id', $items);
    }
```
OSD600 - Lab 8
Tags: opensource, beginners, javascript, programming
Published: 2021-11-12 05:44:14

##Introduction
Hello all, this week I have to add a **Testing Framework** to my [program-SSG](https://github.com/tcvan0707/txt2html). By doing this, I will be able to test different pieces of my code. Moreover, I also have a basic concept about how to test a program. My program is still small compare to others project, which is super convenient when we know how to test it, and what to test. Let's get started!

##How to Begin with Testing
Firstly, I do a research of some testing frameworks, and I come up with [Jest](https://jestjs.io/) because I found that Jest is able to speed up the overall testing process, plus it is developed by Facebook. In order to install it for my program, I run:
```
npm install --save-dev jest
```
After installing, I have created my first test file named `generator.test.js`, and I gradually add my test in there. The reason why I am doing it because I know my mind is going to blow up if I add everything in a single time, and I will definitely have a bunch of errors by doing that. So, I decide to add one function to test at a time. My program is only contains two files, so that it is pretty straightforward to test it, I also create `txt2html.test.js` to do some tests. During testing process, I have to change some of my code to make the test pass. And I finally come up with my [commit](https://github.com/tcvan0707/txt2html/commit/66c2731facebb34d176acd672ca7b0cdbe9721ce).

##Additional Configuration
I have modify my `package.json` file to include the script running **Jest** automatically. I do the following:
```
"scripts: {
   "test": "jest",
    ....
}
```
I run `npm run test`, Jest will be run automatically and I receive this for my test process: ![test pass](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ti1eeq5hm8u3pc179m05.JPG) The further I go with OSD600 course, the more knowledge I can learn. More specifically, this is the first time I have worked with testing framework, which I do not normally do. However, I will definitely use **Jest** again for my future work since it is so powerful.
Eco Xuân - LandUp
Tags: javascript
Published: 2021-11-12 09:25:31

Chào mừng đến với https://landup.net/du-an/eco-xuan/ Cung cấp mọi thông tin mới nhất về ✅ Giá Bán ✅ Pháp Lý ✅ Chiết khấu ✅ Thanh toán... dự án Eco Xuân. Eco Xuân gồm các căn hộ chung cư từ 1-3 phòng ngủ được xây dựng bởi Tập Đoàn S P Setia Berhad Malaysia tại vị trí đắc địa ở Thuận An, Bình Dương.
Thông tin liên hệ:
Địa chỉ: Số 3 Nguyễn Văn Đậu, Phường 5, Phú Nhuận, Thành phố Hồ Chí Minh
Hotline: 0928.0168.69
Email: hotro@landup.net
Website: https://landup.net/du-an/eco-xuan/ 
Youtube: https://www.youtube.com/channel/UCJrJ5VkQReOAHMrwcznO3lQ/about
Google Sites: https://sites.google.com/view/ecoxuan-landup/ 
Tags: Eco Xuân, Eco Xuân Thuận An, Eco Xuân Bình Dương, Eco Xuân Thuận An Bình Dương, Dự án Eco Xuân Thuận An Bình Dương, Dự án Eco Xuân Bình Dương, Dự án Eco Xuân, Dự án Eco Xuân Thuận An, LandUp, Tập Đoàn S P Setia Berhad Malaysia
Hashtag: #ecoxuan #ecoxuanthuanan #ecoxuanbinhduong #ecoxuanthuananbinhduong #duanecoxuanthuananbinhduong #duanecoxuanbinhduong #duanecoxuan #duanecoxuanthuanan #landup #tapdoanspsetiaberhadmalaysia
Biệt thự: https://landup.net/biet-thu/
Nhà phố: https://landup.net/nha-pho/
Chung cư: https://landup.net/chung-cu/
Đất nền: https://landup.net/dat-nen/
Ejecución de promesas
Published: 2021-11-12 09:24:25

¿Cuánto tiempo tarda en ejecutarse una secuencia de promesas?

    const promesa1 = new Promise(function(resolve) {
      setTimeout(function() {
        resolve(1)
      }, 1000)
    });

    const promesa2 = new Promise(function(resolve) {
      setTimeout(function() {
        resolve(2)
      }, 2000)
    });

    const promesa3 = new Promise(function(resolve) {
      setTimeout(function() {
        resolve(3)
      }, 3000)
    });
    

    console.time('promesas')
    Promise.all([promesa1, promesa2, promesa3]).then(function(result) {
      console.log(result);
      console.timeEnd('promesas')
    })

Exactamente 3 segundos (aproximadamente) ¿Sabes por qué?

Cuando empiezan a ejecutarse todas entran en la web API y el temporizador se ejecutará durante tanto tiempo como el segundo parámetro MÁXIMO que le hemos pasado a una de las promesas, es decir, 3000 en este caso.
>  Te recomiendo el siguiente enlace para hacer tus pruebas:
[LatenFlip.com](http://latentflip.com/loupe/?code=JC5vbignYnV0dG9uJywgJ2NsaWNrJywgZnVuY3Rpb24gb25DbGljaygpIHsKICAgIHNldFRpbWVvdXQoZnVuY3Rpb24gdGltZXIoKSB7CiAgICAgICAgY29uc29sZS5sb2coJ1lvdSBjbGlja2VkIHRoZSBidXR0b24hJyk7ICAgIAogICAgfSwgMjAwMCk7Cn0pOwoKY29uc29sZS5sb2coIkhpISIpOwoKc2V0VGltZW91dChmdW5jdGlvbiB0aW1lb3V0KCkgewogICAgY29uc29sZS5sb2coIkNsaWNrIHRoZSBidXR0b24hIik7Cn0sIDUwMDApOwoKY29uc29sZS5sb2coIldlbGNvbWUgdG8gbG91cGUuIik7!!!PGJ1dHRvbj5DbGljayBtZSE8L2J1dHRvbj4%3D)
Meet Hasura at AWS re:Invent
Tags: conference, community
Published: 2021-11-29 13:53:28

---
title: Meet Hasura at AWS re:Invent
published: true
date: 2021-11-12 09:21:12 UTC
tags: Conference,Community
canonical_url: https://hasura.io/blog/meet-hasura-at-aws-re-invent/
---

*This article was originally published on the Hasura blog. If there are formatting errors in the article below, we urge you to please go to [our blog and read it there](https://hasura.io/blog/meet-hasura-at-aws-re-invent/). Thanks!* :)

![Meet Hasura at AWS re:Invent](https://hasura.io/blog/content/images/2021/11/axios-2.png)

It’s Hasura’s first year at re:Invent and we’re excited to meet everyone from the Hasura Community who’s going to be there!

Here are all the ways you can find us during the conference:

**Stop by our booth for demos, expert consultations and to meet the team that’s building Hasura!**

We'll be at booth #402. Stop by for some fun Hasura demos, pick up some of our special re:Invent stickers and meet our team including our co-founders. We’re right by the entrance, but here’s a little map of where to find us:

![Meet Hasura at AWS re:Invent](https://hasura.io/blog/content/images/2021/11/Screenshot-2021-11-12-at-2.44.57-PM.png)
_Hasura will be at Booth 402_

**We’ll also host 1:1 consultations with our technical team at the booth, including our CEO Tanmai**. Just to make sure we don’t miss anyone, do [sign up in advance here](https://calendly.com/d/cfc-xd8-2zw/hasura-at-reinvent-2021) for a personalized 15-minute session to discuss topics like:

- Your GraphQL API performance
- Data Federation & creating a unified data layer with Hasura
- Authorization, Caching and advanced GraphQL
- 3 factor app architecture
- GraphQL Strategy for your organization with incremental adoption  

**Happy Hour with Hasura at re:Invent 2021**

Since it’s our first year at re:Invent, we’re celebrating it with a Happy Hour at The Wynn. We’d love to have you there!

Sip on a drink and chat with the Hasura team about the Hasura roadmap, all things Hasura and your GraphQL & data strategy. It’s also a chance to meet other Hasura users and learn about how they’re using Hasura.

Seating is limited so [reserve your spot soon](https://konghq.com/events/aws-reinvent/mixer), and we’ll be in touch to confirm!

_Tuesday, November 30, 6:00 pm - 8:00 pm, East Side Lounge at The Wynn_

**Reserve your t-shirt**

Finally, what’s a conference without exciting swag? We’ve got limited numbers of some special Hasura t-shirts! Just [reserve your t-shirt here](https://hasura.io/events/aws-reinvent/t-shirt) and drop by our booth during the conference to pick it up.

Hope to see you at re:Invent soon!
Increase php upload_max_filesize with htaccess
Tags: php, htaccess
Published: 2021-11-12 09:07:21

In PHP the default upload_max_filesize is 2 MB but you can increase this filesize limit using your htaccess file. To increase the limit via htaccess , add the following line to your htaccess
<code>
php_value upload_max_filesize 100MB
</code>
This will increase the default limit to 100MB.
Read more on this article here https://helponnet.com/2021/11/09/php-post-max-filezize-htaccess/
Add YouTube Video Player in React-App
Tags: webdev, react, tutorial, javascript
Published: 2021-11-12 08:58:06

Hi folks, hope you are doing well. In this post we are going to learn how to add a video link to your React app and play in your React app.

###How to Install
This player component can be used by installing react-player
NPM package.

Enter your directory, open your terminal (Ctrl+ J).
Type `npm i react-player` in your app directory and press enter.
![install react-player](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q3l0ci3vpulokzurev1j.png)


###How To Use

**1. Import** -
Now, import the package in the React component file where you want to add the video player.
`import ReactPlayer from "react-player";`
![Import](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/so07xjh4kxq6t6b56957.png)
**2. Add the component** - 
`<ReactPlayer url="url-link"  controls={true} />`
![Add the component](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7q2fx93e2ugj0bufjyh9.png)

Hurray, you added a video-player to your React app!! 
At this point, you can stop and enjoy :)  

**Additional Settings-**
If you want to add some extra settings, here are a few-

1. `controls = {true/false}` - provides video controls to user
2. `loop = {true/false}`     - repeat the video if it ends
3. `volume = {0 to 1}`       - set volume 

To check out more, click [here](https://www.npmjs.com/package/react-player)

Check out the my Netflix clone, click on any movie to view it's trailer - [here](https://netflix-clone-fce11.web.app/)
![Netflix Clone](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/epf9asbphydev64lzno1.png)

If you know of other methods to implement, let me know in the comments. Thanks for reading :)
Color property global value "inherit" 🎨
Tags: css, beginners, codesandbox
Published: 2021-11-12 08:45:26

## When to use

When you want to inherit color of its parent element, instead of giving the same color.

```css
.parent {
  color: red;
}
.child {
  color: inherit;
  /* color: red; */
}
```

## Demo
`.inner` cicle having `boarder-color: inherit`, changing color as its outer circle color changes

![inherit-demo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kk0lyf21jtvuo8wp0jzh.gif)
 

codesandbox 👇
{% codesandbox nzwlg %}
Laravel Eager Loading with method example
Tags: php, laravel, programming, beginners
Published: 2021-11-12 08:33:30

When you make relationship in Laravel eloquent relationship, there are two ways you can access eloquent relationships data. In a lazy loading, when you access the property, then relationships data loaded.

For example, Post model is belongs to User model. So when you want to get all users data with posts records. Here is Post model.
```php
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Post extends Model
{
    /**
     * Get the users that write article
     */
    public function user()
    {
        return $this->belongsTo(User::class);
    }
}
```
Now we get data in controller.
```php
$posts = Post::all();

foreach ($posts as $post) {
    echo $post->user->name;
}
```

In eager loading, all the users are also retrived with post records - with()
```php
$posts = Post::with('user')->get();

foreach ($posts as $post) {
    echo $post->user->name;
}
```
multiple relationships
```php
$posts = Post::with(['user', 'category'])->get();
```
Nested Eager Loading
```php
$posts = Post::with('user.address')->get();
```
specific columns 
```php
$posts = Post::with('user:id,email,phone,post_id')->get();
```
I hope everyone enjoys the code.
Working on my Next.js Crash Course 📚
Tags: nextjs, javascript, webdev, jamstack
Published: 2021-11-12 08:01:13

_This article was originally published on [my newsletter](https://www.tuomokankaanpaa.com/newsletter) last week. I publish previous week's newsletter here on the blog. If you want to read these as soon as they are published, [sign up](https://www.tuomokankaanpaa.com/newsletter) for the newsletter!_

Ahoy,

If last email was a bit long, this one will be a shorter one.

I didn't upload any videos last week because since the week before was so hectic with Next.js conf and uploading three different videos on [the channel](https://www.youtube.com/tuomokankaanpaa), I felt like taking a bit time off from making videos was sufficient.

I wasn't sitting on my hands though! I was working on planning my next couple of videos. One of which will be the next part of my Next.js Crash Course.

## Next.js Crash Course

If you didn't know, I have a Next.js Crash Course on my [Youtube channel](https://www.youtube.com/tuomokankaanpaa). I was contemplating on making the course a [Skillshare](https://www.skillshare.com/r/user/tume) course, but decided to make it free and available on Youtube. You can find the course from [here](https://www.youtube.com/playlist?list=PLxCkFZQohykkReLJlYsrAoMFjB1b2w7CT).

The course is "work in progress" because instead of making the full course and then publishing it, I decided to publish the videos one by one. That said, I don't have all the videos made yet, so if there is something you would like me to cover, let me know by replying to this email!

## Wrapping up

As I said, this week's email was a shorter one. I want to respect your time and I don't want to make the email a longer one just for the sake of it. Hope you have a great rest of the week!

That's all for this week!

Cheers,
Tuomo