teleren/devto huggingface dataset:
Daily Developer Jokes - Monday, Mar 15, 2021
Tags: jokes, dailydeveloperjokes
Published: 2021-03-15 12:00:14

---
title: "Daily Developer Jokes - Monday, Mar 15, 2021"
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=Monday%2C%20Mar%2015%2C%202021"
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/5e1258c78158d.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:
I never tell the same joke twice

I have a DRY sense of humor.
 -->
What is SHIFT LEFT TESTING?
Tags: testing, testautomation, shiftlefttesting, qa
Published: 2021-03-15 11:35:48

Shift-left testing refers to the process of moving testing earlier in the development cycle. Shift-left offers tremendous gains when compared to the old order of testing only when the code is complete.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q5464o6hgn0nwt6vkij0.jpg)

###BENEFITS

* **Find bugs and GAPs early** in the software development life cycle.
* **Reduce the cost of solving** bugs by detecting them early.
* Gain a **higher-quality product** as the code contains fewer patches and code fixes.
* Have fewer chances that the product overshoots the **estimated timeline**.
* Provide **higher customer satisfaction** as the code is stable and delivered within the budget.
* **Maintain higher-quality codebase**.
* Ability to use **test automation tools**.

As we want to test early and often, test automation helps you accomplish this goal. We don’t want to overload our testing team with manually testing every new feature the development team introduces. Therefore, a test automation tool can give quicker feedback regarding the stability of the new code.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bx0w90kh8ft89p6j54k5.jpg)

Furthermore, a test automation tool helps your team shift left. Your team can write tests faster and it becomes easier to maintain them using a test automation tool. [SIPSA] (https://www.sipsa.net/en/)´s [TAST] (https://www.sipsa.net/en/tast/), offers you a **complete framework for the Definition, Planning and Execution of Tests assuring successful automation**.
Prevalence of Childhood obesity?


Tags: cloud, productivity
Published: 2021-03-15 11:31:52

Childhood obesity is a leading problem in almost every country. So, you can blame digitalization, mobile, and the internet for that. 

Besides, In 2016, 41 million children were estimated as overweight at the age of five. Additionally, 13.7 million children approximately are obese at the age of 2-19 years
AWS SNS(Simple Notification Service) notifications not getting delivered to device??
Tags: aws, reactnative
Published: 2021-03-15 11:23:30

*Have you ever came across such issue where your AWS SNS messages sent from AWS console not displaying on your mobile device?*

*If your answer is YES, then you are at right place*

In this article we will focus on how to resolve this issue:

Prerequisites : 
1)You have done all AWS SNS configuration(created AWS SNS topic,created platform application,created platform application endpoint and added endpoint as subscriber of topic)
2)registered your app and device with FCM and AWS SNS.

Source : [Link](https://docs.aws.amazon.com/sns/latest/dg/sns-send-custom-platform-specific-payloads-mobile-devices.html).


1. Go to AWS console
2. Go to the SNS topic that you created earlier
3. Click on publish message button on top right corner.
4. Here a page will open up as shown below.Select "Custom payload for each delivery protocol" radio button.

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

5. Now you can go to [Link](https://docs.aws.amazon.com/sns/latest/dg/sns-send-custom-platform-specific-payloads-mobile-devices.html)
and select the platform-specific message format.
in my case I used GCM format as shown above

> Note that default fallback message is compulsory to give in json body. 

6. in my case I added payload as

`{
  "GCM":"{ \"notification\": { \"body\": \"Sample message for Android endpoints\", \"title\":\"TitleTest\" } }"
}`

7. Now check your device for notifications

That's it. Thanks for reading this article.

Let me know in comment section.
GitUI - 1 year anniversary release
Tags: rust, github, terminal, productivity
Published: 2021-03-15 11:22:49

[GitUI](https://github.com/extrawurst/gitui) is a terminal UI for git written in Rust. We aim to simplify common git tasks in a fast, keyboard-only and cross platform way without leaving your beloved text interface.

# v0.13 highlights

* support stage/unstage/discard by line (oldest, most requested feature)
* support merging via rebase
* [much more](https://github.com/extrawurst/gitui/releases/tag/v0.13.0)

Thanks for your interest and support over this year! Read more about the 1 year anniversary reflections of this project [here](https://blog.extrawurst.org/general/programming/rust/2021/03/15/gitui-a-year-in-opensource.html).
Keeping at it
Tags: procrastination, resilience, perseverance, behaviorhacking
Published: 2021-03-15 11:11:21

---
title: Keeping at it
published: true
description: 
tags: procrastination, resilience, perseverance, behaviorhacking
//cover_image: https://direct_url_to_image.jpg
---

While I do code and read code I do very little of it, at times
it is then difficult to pick up again when I have had my hiatus.

It is a bit more consistent of a run in terms of my blog.

So I keep at it.

Every word counts I guess and I am showing what I do.
My top 3 albums for maximum coding efficiency
Published: 2021-03-15 11:09:13

Here's a list of my favourite albums to listen:

1. [Daft Punk — OST TRON: Legacy](https://open.spotify.com/album/7h3e7G85Ch0IKtmJghkokO)

2. [Pendulum — Immersion](https://open.spotify.com/album/3XtEGVx9uh7J46nBzEc1VS)

3. [Infected Mushrooms — Vicious Delicious](https://open.spotify.com/album/3W2rs8vCNzvB5BmAoCjART)


What do you listen to while coding?
Magento installation issue
Published: 2021-03-15 10:55:51

Hello,
I'm new to this magento.few days back iam created account in Magento,and downloaded zip file in the ver 2.4.
Iam trying to install it,but it showing error message object not found on chrome when I hitting the localhost along with Magento projects folder title.
System configuration:
Windows10
64bit
Campo
Php 7.4
Magento2.4

So please help me any one of you.
numeric value encountered ErrorException (solution) in php Laravel
Tags: laravel
Published: 2021-03-15 10:29:31

Recently I was working a Laravel project which was developed by our previous Software team. When I was assigned for this, project I was going to run this project at this time current version of php is php7. and I was run it by latest laragon server which php version is php7. But the previous team was working with php5. So, when I run the application it’s shows me an error like below:
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4s0k1b9n8ubq8vxzm8gq.PNG)
Then I was trying to solve this error and search on the internet for that. After couple of time I got a clue for solving this. And a gentlemen gives a tip over the internet. The tips like below
Because you are passing a string as the second argument to the date function, which should be an integer.
string date (string $format [, int $timestamp = time ()])
Try strtotime which will Parse about any English textual datetime description into a Unix timestamp (integer):
date ("d", strtotime($_GET['start_date']));
  
but in my case our previous programmer writes a function which is like
date('Y-m',strtotime($t->date_of_birth1)
so, I was replace this function date(‘Y-m’,strtotime($t->date_of_birth1)) to date(‘d’,strtotime($t->date_of_birth1))
which idea I actually find from the internet gentlemen’s tips. Finally, my problem is solved. And php5 software run in my php7 updated platfrom.
Sorry to say I forgot this gentlemen’s name but I want to say thanks her.
.
that's it.
.
Happy Coding.
osman forhad
Mobile & Web Application Developer💻
php is not recognized as an internal or external command error (solution)
Tags: laravel
Published: 2021-03-15 10:26:38

Once I was working with a Laravel project which was in my xampp server and now it is in laragon server
In the min time I was going to run that project so I was type and run php artisan serve command on my terminal and it’s show me an error the error look like below
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7miqukljtp9kwpv8ywwz.PNG)
But there is another thing was happening. Thing is that the project isn’t run by artisan command but the same project is working when I type localhost/public/ on my web browser. So that time I was too much queries why this is happening actually. After a long time, I realize the mistake made by me. Actually, it’s a very funny what I done. 
I realize that the composer I was install 1st time I was define php location from my xampp server. But now I am trying to run project by using php command which is in my laragon server. Ha ha….… what a funny mistake.
Finally, I think what I should do to avoid this php is not recognized as an internal or external command error. So, I remove my composer and again install fresh composer. Now in the composer installation time I was carefully define my php location which is in my laragon server.
And finally, php artisan server command is working nicely.
.
that's it.
.
Happy Coding.
osman forhad
Mobile & Web Application Developer💻
#5 Adding MongoDB to react-express-graphql project Part 2
Tags: javascript, react, graphql, mongodb
Published: 2021-03-15 10:24:05

Refer [here](https://dev.to/mehaksaini11/adding-mongodb-to-react-express-graphql-project-3ami) for Part 1

While using graphql in express, we add the schema and resolvers to set the graphql middleware. Here, we'll be adding a new user to mongo for which we've already created a schema file
####./models/user.js
```
const mongoose=require('mongoose')

const userSchema= new mongoose.Schema({
    email:{
        type:String,
        required:true
    },
    password:{
        type:String,
        required:true
    }
})

module.exports=mongoose.model("user",userSchema)
```
Import the user schema to your server
```
const User=require("./models/user")
```
Since, we are performing one of the CRUD operations, let's add the addUser mutation in our code.
```
type RootMutation{
                addUser(userInput:UserInput!):User!
            }
```
Let's go ahead and create the User types and User input
```
            type User{
                _id:ID!,
                email:String!,
                password:String!
            }
            input UserInput{
                email:String!,
                password:String!
            }
```
As we call the addUser mutation, a corresponding resolver is required to perform the subsequent task of adding the user to database. **rootValue** denotes the resolver functions.
```
rootValue: {
      addUser:async (args)=>{
        try{
            const user=new User({
                email:args.userInput.email,
                password:args.userInput.password
            })
            const result=await user.save()
            console.log("result:"+result)
            return{
                ...result._doc
            }
        }
        catch(err){
            console.log(err)
        }
      }
    }
```
Since we are returning a user on every new user creation, we need to create a new object and set the newly created user's properties to it. We are using async await to cater to asynchronous calls.
In the end, we need to save the user to the db, hence we call user.save()
Let's test it in our playground
![graphQL playground](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rdz63xqh1k8nq5u77sip.png)
Check your database and you'll see the new user entry
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sykwa473i5ver8339n3n.png)
 Let's add the user query and corresponding resolver and check the result
```
type RootQuery{
                user(id:ID!):User!
            }
```
```
user: async(args) => {
        try{
            const user=await User.findOne({_id:args.id})
            return{
                ...user._doc
            }
        }
        catch(err){
            throw err
        }
      }
```
![graphQL playground](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fwox7ue3le0bcfl5x12v.png)
How to Export Roundcube Contacts to Outlook ?
Published: 2021-03-15 10:18:00

 Roundcube is one of the three webmail applications provided by the cPanel. Webmail is a web-based service that enables its users to access their emails, contacts, calendars, and other items by simply using a web browser. You only have to log into your webmail account to read/send emails. When you access your data using webmail, you are directly interacting with the server that has your information stored. Needless to say, you are free to use any browser to access your webmail account without being location bound with the help of a stable internet connection. 
visit -https://www.technologycrowds.com/2020/10/best-ways-to-export-roundcube-contacts.html
How to parse HTML table using HTML Agility Pack C#?
Published: 2021-03-15 10:11:41

Often copying tabular data from web pages are time-consuming and you may not happy with the quality of the ready made tabular structure. For the purpose of time-saving, you must know How to parse HTML table using HTML Agility Pack C# and your needs could be fulfilled in a customized manner. Apart from the extraction of text, capturing image, favicon, meta information, Data Mining, and other things, Parsing HTML table could be the latest Web Scraping tactics to help the end-users.
Visit: https://www.technologycrowds.com/2018/05/what-is-new-in-dot-net-core-3-0.html
What is new in dot net Core 3.0?
Published: 2021-03-15 10:08:24

Our previous article was on What Is New In ASP.NET Core 2.0 and we also discussed what is HAP and how is it useful! Here, in this blog, we are going to see the new tale of the powerful beast for the computer world which is the .NET that simplify the task of developing cross-platform applications. Microsoft has recently announced about sharing their plans of .NET Core 3.0 and therefore, it is important for us to know What is new in .NET Core 3.0. The version 2.1 of the .NET is ready for the release this year that offers a greater blend of tools and features but to add more excitement to it, Microsoft has started to lay roads for the development of .NET Core 3.0 and are expecting to release it in 2019. The interesting part is that features that were requested by the individual developers and coding enthusiasts have been implemented.

Visit: https://www.technologycrowds.com/2018/05/what-is-new-in-dot-net-core-3-0.html
Build an Ag-Grid React Component that Auto Resize Columns To Fit Container Width
Published: 2021-03-15 10:07:59

Ag-Grid is a powerful data table library with tons of features. It requires some learning and doc reading, but I think it is worth it.

This post will share an Ag-Grid wrapper component that will resize columns sizes to fit its container's width automatically. If its container size changes, it will resize the columns to fit the new width.

The trick is straightforward, it watches its container's width, and `window.resize` event and call `sizeColumnsToFit` from AgGrid's API within an `useEffect` hook.

The component props of this component extend `AgGridReactProps` so we can use it the same way as we use the official `AgGridReact` component.

1. `useDebounce` hook from [usehooks.com](https://usehooks.com/useDebounce/) to reduce unnecessary calls to `sizeColumnsToFit`. It is entirely optional.
{% gist https://gist.github.com/rexebin/41d034faa73732833e3842f1230f4737 %}

1. `useWindowSize` hook subscribes to `window.resize` event and update state `size`
{% gist https://gist.github.com/rexebin/236d4f029553c6e5f4a372a90dc6dcd4 %}

1. `useContainerWidth` hook report width size with [`getBoundingClientRect` API](https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect) to report the element's width.
{% gist https://gist.github.com/rexebin/f03c1454e4cc61ea95335eb3ded0807e %}

1. Finally, we have `AgGridAutoResizeToContainer` using the above hooks and `useEffect`.
{% gist https://gist.github.com/rexebin/80afcd345556ec4d68ac72a637e55f13 %}

The working sample is on CodeSandbox:
{% codesandbox aggridautoresizetofitcontainer-dn6wi %}

Happy coding…
Introducing Truffle
Tags: truffle, metacoin, blockchain, ethereum
Published: 2021-03-18 10:21:25

---
title: Introducing Truffle
published: true
date: 2021-03-15 10:05:33 UTC
tags: truffle,metacoin,blockchain,ethereum
canonical_url: https://medium.com/coinmonks/introducing-truffle-f47a9f24a094
---

[![](https://cdn-images-1.medium.com/max/1125/0*JR6Ibo58fzAwuOnU)](https://medium.com/coinmonks/introducing-truffle-f47a9f24a094?source=rss----721b17443fd5---4)

A world class development environment, testing framework and asset pipeline for blockchains using the Ethereum Virtual Machine (EVM).

[Continue reading on Coinmonks »](https://medium.com/coinmonks/introducing-truffle-f47a9f24a094?source=rss----721b17443fd5---4)
Generating Auth Scaffolding to Running make: auth in Laravel
Tags: laravel
Published: 2021-03-15 10:03:36

After installing a fresh Laravel6 Application I have noticed that the make: auth command no longer exists.
For this case, first I have to install the Laravel/ui package via composer.
So, what is Laravel ui.?
Laravel ui: Laravel ui is a new first-party Package that extracts UI Portation of a Laravel project into a Separate Laravel/ui package.
The Separate
The package enables the Laravel team to iterate on the ui Package    Separately from the main Laravel codebase.
for this reason, first I am going to project the directory through the cd and Run composer requires larval/UI --dev command on my terminal.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pqh9mdbxduze32zf9lc8.PNG)
And then Run PHP artisan UI vue --auth 
Now I need to install npm and run dev (which also suggest Laravel Application on my terminal) 
for that, I have to run the npm install command on my terminal.
And then run npm run dev command.
That’s it.
Finally, Auth Scaffolding in Laravel6 Generates Successfully.
.
that's it.
.
Happy Coding.
osman forhad
Mobile & Web Application Developer💻
Interacting with Truffle
Tags: blockchain, solidity, truffle, ethereum
Published: 2021-03-18 10:21:37

---
title: Interacting with Truffle
published: true
date: 2021-03-15 10:02:55 UTC
tags: blockchain,solidity,truffle,ethereum
canonical_url: https://medium.com/coinmonks/interacting-with-truffle-3ae179ab8a5b
---

[![](https://cdn-images-1.medium.com/max/1000/0*lE9ZzLcxQTCcr4uE)](https://medium.com/coinmonks/interacting-with-truffle-3ae179ab8a5b?source=rss----721b17443fd5---4)

How to can interact with a contract before you build a proper Web interface.

[Continue reading on Coinmonks »](https://medium.com/coinmonks/interacting-with-truffle-3ae179ab8a5b?source=rss----721b17443fd5---4)
how to generate view and controller in Laravel
Tags: laravel
Published: 2021-03-15 10:00:06

recently I was working with a Laravel project for this purpose I need to generate view and controller through the command 
so, what I was done for that I want to share with you few about it.
For Generate the views: I was run below command in my terminal
	php artisan crud:view permissions --fields="name#string" --view-path="pages" --route-group=admin --form-helper=html --validations="name#required"


For Generate the controller: I was run below command in my terminal
	php artisan crud:controller PermissionsController --crud-name=permissions --model-name=Permission --model-namespace="Spatie\\Permission\\Models\\" --view-path="pages" --route-group=admin
.
that's it.
.
Happy Coding.
osman forhad
Mobile & Web Application Developer💻
react-native-push-notifications (handling foreground push notifications)
Tags: javascript, reactnative
Published: 2021-03-15 09:59:16

*Ever wondered why push-notifications are not getting displayed when your app is in foreground ???*

*If your answer is yes,then you are at the right place!!*



Here you go

So recently I faced one issue while implementing push notifications in my app using AWS SNS, firebase cloud messaging (FCM).

Firstly I thought that there is some issue with my AWS SNS configuration.

After digging into this issue I finally found that there is issue with the way I configured my react-native-push-notifications library in my react-native code.

**Prerequisites : You have configured your react-native app as shown in below link :**
[Link](https://github.com/zo0r/react-native-push-notification)

Create a new React component (RemotePushController.js)
```
import React, { useEffect } from 'react';
import PushNotification from "react-native-push-notification";


const RemotePushController = () =>{
    useEffect(()=>{
        PushNotification.configure({
            
            onRegister: function (token) {
              console.log('TOKEN:', token);
            },
            
            onNotification: function (notification) {
              console.log('NOTIFICATION:', notification);
            
            if (notification.foreground) {
            PushNotification.localNotification({
              title:notification.title,
              message:notification.message
            });
            } 
            },
            
            senderID: "your_fcm_sender_id_here",
            
            permissions: {
              alert: true,
              badge: true,Consent
              sound: true
            },
            
            popInitialNotification: true,
           
            requestPermissions: true,
          });
    },[]);

    return null;
};

export default RemotePushController;
```

Now inside your App.js file include the RemotePushController component as shown below:

```
const App = () => {
  return (
    <View>
      <RemotePushController/>
    </View>
  );
};

```

In case suppose your root component is Provider from react-redux library then add it as follows:

```
const App = () => {
  return (
    <Provider store={store}>
      <RemotePushController/>
    </Provider>
  );
};

```
So the basic idea is just add RemotePushController component above the ending root tag.

**So the important part you need to keep in mind is adding following code in PushNotification.configure() as below:**

```
  onNotification: function (notification) {
   console.log('NOTIFICATION:', notification);
            
   if (notification.foreground) {
       PushNotification.localNotification({
           title:notification.title,
           message:notification.message
       });
    } 
 }
```

That's it!!!!
Now you are good to go.
Now just run your react-native app again and try sending push notifications while your app is running in foreground.

Let me know in comment section