teleren/devto huggingface dataset:
Daily Developer Jokes - Sunday, Oct 18, 2020
Tags: jokes, dailydeveloperjokes
Published: 2020-10-18 12:00:08

---
title: "Daily Developer Jokes - Sunday, Oct 18, 2020"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
cover_image: "https://private.xtrp.io/projects/DailyDeveloperJokes/thumbnail_generator/?date=Sunday%2C%20Oct%2018%2C%202020"
published: true
tags: #jokes, #dailydeveloperjokes
---

Generated by Daily Developer Jokes, a project by [Fred Adams](https://xtrp.io/) ([@xtrp](https://dev.to/xtrp) on DEV)

___Read about Daily Developer Jokes on [this blog post](https://xtrp.io/blog/2020/01/12/daily-jokes-bot-release/), and check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/).___
### Today's Joke is...
![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e1258b4d7b44.png)

---
*Have a joke idea for a future post? Email ___[xtrp@xtrp.io](mailto:xtrp@xtrp.io)___ with your suggestions!*

*This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit.*

<!-- 
Joke text:
___Q:___ Why doesn't Hollywood make more Big Data movies?

___A:___ NoSQL.
 -->
Quick Peek: React App Mounted on a Shadow DOM Root
Tags: javascript, webdev, react, html
Published: 2020-10-18 11:56:37

## Code first

```jsx
import React, { FC } from "react";
import { render } from "react-dom";

const App = () => <div>React + Shadow DOM</div>;

const root = document.querySelector("#react-root");
root.attachShadow({ mode: "open" });

render(<App />, root.shadowRoot);
```
[Play around in playground](https://stackblitz.com/edit/react-shadow-dom)

## What's this all about?
The code above is very similar to the way we usually mount React apps to the DOM. But there's one significant difference: we're creating a shadow DOM and mounting to its root a React app. [Learn more about shadow DOM.](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_shadow_DOM)

## Use-cases
- Isolate styles: an app will not be affected by any outer CSS that brings a good solution when you need styles isolation
- WEB components: React apps can be mounted inside WEB components

## Cons
- Styles need to be stored in the shadow root
- You might have issues with external libraries that access DOM elements inside an app through JS
- Some payment processors don't support shadow DOM in the official clients

## In the end
This definitely is not something that should be used on a daily basis but it's a good option when you need to implement behavior mentioned in use-cases.

I tried to make this post really short so feel free to ask any questions in the comments.

Thanks for reading!

### P.S.
I started doing Twitter recently so I would be glad if you check the things I post there! Also, advise who in your opinion I need to follow from the tech!
[Twitter](https://twitter.com/alexkhismatulin)
Install nginx on Centos
Tags: devops, aws, architecture, linux
Published: 2020-10-18 11:11:30

Post #12


Nginx is a high performing web server which can also be used as a reverse proxy, load balancer, mail proxy and HTTP cache. Nginx Original author is Igor Sysoev Developer initially released on 4 October 2004 around 13 years ago


well you must be wondering why Nginx if i am already happy with Apache or other web servers. fantastic! let me introduce you with some greatest feature of Nginx.

1.) Designed for High Concurrency

2.) Lightweight

3.) Nginx is Remarkable for Serving Static Content

4.) Nginx is an Efficient Load Balancer

5.) Highly scalable. if you have ever heard about AWS then you you must be familiar with scaling. no need to worry i'll explain right here.Scaling is a perfect terminology that we use in Dev-Ops means monitoring applications and automatically adjusts capacity to maintain steady, predictable performance at the lowest possible cost.


6.) Nginx is Easy to Configure. exactly trust me its really easier than apache. Still asking why should i go with Nginx ?

well i hope you are totally understood now. lets dive into the Linux world

let's Install nginx on centos now

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


First, login as root credential via any ssh tools eg. putty(windows) or shell(linux).

Next, just put IP address of your server and click open. you will be asked to provide root username and step forward with password. now you are up. always create a privileged user for safety(Sudo user).

Now lets create a sudo user first and attach with sudo group.

/> adduser prx_ubuntu (your choice)

/> usermod -aG sudo prx_ubuntu 
(fill info to add user to sudo group)

Now Nginx installation please….

/> apt-get update (update repo)
/> apt-get install nginx (install nginx)

Well, nginx is successfully installed now. whats next ?
alright let's Install your files from github

/> git clone https://github.com/your_repo.git
/> sudo bash install.sh

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


Bingo! you have now a nginx installed on your centos server with a sudo user and a program installed from github. 
next you can configure webserver for http request<=>response

Note: i wrote this article 2 years ago on [Medium](https://medium.com/simplest-nginx-setup-on-centos/install-nginx-on-centos-c73d3cb6d8db). i thought it would help newbies on this platform. 



Thanks for Reading!
The double-edged sword of thanks
Tags: 100daystooffload
Published: 2020-10-18 11:06:46

Saying "thank you" is an incredibly powerful act if done correctly. If you've ever been on the receiving end of some truly sincere gratitude, the emotions that it can trigger are powerful. If it happens to me, I often don't know what to say, or try to laugh it off. But knowing my effort has been acknowledged still fills me with pride.

Saying "thank you" is very easy to do. Saying it in the right way and at the right time can be difficult. It might come across as shallow or insincere, or as belated afterthought. It might be seen by both sides as a substitute for the true good that should have been done.

Looking around my local area, I still see signs that say "thank you NHS" (the UK's National Health Service). During the long days of April and May, pavements would be decorated in chalk proclaiming the same, and people would stand outside to applaud week after week. This all seems like a _good_ type of thanks and I'm sure that many people were sincere. But not everyone.

How many of those applauding people, I wondered at the time, were the same people who would dispense casual racism when discussing immigration of those same key workers that they were supposedly thanking? Or who would choose to vote to sever ties with their continental neighbours and retreat from the international stage? Or who would vote for a party led by a liar who also stood outside applauding the very people he was putting in harm's way, and whose government had spent the past ten years eroding their preparedness?

Sometimes saying "thank you" is all that is needed to make someone feel valued, and that's all they need. Sometimes saying "thank you" is empty, opportunistic and selfish.

We should all show our gratitude when it is deserved. Sometimes thanks is all that is needed, but not always. Sometimes actions are required and it's not always easy. That shouldn't stop us from doing the right thing.

_I'm publishing this as part of 100 Days To Offload. You can join in yourself by visiting [https://100daystooffload.com.](https://100daystooffload.com)_

Photo by <a href="https://unsplash.com/@wstn?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Ben Garratt</a> on <a href="https://unsplash.com/s/photos/thanks?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a>
Swag by HactoberFest
Tags: hacktoberfest
Published: 2020-10-18 10:38:15

To support open-source contribution a program "HactoberFest" is held by DEV and Digital Ocean in collaboration with Github every year.
GitHub is a version control platform where you can share your projects and can also contribute to other projects, for that you have to open a pull request.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/e2ovdk0zende8jx4tqyk.png)
HactoberFest is an event based on opening 4 pull request to encourage open source contribution. And as an award by DEV and Digital Ocean swags are given to them. These swags includes tree/t-shirt, stickers and badges.

# **How to Join this Event?**
To participate, register at the official site: [hacktoberfest.digitalocean.com](hacktoberfest.digitalocean.com) Make sure you are connected with your GitHub account. Then, submit at least four pull-request (PRs) to any public GitHub repository.
My First Contribution to Open Source
Tags: hacktoberfest
Published: 2020-10-18 10:09:03

## What I Learned From Hacktoberfest

I learned how to make open-source contributions and how to make fork other's Repo and make pull requests for merging my contribution to the original repo.

## Experience
It was a great experience showing off skills and helping out the developer community across the world.

Here are my contributions towards the  Open Source Community :
1.
https://github.com/FlutterTutorial/FlutterResources/pull/27

2.
https://github.com/Sujal-vajire/DataStructuresAndAlgorithms/pull/21

3.
https://github.com/Aman1440/Practice-code-repo/pull/25

4.
https://github.com/dannythompson901/Hacktoberfest-FirstPR/pull/22

I am very glad that I took part in Hacktoberfest because it helped me kickstart my journey of Open Source Development and also helped me grasp all the basics of GitHub that are a crucial part of being a complete Developer.
What I Learned From Hacktoberfest 2020
Tags: hacktoberfest
Published: 2020-10-18 11:54:43

---
title: What I Learned From Hacktoberfest 2020
published: true
date: 2020-10-18 10:00:00 UTC
tags: hacktoberfest
canonical_url: https://carlos.mendible.com/2020/10/18/what-i-learned-from-hacktoberfest-2020/
---

![hacktoberfest](https://dev-to-uploads.s3.amazonaws.com/i/5haps693rfgaa1t0eg08.png)

[Hacktoberfest®](https://hacktoberfest.digitalocean.com/) is an open global event where people all around de globe contribute to open source projects.

The idea behind [Hacktoberfest®](https://hacktoberfest.digitalocean.com/) is great, in my opinion it encourages and motivates contributions specially from those who don’t know where to start with OSS, but saddly what we saw this year was many people, let’s call them trolls, spamming repos with useless pull requests in order to claim the nice tee. The [Hacktoberfest®](https://hacktoberfest.digitalocean.com/) organization reacted quickly to fix the situation and the rules of the game have been changed: [the event is now offically opt-in only for projects and mantainers](https://hacktoberfest.digitalocean.com/hacktoberfest-update).

Now let me tell you a bit of what I did:

## What I Learned From Hacktoberfest

### Azure Arc enabled Kubernetes:

I learned how to enable container monitoring on [Azure Arc enabled Kubernetes](https://docs.microsoft.com/en-us/azure/azure-arc/kubernetes/overview?WT.mc_id=AZ-MVP-5002618) and in the process I noticed that in the documentation a powershell command was using `curl` instead of `Invoke-WebRequest` so I sumbited the following PR: [Replacing wget with iwr in the powershell sample](https://github.com/MicrosoftDocs/azure-docs/pull/63625)

### K8Spin

I continued learning about [K8Spin](https://github.com/k8spin/k8spin-operator): a nice OOS project which adds three new hierarchy concepts (Organizations, Tenants, and Spaces) to your kuberneets clusters in order to enable multi-tenancy.

Collaborating with the [K8Spin](https://github.com/k8spin/k8spin-operator) team was great and I fixed two issues:

- A broken link in one of their repos: [Fixing Issue#1: oneinfra link](https://github.com/k8spin/oneinfra-worker-modules/pull/3)
- Added a Helm chart to install the [K8Spin](https://github.com/k8spin/k8spin-operator). I had created some charts in the past but for this one I had to learn about [chart best practices](https://helm.sh/docs/chart_best_practices/) and apply them.

As a bonus also added a PR to add a developer container to their repo in other to enable [Codespaces](https://github.com/features/codespaces) and help any newcomer to start contributing avoiding python and other dependencies setup: [Adding dev container definition](https://github.com/k8spin/k8spin-operator/pull/21)

### Bonus

- I continued my journey learning and collaborating with Dapr and this time I submited a PR to remove [a component from Dapr](https://github.com/dapr/components-contrib/pull/496)
- I hade some SEO issues with my blog and it turns out the the theme I use was not adding [the post title as part of the correspoing tag(https://github.com/avianto/hugo-kiera/pull/41).

Glad to Help!
Collaborative Programming as a form of Expression for Extroverts
Tags: programmingpsychology, extroverts, inclusion, diversity
Published: 2020-10-18 09:34:22

---
title: Collaborative Programming as a form of Expression for Extroverts
published: true
description: programming as an expression of creativity and communication at the same time
tags: #programmingpsychology,#extroverts, #inclusivity, #diversity
//cover_image: https://direct_url_to_image.jpg
---

Programming usually happens in short bouts for me
usually alone, yet i am in a dire need to pair up and see how others work on the same goal i have on a given project

in thinking about the minion friend i have - easier to talk to than the rubberduck i came upwith the idea of a confluence between the growing number of extroverts in our field and their way of programming 

programming is a collaborative effort if any reasonably large scale is desired for the project.

and hence our present tech of multiscreens, zooms and git other various tools for remote pairing should allow for a way for them, our valuable extroverts, to apply their people skills by expressing it through coding
Heart with HTML and CSS
Tags: codepen, 100daysofcode, html, css
Published: 2020-10-18 09:26:15

Today is 2nd Day of my 100 days coding challenge. Today I am learning about Applied Visual Design in CSS and I created my first ever design of Heart with Arrow. Please check out my work!

{% codepen https://codepen.io/umi93/pen/BazzBxe %}
Hacktoberfest 2020 Challenge!
Tags: hacktoberfest
Published: 2020-10-18 09:25:04

This year was a very productive month for me especially when it comes to contributing to open source projects. The best thing about Open Source is actually being a part of an amazing like minded community. Thanks to Hacktoberfest, I was able to be a part of multiple such communities. My Accepted Contributions for this year's hacktoberfest are as follows:

* [Synchronous Python Playground @Appwrite](https://github.com/appwrite/playground-for-python/pull/2)

* [Adding package headers and snippets @Jet.jl](https://github.com/abelsiqueira/Jet.jl/pull/9)

* [Removing Python Dependency @Fake-Stream](https://github.com/Nibba2018/Fake-Stream/pull/1)

* [Logging registered key strokes](https://github.com/dsc-iem/Cysec-Hacktoberfest/pull/5)

I also contributed as a reviewer to various projects.
We did face some inconveniences due to the spammy Pull Requests but the `hacktoberfest` team were quick enough to implement better and more robust rules to counter the same,  which was very impressive. In my opinion these rules were very smart. The team also did a great job hunting repositories that did not satisfy hacktoberfest's code of conduct.

For beginners who want to start contributing to open source projects should consider Hacktoberfest as their starting point and should'nt hesitate to participate in it. If you are looking for a mode detailed guide, do check out my other blog about Open Source [here](https://dev.to/nibba2018/my-journey-guide-for-google-summer-of-code-2ei8)

Thank you for reading, see you next time! :)
Build a Me-experience in Microsoft Teams
Tags: microsoftteams, microsoft365, productivity, spfx
Published: 2020-10-19 07:35:44

---
title: Build a Me-experience in Microsoft Teams
published: true
date: 2020-10-18 08:19:31 UTC
tags: microsoftteams,sharepointframework,microsoft365,productivity
canonical_url: https://blog.mastykarz.nl/build-me-experience-microsoft-teams/
---

![Build a Me-experience in Microsoft Teams](https://blog.mastykarz.nl/assets/images/2020/10/banner.png)

There is no _i_ in Teams, but there is _me_. Here is how you could build a Me-experience in Microsoft Teams to stay informed and easily track your work.

## Microsoft Teams - the hub for collaboration

Microsoft Teams is the hub for collaboration. It's where you meet your colleagues, where you exchange ideas and where you work together on files. It's where you can open your organization's applications without leaving the context of your work. It's also where you meet your business partners.

Microsoft Teams focuses on teamwork. And using its extensibility capabilities, you can extend it to put your colleagues in the center and offer them a central place to start their workday and prepare for the day.

 ![Me-experience in Microsoft Teams](https://blog.mastykarz.nl/assets/images/2020/10/me-experience-preview.png)
## Build a Me-experience in Microsoft Teams

We've just published an [article explaining how you can use SharePoint Framework to build a Me-experience](https://docs.microsoft.com/sharepoint/dev/spfx/build-for-teams-me-experience?WT.mc_id=m365-9762-wmastyka): a personal dashboard that helps users stay informed and track their work. Since there are multiple ways of how you could do it, we've presented each of them with their pros and considerations.

What do you think of it? Would it help you? Is this something that you'd provide to users in your organization or build for your customers?
How-to Avoid Rounding "Errors" in Excel
Tags: excel, finance, javascript
Published: 2020-10-18 06:34:10

While working on a financial calculator using Excel as the "reference of truth", I've run into this rounding error -- payments are off by pennies and it ends up off by dollars over time. Instinctively, I tend to believe Excel must be correct. But after digging into the details, I noticed that there is a round off error with Excel:

>While Excel displays only 2-decimals, internally, it has a higher precision. And calculations use the highest internal precisions before rounding off.

And this causes problems for financial calculators, where we assume the precision is always set to 2 decimals.

See the following calculation:

`P = T - I (Principal = Total Payment - Interest Payment)`

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

The principle (P) is off by 1-penny when using Excel, and here is why:

>I = 32.93698323
>T= 145.20 (fixed amount the user pays monthly)
>P = 112.26535914 (calculated with Excel formula with previous round off error)

When displaying only 2 decimals, the numbers become:
>I = 32.94
>T = 145.20
>P = 112.27
Plugging in the formula:
>`P = T - I` and you get `112.27 = 112.26`

This does not sound right, does it? Since we are dealing with money--which only has two decimals precisions--to get the correct numbers in Excel, we need to round up both `T` and `I` by using the formula `=ROUND(..., 2)` in Excel.

>Use `=ROUND(......, 2)` in your formula to force a 2 decimal precision in **Excel**

Similarly, while programming the calculator, we have to be mindful that we always round up the result to `.toFixed(2)` before subjecting it to additional calculations.

This maybe something accountants learned in their `Using Excel for Accounting 101` course, but it is something easily missed for non-accountants and would cause a lot of confusion when not done right.
Understand CSS Specificity
Tags: css, html, design, javascript
Published: 2020-10-18 08:03:04

CSS Specificity is the set of rules that decide what styles are applied to elements, the more specific it is, the more weight it has in determining the style of an element.

## Why do I need to know that?

You may ask yourself why do I need to understand CSS Specificity, may I just write !important when some styles are not applied.
The answer is **NO!** By understanding how styles are applied, your code become more clean and easy to read. It is easier to change a particular style if you know exactly which selector to modify and you will no dig into naming architecture and ensuring that selectors won't conflict to each other. 

## Which selector has bigger weight?

There is a system with four categories which give to each selector weight, the most specific selector that bigger weight it has.
<img class="my-2" src="https://i.imgur.com/RyV3FSI.png" alt="Four Category System CSS Specificity"/>
<h3 class="text-pink my-2">Style Attribute</h3>
<p>Inline Style overrides all other styles and has weight <span class="font-weight-bold">1000</span></p>
### ID Selectors
<p>IDs has weight <span class="font-weight-bold">100</span></p>
```css
#headline {
    color: #f1f1f1; 
}
```
### Classes, attributes and pseudo selectors
<p>They all have weight of  <span class="font-weight-bold">10</span> for each donated element.</p>
```css
.headline {
    color: #f1f1f1; 
}
```
### Elements
Elements have weight of **1**.
```css
h1 {
    color: #f1f1f1; 
}
```

### Exceptions
1. There are also some exceptions to these rules and we will analyze them in this section.
2. The universal selectors (*, +,  -, >, ~) have value of 0.
3. The **!important** value overrides absolutely everything and has value of 10000, but we should avoid using it , just in case.
4. The pseudo-class :not() has no specificity either.
## Example
Let's get these two selectors and see which one will be applied.
```css
ul.ul > li:nth-child(2):hover {
    color: blue;
}
```
```css
ul#ul > li:hover {
   color: green;
}
```
The second selector is more specific and has bigger weight, so it's style will be applied.
The weight of the first one is 32 and the second is 112.
## What we have learned?

All css selectors have weight, the more specific it is, the more weight it has. Avoid using !important. Always look a way to use specificity before considering **!important**.


**📩 If you like this post, subscribe and comment what other topics should I write about!**
Most used ZSH shortcuts for moving cursor
Tags: zsh, shortcut
Published: 2020-10-18 07:45:53

I use iterm2 + zsh to deal with all the command lines. Here I want to share my most used shortcuts for moving cursor.

```
ctrl + a  move to the beginning of the line
ctrl + e  move to the end of the line

alt + f   move to the next word
alt + b   move to the previous word

ctrl + k  cut till the end of the line
alt + w   cut till the beginning of the line

ctrl + w  cut the previous word
alt + d   cut the next word 
```


Bonus

```
ctrl + -  undo previous change
```

This is it. Hope you enjoy it!