teleren/devto huggingface dataset:
Today's Daily Dose of Programming Humor
Tags: jokes, dailydeveloperjokes, watercooler
Published: 2021-08-13 12:00:18

---
title: "Today's Daily Dose of Programming Humor"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
published: true
tags: #jokes, #dailydeveloperjokes, #watercooler
---

Hi there! Here's today's Daily Developer Joke. We hope you enjoy it; it's a good one.

![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e12593b1b51e.png)

---

For more jokes, and to submit your own joke to get featured, check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/). We're also open sourced, so feel free to view [our GitHub Profile](https://github.com/dailydeveloperjokes).

### Leave this post a ❤️ if you liked today's joke, and stay tuned for tomorrow's joke too!

_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:
A programmer was arrested for writing unreadable code. They refused to comment.
 -->
Create Virtual Tours with Marzipano
Tags: tooling, design, webdev, beginners
Published: 2021-08-13 11:58:45

A virtual tour is a combo of 360° images displaying anything. You can use these tours to display several activities ranging from your journeys, tools, business projects, and pictures.


You can now create such tours with Marzipano. It was introduced in 2011 by Antonio Cabral. And now, it is by far the simplest tool that lets you create a virtual tour within a few minutes. 


If you want to create beautiful virtual tours with Marzipano, you can learn more at: https://tiiny.host/blog/what-is-marzipano-tool-here-is-a-complete-astonishing-guide/
Announcing a new Summon The JSON deck
Tags: programming
Published: 2021-08-13 11:50:50

It's time to announce that we're working on the next Summon The JSON decks.  What do you think it will be about?  Write in the comment!

![New design of Summon The JSON deck](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i1vud3tq0b9ztsvdegrm.gif)
Did you know: local-first-cooperation?
Tags: localfirst, eventsourcing, architecture, distributedsystems
Published: 2021-08-13 11:44:32

This is definitely something I like to share with you:

Some pretty smart people try to evolve software to the next level. I am currently working on a project using this pattern technic and will publish DevLog videos as soon I get them post processed.
 
https://www.local-first-cooperation.org/:

## Discover real-world use-cases
See how Local-First Cooperation applies to a wide range of use-cases.

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a5k8q3j0w40o83o1jlqm.png)
Using hook scripts with Certbot
Tags: linux, systems
Published: 2021-08-13 11:28:00

Today there are a number of ways to setup your email server. Regardless of how, you will have to create an SSL certificate for the domain you plan to host your email on. And a common and convenient way of doing this, is through the instruction generator [_Certbot_](https://certbot.eff.org/). A free and open-source (FOSS) tool created by the Electronic Frontier Foundation (EFF).

> "Certbot is a free, open source software tool for automatically using Let’s Encrypt certificates on manually-administered websites to enable HTTPS. Certbot offers domain owners and website administrators a convenient way to move to HTTPS with easy-to-follow, interactive instructions based on your webserver and operating system." - EFF

One of my favourite features of Certbot has come from the convenience of automatically checking and renewing my certificates for all the websites I host. Without having to worry whether or not I should log on to my server and manually renew them. Allowing the ability to fetch my email's to read and reply with, from desktop or mobile. And not be told that my email server isn't trusted without an SSL certificate.

A problem I have found regarding the certificate renewals, however, comes from the way the IMAP server (Dovecot in my case) doesn't reload in order to use the updated certificate. Leaving me email-less until I reload the service.

Online you might find the solution to be as simple as issuing `$sudo systemctl reload dovecot`, after Certbot has finished doing it's business. But, when I'm trying to check email on my phone, away from a command-line to `ssh` into. This isn't exactly practical. And I don't want to set a 60 day reminder to just run this command.

Luckily, Certbot comes with the ability to run pre-, post- and deploy-hooks. Simply by adding a shell script to the appropriate folder, found under the `/etc/letsencrypt/renewal-hooks/` directory.

> Don't forget to make the file executable with the `sudo chmod +x /path/to/file` command.

Just add the following script to a file - named whatever you want - and put it in `/etc/letsencrypt/renewal-hooks/deploy/`.

```sh
#!/bin/sh
do
        if [ "$domain" = mail.example.com ]
        then
                systemctl reload dovecot
        fi
done
```

---

Now every time Certbot runs and successfully issues a certificate to the email server's `mail.example.com` domain. This little convenience script will run, and subsequently reload Dovecot, the IMAP server.

---

*Originally published on [xhalford.com](https://www.xhalford.com/using-hook-scripts-with-certbot/)*
6 Ways How to Avoid a Cringey or Embarrassing Business Name in 2021 | Tekraze
Tags: business, tips, branding
Published: 2021-08-13 11:09:24

Businesses with cringey brand names frequently get into difficulty because their brand names—which were designed to help them succeed—become a source of humiliation and disgrace.

#Lets check out ways How to Avoid a Cringey or Embarrassing Business Name
Countless companies have fallen prey to the hungry jaws of failure due to a lack of understanding of the effect their brand’s name has on their products. And if you don't want your company to suffer the same fate as Ayds diet candy, make sure you avoid these naming blunders.

### 1. Avoid Names with Negative International Connotations
With the rate at which everything is becoming digital, don't expect your brand name to be limited to its immediate surroundings. Customers all over the world are watching, and they won't hesitate to dump your products if you make a blunder with your brand name.

Want to know what Spanish customers did when they learned that ‘La Puta' meant ‘The Whore?’ Well, they wasted no time in dumping Mazda's Laputa. 

And yes, customers did something similar in Finland when they abandoned Fiat’s Uno because the Italian term for ‘One,’ ‘Uno,’ also meant  ‘Fool’ in Finnish.

So, before choosing a foreign brand name, make sure you've done your homework to ensure it won't offend buyers from other countries.

### 2. Don’t Use Names that’d Offend Customers
Crazy, Irate, Angry, Mad, Upset, Person
Courtesy: Pixabay
In today's world, where customers are much more aware of the brands they buy from, sending the wrong message—from your brand name—about issues of culture and politics will undoubtedly create a chasm between your brand and its customers, much like Aunt Jemima's name did before it was rebranded to Pearl Milling Company.

Understand that insulting your clients is a tried and true formula for brand disaster. Many firms make the mistake of attempting to demonstrate their originality with a cheesy brand name, and they pay the price.

Entrepreneurs must exercise caution when dealing with political difficulties because even after you've chosen a unique name, don't do anything that would make your customers ashamed of your business. So you have to…

Read full article at [Tekraze.com](https://tekraze.com/avoid-cringey-embarrasing-business-name/)
Terraform Cheat Sheet
Tags: terraform, aws
Published: 2021-08-13 11:06:01

Will add more later:
As Main.tf
 ![Terraform reference - provider.tf](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eafy6dhdnq7nsnekpvuv.png)
Alternatively, You can break it up into separate files:
 ![Terraform reference - Page 2](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8e2u8rswths245kiq8x5.png)
 
[Terraform AWS resource list](https://registry.terraform.io/providers/hashicorp/aws/latest/docs)

Commands:
`terraform init`
initialize a working directory containing Terraform configuration files

`terraform fmt`
formats the files to be Terraform friendly.

`terraform validate`
checks config files but does not check remote services

`terraform plan`
creates execution plan

`terraform apply`
executes the actions proposed in a Terraform plan

`terraform destroy`
tears down terraform infrastructure


For the Terraform Import method:
https://spacelift.io/blog/importing-exisiting-infrastructure-into-terraform
Installing Nginx on Ubuntu and hosting Websites
Tags: devops, nginx
Published: 2021-08-13 11:03:32

Nginx, is an open source web server that can also be used as a reverse proxy, load balancer, mail proxy and HTTP cache. It is used frequently in deploying a web app on Virtual Machines and other IaaS services.

We'll be using Microsoft Azure Virtual Machine to deploy an application using the nginx Web Server. We'll also address some common issues that one may encounter during the deployment.

## Setting up the Virtual Machine
First of all, we need to have an Ubuntu machine, you can get one from many popular sources including AWS, Azure, Google Cloud, DigitalOcean etc. If you just want to try out the deployment, you can also just use an Ubuntu machine using Virtual Box, VMWare etc. hosted in your own machine.

After setting up the machine and opening the terminal, we should first make sure that our machine is updated using
``` sudo apt update
sudo apt upgrade ```

Setting up Nginx Web Server
Now that we have our machine up and running, we can now install the nginx server using 

sudo apt-get install nginx
We should also check out our Network Security Group applicable in many cloud service providers and ensure that port 443 (for HTTPS) and port 80 (for HTTP) is enabled. We should also ensure the firewall rules to be allowed for port 443 and 80, we should also make sure that nginx is allowed, we can do that through 

``` sudo ufw allow 443
sudo ufw allow 80
sudo ufw allow 'Nginx Full' ```

There's no need to do the above steps if 

``` sudo ufw status ```
returns inactive.

Now we can also enable the nginx server to run when a system boots up and start the server using:

``` sudo systemctl enable nginx
sudo systemctl start nginx ```

Setting up the Website
After nginx is set up, we can now clone our website to the machine.

We can now clone our website code in a directory already created by nginx, which is /var/www. We can navigate to the directory using 
``` cd /var/www ```
If the website is hosted as a git repository, we can directly clone the website repository by using

``` sudo git clone websiteurlhere.git ```
and this will automatically create a directory with the name of your repository. Let us assume it is "semikolan" in this case.

If you do not have a Git repository, you can also download a zip file containing code using 

``` sudo wget websiteurl.com/websitecode.zip ```
and then unzip the code in another folder and then proceed. 

Read more here: [Installing Nginx on Ubuntu](https://blog.semikolan.co/blog/installing-nginx-on-ubuntu-and-hosting-websites)

You can now follow these blogs according to your tech stack:

Laravel: [Laravel](https://blog.semikolan.co/blog/hosting-laravel-nginx-and-common-errors)

And you can set up an SSL certificate using [this](https://blog.semikolan.co/blog/ssl-certificate-ubuntu-certbot) tutorial.
Ensure ActionExecutionDelegate is invoked from ASP.NET Core filter
Tags: csharp, dotnet
Published: 2021-08-13 10:37:54

Developers might forget to invoke `ActionExecutionDelegate` from ASP.NET Core filter `IAsyncActionFilter.OnActionExecutionAsync`. Which is essential for the HTTP request to go through the whole pipeline. So forgetting to invoke `ActionExecutionDelegate` will essentially terminate the request processing through the pipeline. 

For ease I use following `abstract` base class which just wraps the interface and ennsures `ActionExecutionDelegate` is being invoked.

```csharp
public abstract class BaseAsyncActionFilter : IAsyncActionFilter
{
    public async Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next)
    {
        await OnActionExecutionAsync(context);

        await next();
    }

    protected abstract Task OnActionExecutionAsync(ActionExecutingContext context);
}
```

Following xunit test verifies that `ActionExecutionDelegate` will be invoked.

```csharp
[Fact]
public async Task OnActionExecutionAsync_Should_Invoke_Action_Execution_Delegate()
{
    // Arrange

    // setup fixture (using nuget package AutoFixture)

    var fixture = new Fixture(); 
    fixture.Register(() => new ParameterDescriptor());
    fixture.Customize(new AutoMoqCustomization());

    var hasActionExecutionContextInvoked = false;

    Task<ActionExecutedContext> Next()
    {
        hasActionExecutionContextInvoked = true;

        return Task.FromResult(fixture.Create<ActionExecutedContext>());
    }

    var sut = new SpyBaseAsyncActionFilter();

    // Act

    await sut
        .OnActionExecutionAsync(fixture.Create<ActionExecutingContext>(), Next);

    // Assert

    hasActionExecutionContextInvoked.ShouldBeTrue();
}


public class SpyBaseAsyncActionFilter : BaseAsyncActionFilter
{
    protected override Task OnActionExecutionAsync(ActionExecutingContext context)
    {
        return Task.CompletedTask;
    }
}
```
T-SQL: How To Use ROW NUMBER() and Why
Tags: sql, tutorial, database
Published: 2021-08-13 10:28:07

No matter what data we receive, we will probably be required to order it a certain way at some point. In some cases, we may simply order data by dates and receive it in that format, meaning we have little to do. But there are other times when we have to order those data sets for other reasons - possibly to identify duplicates, to order the dated data with other patterns ordered, etc. In the video, [SQL Basics: How To Use ROW NUMBER() and Why](https://www.youtube.com/watch?v=vR5DfWIUhXM&list=PLHHm85xMQAYNScEs-nu9gzi2uoQ9JCCYA&index=13), we look at a built in function in most SQL languages that allows us to quickly order data by a column or more columns.

Some questions that are answered in the video:

- In the examples, we're using new tables that have data in them to demonstrate the ROW_NUMBER() functionality along with using some tables that we've used in other examples.
- When we review the examples, what happens if we have multiple columns that we order by? How would we specify that if we wanted Column1 to come before Column2?
- What can we pass into the ROW_NUMBER() functionality that allows us to invert the order of a data set? How could this be useful?
- Think of a math question that ROW_NUMBER() would help us solve. Any question that involves first ordering data (ie: median, mode as simple examples) will highlight where this functionality will be useful.

As mentioned in the video, we can sometimes use ordering data to calculate values (ie: median was mentioned as one outcome that we can get with using this functionality). In the case of median, as an example, if we order data ascending and descending by row number with a data set that has an odd number of values, when the values equal each other, we've found the median (note that this is not the case with an even number set of data points). This highlights an example of how we can find the median with an odd set of values using the ROW_NUMBER() functionality. We can also use this functionality (along with other functionality) to identify duplicates because a duplicate is ultimately an "identical" value to something else - thus two rows that are identical are really the same order, even if the ROW_NUMBER() functionality will list them as two (this is why other functionality such as PARTITION BY are key, as we want to then divide by identical values to find them).

ROW_NUMBER() starts at 1, if you're familiar with arrays and the starting with 0 functionality.  Like arrays, we can get the Nth element of data from rows with this (one of many ways to get this when needed).  Because we can use the functionality over many columns together or independently over many columns, this allows us to also get the Nth element of data by column combinations.

This functionality is available in many other SQL languages, as well as Spark functionality (Scala, Python, C#).  For more SQL lessons, you can continue to watch the [SQL Basics](https://www.youtube.com/watch?v=Ied5YaCu_-0&list=PLHHm85xMQAYNScEs-nu9gzi2uoQ9JCCYA&index=1) series.
How do I Resolve Error Code -13 When Installing an App
Tags: android, huawei, appgallery
Published: 2021-08-13 10:15:05

A developer reported that an app downloaded from AppGallery could not be installed.
After checking the message to find out more details about the error, I discovered that the error message was actually "Conflicting provider (Error code: -13)", indicating that ContentProvider of the downloaded app conflicted with that of an existing app. The system also provided a description of the error and recommended a solution.
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u8k4kzi5742wbasq16vi.png)
Generally, if a provider conflict occurs when you install an app, it is probably because an existing app has the same ContentProvider. ContentProvider is one of the four Android elements, although it very rarely used. The ContentProvider feature interacts and shares data between processes, which determines that it must be globally unique. Once an app has registered a ContentProvider on the phone, the app installed later cannot use the same ContentProvider. Otherwise, installation will fail.
As expected, installation failed when we found the same ContentProvider settings in the AndroidManifest.xml file after checking the two conflicting apps.
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ztlqazyl6zxovtc2cgq6.png)
In this case, you can modify the ContentProvider information and install the app again to resolve the problem.
Code Review, my project(landing page, Html,CSS,Js,gsap). "KillerWhale" Surfing school responsive website.
Tags: html, scss, javascript, gsap
Published: 2021-08-13 10:08:40

Hello Everyone 🖐
If You find some time for code review and evaluation of my project, I will be very pleased ...
Thank you in advance for every tip and attention. I accept any constructive criticism.😋 See you next time and 
Have a fruitful and beautiful day !🌞

https://killerwhale.netlify.app/
https://github.com/MarioG8/Surfing-School-Full-Responsive-Website
I Created a 📱Kindle OS with React
Tags: react, amazon
Published: 2021-08-13 09:58:32

Hello~

I like Amazon's Kindle❤, which is a best investment i've done. One day I found an awesome blogger who created a win95 OS for his [blog](https://ash.ms/blog/), which inspired me to create this Kindle-styled componenet libaray.

Here are some screenshots of [my blog](https://blog.yungeeker.com).

![Home](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4mc82lq18xkgkbclsh0a.jpg)

![Dark Mode](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/56mcfwzogyav7cqu9r3y.jpg)

![Reader](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/puqa7jymcx0mub9x7zh6.jpg)

Here is an edit-able playground: [Stackblitz](https://stackblitz.com/github/rivertwilight/kindle-ui)

run `npm run dev` to start dev, or run `npm run start-playground` to start playground only.

### 🍊Features

-   [x] 10 interactive Kindle components（Dialog, Button, List, Navbar...)
-   [x] Light / Dark theme switch
-   [x] Native kindle OS font (Optional)
-   [ ] Still developing...

### Contribution

I use Typescript + React + styled-componenet to create this library. PRs are welcome❤

Project link: [github.com/rivertwilight/kindle-ui](github.com/rivertwilight/kindle-ui)
Azure Fundamentals AZ-900 Module 3 & 4
Published: 2021-08-13 09:36:26


{% youtube pUMBpfZNALw %}

**Reading**

Azure Fundamentals part 3: Describe core solutions and management tools on Azure
https://docs.microsoft.com/en-us/learn/paths/az-900-describe-core-solutions-management-tools-azure/

Azure Fundamentals part 4: Describe general security and network security features
https://docs.microsoft.com/en-us/learn/paths/az-900-describe-general-security-network-security-features/
How to install Homebrew, Pyenv, Pipenv in WSL (Windows) Ubuntu 20.04 
Tags: python, homebrew, pipenv, pyenv
Published: 2021-08-13 09:25:34

### Why homebrew? :

- Homebrew installs the linux apps you need with the single command. 
[Available applications](https://formulae.brew.sh/formula/)



### Homebrew Installation : 

- Follow the steps mentioned in the below script

```console
$/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
```



#### output and follow next steps : 

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xsgevwbxfvvrj6wthzr8.png)

  

### install homebrew dependencies for Ubuntu (If needed) :

```console
$sudo apt-get install build-essential procps curl file git
```


### Test installation by running below command:

```console
$brew install hello
```



***

## Pyenv installation

### Why pyenv ? :

- pyenv lets you to switch between python versions in ubuntu.

### Install python build dependencies for ubuntu :

```console
$sudo apt-get update; sudo apt-get install make build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev

```

then run

```console
$curl https://pyenv.run | bash

```

Below lines should be available in .bashrc

```text
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
```

Restart Shell (If needed)  : 

```console
$exec $SHELL
```

or 

Run below in windows command prompt :

```console

wsl --shutdown 
& login into ubuntu again

```


***


## PIPENV Installation   


### Why pipenv? :  


- pipenv is used to create virtual environment, similar to venv,virtualenv,conda,etc. 

### Install pipenv using homebrew :

```console
$brew install pipenv

```

output:
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gfqml1pn32fn5e2ycw4s.png)
 

***




References :

1. https://brew.sh/
2. https://docs.brew.sh/Homebrew-on-Linux
3. https://github.com/pyenv/pyenv/wiki#suggested-build-environment
4. https://github.com/pyenv/pyenv-installer
5. https://pipenv.pypa.io/en/latest/
6. Cover Photo by <a href="https://unsplash.com/@hiteshchoudhary?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Hitesh Choudhary</a> on <a href="https://unsplash.com/s/photos/python-development?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>
How to run unit test before every git commit with husky
Tags: husky, git, testing
Published: 2021-08-13 09:17:15


首先要安装husky，在安装之前先确认一下``Yarn``的版本，因为通过自动脚本安装，1和2的安装方法还是有点差别的。
```
$ yarn --version
1.22.11
```

安装husky
```
npx husky-init
yarn
```

这样操作以后，其实是自动做了一些事情，比如在package.json中增加了一个开发依赖
```
"devDependencies": {
  "husky": "^7.0.0"
}
```

在package.json中增加了一个脚本，每一次重新部署项目可以手动执行
```
"scripts": {
  "prepare": "husky install"
},
```

多了一个``.husky``目录，其中``pre-commit``文件对应commit之前的hook钩子，``.husky/_/husky.sh``就是husky的代码，钩子执行失败，就exit，达到阻止提交的目的。

还有一个改动，执行``git config --list``，可以看到多了一个配置
```
core.hookspath=.husky
```

最后修改``.husky/pre-commit``内容，禁用jest的watch mode
```
yarn test --watchAll=false
```

如果要彻底卸载husky，要执行以下几个操作
```
yarn remove husky
rm -rf .husky
git config --unset core.hooksPath
// 删除package.json中的prepare script
```

### References
* https://typicode.github.io/husky/#/?id=automatic-recommended
* https://www.npmjs.com/package/husky