teleren/devto huggingface dataset:
Time
Tags: timemanagement, productivity, efficiency
Published: 2019-11-05 14:16:36

This is my first post here and am really excited to reach out to you reading this  post. I had a deep thought Last night and it centers on "TIME". Here's my thought>>>"If I spend an average of 6-7 hours daily on my phone and TV...By the end of the week I would have spent 42-49 hours on phone & TV  and when this is multiplied by 4 weeks which makes 1 month, I would have spent a total of 168-196 hours monthly" converting this time spent on TV & mobile to something more productive like learning a new skill I would have increased self worth, competence and capacity in any field.If you take 10 mins to reflect on how much time you have wasted so far.....Time spent doing stuffs that are needful but not quintessential. I realize we still have to sort what we assume is needed and what is really needed.Reality check....Use your time effectively and efficiently. One day Time would do a reverse flash on our actions. Set your goals with deadline peeps. Use the Pomodoro Technique if you wish....TIME >>(Time, Intention, Money, Energy).We must never get carried away by our first successful punch at life....In any field or discipline... We must remain humble and stay focused.
I have decided to attain the status of a full stack developer by the year and am making frantic and productive efforts to meet my goals. My life has been segmented into different time zones of software engineering activities.
Interactive GraphQL Tutorial for beginners
Tags: graphql, tutorial, webdev, showdev
Published: 2019-11-05 13:54:01

---
title: Interactive GraphQL Tutorial for beginners
published: true
description: This interactive tutorial will help you take your first steps in the world of GraphQL
tags: graphql,tutorial,webdev,showdev
cover_image: https://thepracticaldev.s3.amazonaws.com/i/3hxhfpk6dv68nil3msx5.png
canonical_url: https://blog.graphqleditor.com/interactive-graphql-tutorial/
---

If you would like to start your adventure with the [GraphQL](https://graphql.org/) but you are not sure how we have prepared a small interactive tutorial for you to familiarize yourself with basic **GraphQL syntax** and its elements.

During six short lessons, you will learn the basics allowing you to start working on your first **GraphQL schema**. Click the button below and you will be redirected to the **GraphQL Interactive tutorial**.



[![GraphQL Tutorial](https://thepracticaldev.s3.amazonaws.com/i/e2cu3v5bx8gzt4lep2nf.png)](https://app.graphqleditor.com/?category=tutorial&visibleMenu=code)


[![GraphQL Tutorial](https://thepracticaldev.s3.amazonaws.com/i/5f04t95g3wrny48i1qg8.png)](https://app.graphqleditor.com/?category=tutorial&visibleMenu=code)

If you are looking for more **GraphQL resources** make sure to check:
- [GraphQL Official Documentation](https://graphql.org/learn/)
- [How to GraphQL](https://www.howtographql.com/)

Happy learning!

---
### Speed up your GraphQL API development

[GraphQL Editor](https://graphqleditor.com/) is a supportive tool for both advanced GraphQL users as well as those taking their first steps with GraphQL APIs. Our all-in-one development environment for GraphQL will help you build, manage & deploy your GraphQL API much faster thanks to dozens of built-in micro features. Its graphical interface will also fix communication within your product team. Visualization is the key!

[![GraphQL Editor](https://im4.ezgif.com/tmp/ezgif-4-5c1ceab7b19e.gif)](https://graphqleditor.com)
Composition over Inheritance [example in PHP]
Tags: php, strategypattern, composition, inheritance
Published: 2019-11-05 13:42:42

---
title: Composition over Inheritance [example in PHP]
published: true
description: Learn the difference between is-a and has-a relationship with examples that show why favor composition over inheritance.
tags: Php, StrategyPattern, composition, inheritance
cover_image: https://anastasionico.uk/img/blog/composition-over-inheritance-with-php-example.jpg
---

Let me ask you a few direct questions:

> Did you ever come back after a year to an old application to add new features?
> Have you ever fall in the trap of creating too many relationships among your classes and not remember why?
> Have you ever had a manager or client that asked you to refactor some code with crazy functionalities?

If you've experienced any of these scenarios or wish to avoid them in the future, read this post:

 
Why favor Composition over Inheritance [example in PHP]?

Click here to read it now.

Trevor is a South African freelance web-developer, he has been doing for a while and his clients love him.

He, like all of us, is very happy to work on amazing projects and make business owners of his town satisfied.

He is having the time of is life.

Until that client came back and wanted Trevor to update the web application he worked on a year before.

The web application works just fine, the issue is that it was designed only to do specific tasks, and now the business owner decided that he wants more features, manage more data, and sell more products.

I, Trevor and, I am sure, you have already lived this nightmare, or you will experience it soon.

The needs to edit some code, adding conditions where they were not supposed to be, adding inheritances here and there and more.

Write scalable and reliable code that requires low maintenance and do not need to be discombobulated every time there is an update is a duty of every web developer, but it is also fun to work with and a pleasure to preserve

In this post, you are going to see how to do so, learning the concept of composition and how you can avoid complicating your classes

[**Read the full post here**](https://anastasionico.uk/blog/composition-over-inheritance-with-php-example)
Create Awesome CSS Input Animations
Tags: codepen, javascript, html, css
Published: 2019-11-05 13:25:17

---
title: Create Awesome CSS Input Animations
published: true
description: 
tags: codepen, javascript, html, css
---

{% codepen https://codepen.io/ahmadbassamemran/pen/KKKZJjJ  %}

<hr/>
[Do Not Forget To Like & Subscribe In The Channel:](https://www.youtube.com/AhmadEmran?sub_confirmation=1)
<hr/>

{% youtube TVD_OJMmAbM %}
High time we discussed Mental Health
Tags: mentalhealth, softwaredevelopment, health, productivity
Published: 2019-11-05 13:12:23

---
title: High time we discussed Mental Health
published: true
description: Mental Health issues in this fast-paced life need to be tacked as soon as possible
tags: mental-health, software-development, health, productivity
cover_image: https://thepracticaldev.s3.amazonaws.com/i/5fkzl2bvp7mrv0esotwq.jpg
---

**Hazy Mornings. Brain Fog. Lack of Clarity.** These symptoms may sound familiar to today’s knowledge worker. In these times where people are measured in terms of productivity and output, talking to someone about Mental Health issues is frowned upon. It is acceptable if one is physically unfit, is down with fever or is having a mild body ache but taking some time off to declutter your brain is I believe is not cool and is laughed off generally.

For knowledge workers like us, it is imperative and very important to discuss mental health issues and find out effective solutions and remedies that make us perform to the best of our abilities and get rid of depression, anxiety and lack of clarity towards our goals. 

>In this short article, I try to suggest some steps that can be undertaken by all of us regardless of the fact this modern epidemic hit us or not. Let’s start with point number one:

1. **Conversation**: We are social animals. We need company to survive. Period. Having a conversation with our fellow beings is not only important but a necessity. In these days of fast-paced technological innovations and connectivity, we are more disconnected from each other ever.
Technology helps us communicate but is not able to provide that human touch. Sort this communication thing in your life for better mental health. Find a person of two to chit chat in the office. Discuss your thoughts and feelings and take feedback. Believe me, it works.

2. **Physical Fitness**: A healthy mind resides in a healthy body. How aptly said. Be more physically fit from today onwards. Take those stairs. Eat healthy. Find time to take a casual walk in nature.

3. **Planning**: If you are failing to plan, you are planning to fail. Remember this and plan your day well in advance. Leave a few things to chance. Maintain a journal and write about the things you do in a day. It will help you understand where you spend your time thus proving beneficial in your plans. Try to lead life according to a routine. 

4. **Free Time**: Throw those gadgets away for a while in the day and enjoy peace of mind. Sometimes not doing anything is also a great remedy. Enjoy your free time. Try meditation.

5. **Get rid of negativity**

6. **Be closer to nature**

>It is very important to take care of your mind. It is ultimately the most prized resource we have.

Please share the techniques you use to declutter and how you stay on top of your game.
5 reasons developers need to research real world experiences
Tags: productivity, devops, ux
Published: 2019-11-05 13:03:10

Thought this post was interesting. How developers need to do more to engage with end users and research ‘real world experiences’. 

Do you all talk to the people using the products enough? 

https://diginomica.com/5-reasons-developers-research-real-world-user-experience
How to find a specific String in file content with specific file name in specific folder ?
Tags: linux, ubuntu
Published: 2019-11-05 12:51:16

It sounds trivial task - you want to “find a specific string in a file content of specific file type starting from the current folder“ and yes it sounds easy right ?

However 99% of the developers use their IDE find in path because they simply cannot, even if they can use the terminal it is just not that easy. The command works on any linux/macos so it should be handy for 99% of the developers out there.

For me personally very often I have to find some texts in some properties files, sometimes this happens on different environments which doesn't have any UI so I have to use the terminal.

In order to be clear how this is used lets say I want to search for the string `default.session.timeout=600` which is somewhere in some properties file inside this folder or subfolders.

How to do that ?
```
find . -name "*.properties" -print | xargs grep default.session.timeout=600
```
It is a long command but it do the job, it searches everything from current folder "." filtering files by name and/or extension "*.properties" and it prints the content and uses xargs grep to grep the line that contains this string. 

I hope this is handy for you, because it was handy for me over the years like 100 times.

Also if you are one of this poor, sad souls that uses Windows for some reason because it works in the Enterprise maybe and the Enterprises just love to work slow I have, a bonus for you - the command for __PowerShell__.

```
Get-ChildItem -Recurse -Include *.properties | Select-String "text to search for"
```
If you ask me this is crazy, someone just told me the command :D I am lacking the unlimited mind of windows engineers to came up with this crazy commands.
SSH Shibboleths 
Tags: bash, linux, ssh
Published: 2019-11-05 12:40:13

I'm a bad meeting attendee; 5 minutes into any slide deck I retreat into [paranoid fantasies of network espionage](https://www.shadowruntabletop.com/). Last budget session fantasy-me needed a subtle back channel to indicate that I was operating from a compromised position, so regular me hacked-together a working prototype with bash init scripts, SSH key features, and a little-used SSH config file. 

##### Commands in SSH keys

It's probably common knowledge that key values in the SSH `authorized_keys` file can be [locked to a single command](https://www.ssh.com/ssh/authorized_keys/openssh#sec-Format-of-the-Authorized-Keys-File), so I'll just say that the regularly used SSH key for this system was altered to start with `command="exec bash"` to start an interactive shell. 

##### sshrc

Hosts using the OpenSSH daemon will process a user's `$HOME/.ssh/rc` file *before* sourcing the user's shell init scripts. By default sshd will not allow environment variables to be exported, but will happily execute shell scripts, so a simple instruction to run `touch $HOME/.ssh.lck` was added to create a lockfile. This has the helpful side-affect of not messing with console logins. 

##### bashrc

Last stop is to modify `.bashrc` to look for the `~/ssh/rc` lockfile, set `$PROMPT_COMMAND` to execute a function for password-auth vs. ssh key-auth, and remove the lockfile.

```bash
if [[ -f .ssh.lck ]]
then
        if [[ $(ps axwww | awk '$1 == '"$$"' { print $NF }' | grep "bash") ]]
        then
                function passworded() {
                        echo "User is password-authenticated"
                        unset PROMPT_COMMAND
                }
                export PROMPT_COMMAND="passworded"
        fi

        rm .ssh.lck 2>/dev/null
else
        function keyed() {
                echo "User is SSH key-authenticated"
                unset PROMPT_COMMAND
        }
        export PROMPT_COMMAND="keyed"

        rm .ssh.lck 2>/dev/null
fi
```

The `passworded` and `keyed` functions should of course be tailored for your needs.
Netlify post processing snippets
Tags: html, gatsby
Published: 2019-11-05 11:34:05

This is something that I've come across whilst developing my personal blog with Gatsby. 

I was thinking about adding Google AdSense to my website, so I had to find a solution to inject `<script>` tag into my `<head>` tag. My first thought was to use **react-helmet** to inject the AdSense script.

So I added the code which looked like this

```react
<Helmet>
      <script
        data-ad-client="ca-pub-5792152581969239"
        async
        src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"
      ></script>
</Helmet>
```

Unfortunately, the output couldn't be properly verified by google checks, so I had to find an alternative way to do this.

After doing some research I've stumbled across **StackOverflow** response, which mentioned **Netlify** post processing html injection.

If you go to **Netlify -> Settings -> Build & Deploy -> Post processing**, you will see this screen

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/jb88f5j2eix5regmsn2w.png)

After clicking on the **add snippet** button you will see this

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/jm4phdtu6ytnv22mv86g.png)


 In the dropdown you can select where you to inject the script, then you type in the **title** of you snippet, and then the **HTML** of you snippet, for example

```html
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
``` 

This will now be injected into the page section that you selected in the dropdown.

This has worked great for me, and I personally really like this feature. Expecially for site generator like **Gatsby** which doesn't include a default **index.html** file where you can include your scripts.
Using Beacons for Enhancing In Event Experiences
Tags: iot, iotconsulting, iotdevelopment, iotappdevelopment
Published: 2019-11-05 11:34:15

The advent of technologies like the IoT has simplified our living in unexpected ways. Currently, we are using IoT in almost everything including education, hospitality, manufacturing, home automation, asset tracking, and whatnot. The increase in demand for IoT app development services is an indication that organizations are using IoT to automate and accelerate various tasks at their organization. 

For more details: https://www.oodlestechnologies.com/iot-application-development-services/
Why are many developers here anti tutorial? 
Tags: discuss
Published: 2019-11-05 11:24:44

Hey guys, 
I have read many posts that discourage watching tutorials. I do understand the tutorial loop thing. 

But sometimes it's just difficult to start when you have no idea. And tutorial does help at that point. 

How do you strike the balance? When do you know it's time to let go? 

I started a react project after watching few tutorials. While making some progress, I really didn't know how to proceed. And now going through some tutorials again. 

I would love to hear your experience. How did you let go or knew that this is it?
Weekly Cloud-Native Digest #19
Tags: weeklydigest, cloud, news
Published: 2019-11-07 11:07:57

---
title: Weekly Cloud-Native Digest #19
published: true
date: 2019-11-05 11:14:43 UTC
tags: Weekly Digest,cloud,news
canonical_url: https://educosta.dev/blog/weekly-cloud-native-digest-19/
cover_image: https://thepracticaldev.s3.amazonaws.com/i/0ov6xhnzgga51ad9pkz7.jpg
---

Save  time and stay up-to-date with what’s going on in the Cloud-Native  ecosystem. Every week a collection of useful links with videos, articles  and more. 

- [The 1500 Microservices of Monzo Bank (UK)](https://twitter.com/educostadev/status/1190668251526770690)
- [The  Hardest Part About Microservices: Your Data. Taking a hard look at your  domain and your data will help you get to microservices. By  @christianposta](https://blog.christianposta.com/microservices/the-hardest-part-about-microservices-data/)
- [Saga: How to implement complex business transactions without two phase commit.](https://blog.bernd-ruecker.com/saga-how-to-implement-complex-business-transactions-without-two-phase-commit-e00aa41a1b1b) 
- [Why  do we cache? - Caching is extremely important because you can get  dramatic performance improvements without a lot of effort in certain  situations. Check this great article by @balexlandau](https://hackernoon.com/why-do-we-cache-b24920e1e903)
- [Carving the Java EE Monolith Into Microservices: Prefer Verticals Not Layers By @christianposta](https://blog.christianposta.com/microservices/carving-the-java-ee-monolith-into-microservices-perfer-verticals-not-layers/)
- [3 Easy Things to Do to Make Your #Microservices More Resilient By @christianposta](https://blog.christianposta.com/microservices/3-easy-things-to-do-to-make-your-microservices-more-resilient/)
- [Clarified  #CQRS - Before describing the details of CQRS we need to understand the  two main driving forces behind it: collaboration and staleness. Read  more.  By @UdiDahan](http://udidahan.com/2009/12/09/clarified-cqrs/)
- [Building  Event-driven Microservices Using CQRS and Serverless - One of the most  popular practices in event-driven architectures today is called CQRS.  Check this great example by @kennybastani](https://www.kennybastani.com/2017/01/building-event-driven-microservices.html)
- [Event-Oriented Architecture Anti-Patterns](https://medium.com/letgo/event-oriented-architecture-anti-patterns-2dccc68ed282)
- [Creating  a Microservice? Answer these 10 Questions First  - 10 important  questions that you should answer about any new microservice before  development begins on it – and certainly before it gets deployed into  production. By @datawireio](https://www.datawire.io/creating-a-microservice-answer-these-10-questions-first/)
- [50.000  Orange Stickies Later - Watch this amazing talk with @ziobrando  about  #EventStorming. Event storming is a workshop-based method to quickly  find out what is happening in the domain of a software program.](https://www.youtube.com/watch?v=NGXl1D-KwRI&list=PLxpwvsFSXIjD_RVJ1g_URXyQCNpbGtD6N&index=6&t=0s)

The post [Weekly Cloud-Native Digest #19](https://educosta.dev/blog/weekly-cloud-native-digest-19/) appeared first on [Be Cloud Native](https://educosta.dev).
Extreme Reusability with Functional Programming & Lodash
Tags: javascript, functional, coding, lodash
Published: 2019-11-05 11:09:04

---
title: Extreme Reusability with Functional Programming & Lodash
published: true
description: 
tags: Javascript, Functional, Coding, Lodash
---

There's many ways that people write code. While every coding style has its own strengths & weaknesses, all priotize that the code is **reusable, testable, readable and functional (works)**.


```js
import { flow, map, get, add, reduce } from 'lodash/fp'

const getScore = get('score')

export const countUserScores = flow(
  map(getScore),
  reduce(add)(0),
)
```

The code above is not only extremely reusable (composed functions) but also elegant. It takes an array of user objects with a score and counts them.

Over the course of my professional career I've come to appreciate the simple nature of functional programming and the inherent testability (no side effects).


*Further reading:*

- [Lodash FP Guide](https://github.com/lodash/lodash/wiki/FP-Guide)
- [Functional Programming with Lodash/FP by Paulo Diovani](https://blog.codeminer42.com/functional-programming-with-lodash-fp-8fe0619b3024)
- [Lodash FP usage retrospective by Jordi Sicart](https://codingwithjs.rocks/blog/lodash-fp-usage-retrospective)
Tips for: MongoDB security, choosing right DB, & surviving legacy software
Tags: todayilearned, mongodb, database, programming
Published: 2019-11-05 11:00:17

*TL;DR style notes from articles I read today.*

### [Top 10 security best practices for MongoDB](http://bit.ly/2NFojSD)

- Enable & configure role-based access control. Configure TLS. 

- Restrict network exposure - ensure the instance is only listening on the localhost interface.

- Configure system auditing. Stay updated with MongoDB security fixes. 

- Some MongoDB operations let you execute arbitrary JavaScript expressions. Disable JavaScript execution. 

- Understand how queries are handled by frameworks in use and their sanitization and validation capabilities. 

*[Full post here](http://bit.ly/2NFojSD), 7 mins read*

---

### [How to overcome 5 common database challenges](http://bit.ly/34xcJzX)

When choosing a database, consider the following 5 DB challenges and how your choice of DB tackles these. 
- Data Security: use the database’s built-in security features; or use what your company is already using for security purposes; or reinforce both in your application. 
- Performance: Great performance by a database means deployment with good defaults, being able to recognize an operational environment and scaling up the performance automatically as needed. 
- Data Safety: there must be ACID guarantees both across the database and throughout the cluster. 
- Resource Utilization: a good DB must get 100% from the resources it is working on. 
- High Availability: A DB must provide high availability. It should have assignment failover mechanisms. 

*[Full post here](http://bit.ly/34xcJzX), 4 mins read*

---

### [Practical tips for how to survive and thrive in the chaos of legacy software](http://bit.ly/2JPB1Ns)

- Treat legacy software as the 3rd party software,  take its output and convert it into a form that can be consumed by a new application or a system that you’re migrating to.

- Change only what must be changed. Never underestimate the dependencies in legacy software. 

- Rely on TDD. Write a test that fails, write the code so that your test passes, refactor the code, re-run the test to ensure it passes. 

- “Always leave the code you are editing a little better than you found it.” 

- Don’t cut too many corners and try to maintain projects. Show some TLC to legacy software. 

*[Full post here](http://bit.ly/2JPB1Ns), 6 mins read*

---

*[Get these notes directly to your inbox every weekday by signing up for my newsletter, in.snippets(), here.](https://mailchi.mp/appsmith/insnippets?utm_source=devto&utm_medium=post08&utm_campaign=is)*
Amazon PAAPI v4 Still Live until January
Tags: amazon, paapi, api, affiliate
Published: 2019-11-05 10:05:55

Amazon announced this year that the Product Advertising API (PAAPI) v4 will be replaced by v5.

The shutdown date for v4 was 31st October 2019, but that date has been and gone, and v4 is still live.

There wasn't much communication from Amazon about v5 or v4.

Our only clue is a grainy photograph from an Amazon event in Germany which says the API v4 will now be shut down in January 2020.

We wait for an official announcement.

To find out more about PAAPI v5, which is a LOT better to work with but is missing some features, check out the documentation here:

https://webservices.amazon.com/paapi5/documentation/