teleren/devto huggingface dataset:
Would you mentor someone 5 min. a day?
Tags: dev, beginners, career, help
Published: 2018-12-15 14:22:16

--- 
title: Would you mentor someone 5 min. a day?
published: true
description: On how to overcome the gap between experienced devs and newbies
tags: dev, beginners, career, help
---

So I'm learning JS on my own and I've found many helpful sites (fCC, MDN, Dev.to...) and tools (Discord, Twitter, git, kanban boards...) but sometimes I get the feeling that I'm trying to find the perfect cherry blossom on a rainy day (not that it gets much easier on sunny ones).

![The last samurai movie, Katsumoto looking for the perfect cherry blossom](https://i.gifer.com/11aQ.gif)

You have tutorials, specs, exercises and it all seems overwhelming even though you know that many things are hard to master at first and take time and effort to master.
But, unlike learning to drive, many of us don't have an instructor or teacher to rely on and experienced people have even less free time available than us.
So I was wondering... 
What do we do when entities can't provide the resources and means for people to learn something? How do we help a kid learn to ride a bike with no training wheels without being able to be there all the ride?
I've seen many forum threads, groups and servers where we (as far as I'm told) ask the same questions and encounter the same difficulties when learning new programming concepts again and again. 

![The last samurai movie, funny kid](http://imoviequotes.com/wp-content/uploads/2015/02/The-Last-Samurai-quotes.gif)

And I wonder... Does this happen less on other fields?
Can people without a teacher or mentor overcome the barrier between documentation/specs and mentorship/classroom?
I've learned about many people trying to make better specs, people making better tools, better learning platforms and all that has brought us with many and more helpful sites and improvements, yet we're often told that one of the best ways to learn is to surround yourself of people that have more experience than you and can teach you something new. 
So, in a field where many of us are "changing" careers and don't have much free time to enjoy a meetup, attend a conference or network ourselves out of our "newbieness", how can we learn to ride a bike with no training wheels? 
Do we fall until we get it? Can we get 5 minutes a day with someone experienced to learn from directly? That doesn't seem much but... Is it fair for us to ask for 30 hours a year of someone's time?

I think we're fortunate to be able to count on so many generous people and entities  that came before us and provide "free" time and resources so we all can get a chance. But, even before I call myself a developer I wonder... Can we go even further and improve our learning process without taking more from our predecessors?

![Samurai Champloo companionship](https://pa1.narvii.com/5828/ebb625506df581cd0422f4070e241e03f4acea04_hq.gif)

Side note: First time publishing anything so be gentle or hate me kindly, :)
How I hate the term «Ethical Hacker» !
Tags: hacking, security, blogging, opinions
Published: 2018-12-15 12:44:14

---
title: How I hate the term «Ethical Hacker» !
published: true
description: ...But what I don't like is the term "Ethical hacker", because it implies that the hacker is unethical by nature.
tags: hacking, security, blogging, opinions
cover_image: https://thepracticaldev.s3.amazonaws.com/i/iac0tpr5flpdoy337fss.gif
canonical_url: https://blog.yafkari.dev/blog/how-i-hate-the-term--ethical-hacker-al8
---


_Be nice to me please, that's my first post and I don't have extraordinary English skills so feel free to correct me !_😁

Nowadays, **security has become an essential issue in the world**. Whether in the real world or in the virtual world.

Today, we only talk about cyber-crime, cyber-war, data theft, ...
Hacking has become a sad reality from which no one can escape.
Whether it is a person, a small or large company like Facebook or Google.
We are all susceptible to be attacked by a malicious hacker, whether it is to get money, data, for fun, etc...

The demand for IT Security analysts, ethical hackers, … has exploded.
And that's a good thing because security and privacy take priority over everything else. (and that's also a good thing for me when I will finally leave school 😆)


But if there is one thing that bothers me, it is the term "Ethical hacker" used every time because it implies that the hacker is unethical by nature.
Once again, we will have to go back to the real definition of the hacker (at least my definition).

For me, a hacker is a person who is curious, a person who instead of just using his toaster will use it, but also open it, understand how it works and finally customize it (for example, add a little voice that wishes us a good day).
_A great idea and very useful, in my opinion 😂._

A computer hacker, therefore, will follow the same principle.

In this case, there are different types.

There are the:
* **Black hats** who are motivated by money and the pleasure of entering other people's systems without authorization. &larr; __*the real unethical person*__

* **grey hats** who acts more or less in an "ethical" way. These are usually the kind of people who enter a system, without authorization again but without damaging it, for the pleasure of doing so or later inform the company that they have just hacked, so that they can fix the flaw.
* **white hats** who are the "good guys" of the story.
I think the definition of [Wikipedia](https://fr.wikipedia.org/wiki/White_hat) is very good, so I'll put it as it is: 
A white hat is _a computer security expert who performs intrusion tests and other test methods to ensure the security of an organization's information systems._

So I prefer the terms "IT security expert", "pentester", etc...


That's all for today, I hope you enjoyed this little article and you'll fight against the expansion of the _The thing that should not be named_ 😂.


And of course, don't hesitate to give your opinion on the subject !
Tiny python docstring tip
Tags: python, tips
Published: 2018-12-15 11:46:33

---
title: Tiny python docstring tip
published: true
description: Small tip for writing abstract classes in python
tags: python,tips
cover_image: https://www.maxpixel.net/static/photo/1x/Small-Caught-Animal-Snake-Hand-Reptile-Detention-193933.jpg
---

When defining interfaces in python using the `abc.ABC` metaclass, sometimes it gets pretty annoying to have so many empty methods, waiting to be filled in.

```py
import abc
class Requester(abc.ABC):
    @abc.abstractmethod
    def get(self, endpoint:str) -> Response:
        """Sends a GET request."""
        pass

    @abc.abstractmethod
    def post(self, endpoint:str, params:dict) -> Response:
        """Makes a POST request."""
        pass
```
All these uses of `pass` always felt pretty ugly to me, and luckily there is a solution!

Because docstrings are simply a string expression in the start of a function - you can just let go of the pass!

```py
import abc
class Requester(abc.ABC):
    @abc.abstractmethod
    def get(self, url:str, url_params:dict) -> Response:
        """Sends a GET request."""

    @abc.abstractmethod
    def post(self, url:str, url_params:dict) -> Response:
        """Makes a POST request."""
```
Now isn't that so much nicer?
need help with python automation 
Tags: discuss
Published: 2018-12-15 07:05:38

---
title: need help with python automation 
published: true
tags: discuss
---

hello everyone Im new here,and im looking for a solution to my problem in python automation.IM working on a project where I need to auto fill a online form using python.I have the required data but the problem is how can i do what i want.I just want to fill in the fields using selenium and python then skip the other steps and then use other data from the excel file close the browser and then repeat the process.

I would appreciate your help,earlier I tried it with pyautogui but i wasn't successful.
How to implement Auto Logout client side in react
Tags: javascript, react, es6
Published: 2018-12-15 06:59:44

---
title: How to implement Auto Logout client side in react
published: true
description: How to implement Auto Logout client side in react
tags: #javascript #react #es6 #js
---

Post Link : <a href="https://www.skptricks.com/2018/12/how-to-implement-auto-logout-client-side-in-react.html" >How to implement Auto Logout client side in react </a>

This tutorial explains how to implement auto logout system in client system in react application. The Auto Logout system is implemented by most of the web application nowadays, that helps users to protect their secure data from unauthorized access in case they forgot to logout their web application sessions.

So In this tutorial, we are going to share React source code to implement auto logout system. In this example we are maintaining two timestamp for user session.
First timestamp helps to notify alert message when user is inactive for 16 seconds.
Second timestamp helps to initiate logout module when user is inactive for 30 seconds.
How to implement Auto Logout client side in react

<a href="https://www.skptricks.com/2018/12/how-to-implement-auto-logout-client-side-in-react.html" >How to implement Auto Logout client side in react </a>


<img src="https://4.bp.blogspot.com/-9Ewcb1fEJkQ/XA8yumRD2PI/AAAAAAAACQ4/er8qHRKoeQ0Y4ymzTQyXYc5jn8vJzZsmACLcBGAs/s640/logout.png" />
React Native Share API To Share TextInput Message
Tags: javascript, react, android
Published: 2018-12-15 06:57:39

---
title: React Native Share API To Share TextInput Message
published: true
description: React Native Share API To Share TextInput Message
tags: #javascript #react #js #android
---

Post Link : <a href="https://www.skptricks.com/2018/12/react-native-share-api-to-share-message-in-android-ios.html" > React Native Share API To Share TextInput Message</a>

This tutorial explains how to implement React Native Share API to Share TextInput message in android or ios application. React Native Share component which is used to share any content. We usually add a share button in our app to share something with other users either using any social media or any other medium. We can share Text message from directly our app to Whats App contacts, Hike Contacts, Groups, SMS, Copy to Clipboard, Share to Google drive, Gmail, Hangouts, and One Drive and other installed application.

<a href="https://www.skptricks.com/2018/12/react-native-share-api-to-share-message-in-android-ios.html" > React Native Share API To Share TextInput Message</a>

<img src="https://2.bp.blogspot.com/-Ebvi9ifzGI8/XA034xZ423I/AAAAAAAACQs/fH8GHa0SILEu0K2LTicVV-jYpfXlPgOpACLcBGAs/s640/share.png" />
React Native Start Stop Device Vibration on Button Click Android Or iOS
Tags: javascript, reactnative, react, android
Published: 2018-12-15 06:55:58

---
title: React Native Start Stop Device Vibration on Button Click Android Or iOS
published: true
description: React Native Start Stop Device Vibration on Button Click Android Or iOS
tags: #javascript #reactnative #react #android
---

Post Link : <a href="https://www.skptricks.com/2018/12/react-native-start-stop-device-vibration-on-button-click.html" > React Native Start Stop Device Vibration on Button Click Android Or iOS</a>

In this tutorial, we will discuss how to start and stop vibration on button click in react native application for android or ios device. Nowadays Vibration is most integral part of  every mobile device, that helps to notify mobile user about latest notifications, calls etc. In this tutorial we are going to create a react native application using React Native’s Vibration API component. We would Start Stop Device Vibration on button click and stop it.
React Native Start Stop Device Vibration on Button Click Android Or iOS

<a href="https://www.skptricks.com/2018/12/react-native-start-stop-device-vibration-on-button-click.html" > React Native Start Stop Device Vibration on Button Click Android Or iOS</a>

<img src="https://3.bp.blogspot.com/-DNZlq_7cfeM/XA0VrPnL7cI/AAAAAAAACPw/u9SN2KrSwv889hLDJG6OcCg5XEulI-GlgCLcBGAs/s640/vibration.png" />
React Native Detect Device Is Android Or IOS
Tags: javascript, es6, react
Published: 2018-12-15 06:54:03

---
title: React Native Detect Device Is Android Or IOS
published: true
description: React Native Detect Device Is Android Or IOS
tags: #javascript #es6 #js #react
---

Post Link : <a href="https://www.skptricks.com/2018/12/react-native-detect-device-is-android-or-ios.html" >React Native Detect Device Is Android Or IOS </a>


This tutorial explains how to detect device is android or ios in react native application. When building a cross-platform app, you'll want to re-use as much code as possible. React Native is a cross platform native application programming language comes with platform specific code. There are two types of .JS files in react native application program, first one is index.android.js and second is index.ios.js file. The index.android.js file is used to write code which should run specifically in the Android device and the index.ios.js file’s code should run into iOS devices.

Sometimes we need to use platform specific components in android and ios application, in order to use platform specific components in mobile device first we need to identify whether device is android or ios.

<a href="https://www.skptricks.com/2018/12/react-native-detect-device-is-android-or-ios.html" >React Native Detect Device Is Android Or IOS </a>



<img src="https://3.bp.blogspot.com/-MiEHHfyAtS0/XAzuuzQvjYI/AAAAAAAACPY/v7JVsz5dowMNjvE75trlAB96YG0GoC4lgCLcBGAs/s640/device.png" />
Live Preview Blog Edits
Tags: hotreloading, blog, react
Published: 2018-12-15 06:19:31

---
title: Live Preview Blog Edits
published: true
description: Adding live preview of changes when I'm writing the blog.
tags: #hotreloading #blog #react
series: my_blog
---

# Live Preview Blog Edits

_This is 2nd post in continuation to my major project on this [blog](https://blog.zeerorg.site)._

The original requirements didn't consider live preview as an option. Seems like I was wrong, the live preview would help me see the current changes inside the window. This also gives me the flexibility to see my changes and gives me more confidence in what I'm writing. A lot of these changes are not compatible with what I see in my editor markdown preview because I'm using a custom CSS for posts.

Adding live preview involves changes in the frontend and a test backend. One option I considered was:

**Uploading directly to Azure storage.** This would be great since I won't have to change much in the backend and could leverage what I've built till now. But life ain't that easy, uploading to the backend takes some time and the azure blob trigger can take up to 10 minutes to run 😲!! This solution was obviously not viable, I cannot escape this ordeal easily.

## Test Backend

I reluctantly start with building a backend. The good part is that laying out a simple blog architecture makes this process much easier. If I could find a way to provide the current draft as an input to the frontend I could preview the changes in my local machine. This proved to be a relatively easy problem to tackle.

For the backend, I run an HTTP based file server to emulate my blob storage use. I use nodejs-based [http-server](https://www.npmjs.com/package/http-server "Http server npm page").

For the frontend, I check if the `process.env.NODE_ENV` environment is set to `"development"` and point to the local server.

## Building markdown on change

My azure function backend uses [Markdig](https://github.com/lunet-io/markdig "Markdig github page") to compile markdown to HTML. I have a test project from few days before, that used Markdig to compile markdown, I picked it up to repurpose it for building the markdown files on change. I implemented a simple file watcher and compiled the files that changed to markdown. I'll link down the code.

## What I learned

C# [FileSystemWatcher](https://docs.microsoft.com/en-us/dotnet/api/system.io.filesystemwatcher?view=netcore-2.1 "C# file system watcher api") was pretty easy to implement. I also learned about the `process.env.NODE_ENV` variable in React.

## Code links

* [Blog Posts](https://github.com/zeerorg/BlogPosts/tree/master/src "Github page for blog posts")
* [Markdown file watcher and compiler](https://github.com/zeerorg/BlogPosts/tree/master/MarkdownCheck "Github link to markdown compiler")
* [React Frontend](https://github.com/zeerorg/BlogSite "Frontend written in react")
Git saves snapshots, well not really 
Tags: git
Published: 2018-12-15 06:04:55

---
title: Git saves snapshots, well not really 
published: true
description: 
tags: git
---

I've seen a couple articles to try and explain git as a system of snapshots rather than changes. I'm really not sure how this explanation is supposed to help when working with git. Especially since git doesn't always save entire blobs, using an assortment of partial file diffs to save space.

Git is also really good at moving changes not just blobs from one place to another.

So maybe someone can explain why I would want to use snapshots to explain git.
AoC Day 15: Beverage Bandits
Tags: adventofcode, discuss
Published: 2018-12-15 05:33:39

---
title: "AoC Day 15: Beverage Bandits"
published: true
description: "Day 15: In which we simulate a complete Elf-Goblin battle."
cover_image: https://thepracticaldev.s3.amazonaws.com/i/qrhi3m8manhv8hzta3t5.png
tags: adventofcode, discuss
series: Advent of Code 
---

Ho ho ho holy cow.  [Day 15](https://adventofcode.com/2018/day/15) is a doozy.  The elves and goblins are having a battle, and your code is in charge of everything: the decision-making, the path-finding, the moving, the attacking, the HP and more.

Happy war-gaming!

![War Games movie screenshot](https://media.giphy.com/media/RN6sYUh5VIYlG/giphy.gif)
Juggling between projects. How do you manage it?
Tags: discuss, project, management, developers
Published: 2018-12-15 04:48:43

---
title: Juggling between projects. How do you manage it?
published: true
tags: discuss #project #management #developers
---

Juggling between different projects keeps the mind heavily occupied and how do you people manage both time and the projects?

It would be nice if you state about the number of projects you are working on simultaneously.
YOU ALL ARE INVITED !!
Tags: beginners, discuss, help, dev
Published: 2018-12-15 03:48:48

---
title: YOU ALL ARE INVITED !!
published: true
description: A normal discussion.
tags: #beginner #discuss #help #dev
---
<img src="https://thepracticaldev.s3.amazonaws.com/i/mpfbum1qmqbxr80mww27.jpg"><br/>
<br/>


Hello there!!! Hope you are doing great!!

Generally on different websites like Quora , Stackoverflow or in different communities you had seen that a very common question i.e. "Which programming language I have to choose or to start coding??" Or "How to improve my coding skill ?"etc. etc. 

<img src="https://thepracticaldev.s3.amazonaws.com/i/0ghidvuiehfze5q0ko0s.png">

Means it shows they have a lot of confusions inside. In my point of view I think they have lack of confidence inside some where and a blur image about and have worries in mind which directly or indirectly effect their future and in some case depression. 
<img src="https://thepracticaldev.s3.amazonaws.com/i/9nbxucbfnj4c1gyd2iim.jpg">

So here in this one if you are a beginner then comment below what is your doubt related to coding like you choose this path or make a plan is right or wrong or what you have to do if think coding is difficult for you then in which branch of CS you have to go to secure you future . If you have any type of confusion without any hesitation comment below we will try to solve or try to show the right path.

<img src="https://thepracticaldev.s3.amazonaws.com/i/5wqlf4a7sq4mtwzzrj5t.png">

Now if you are a <strong>experienced programmer or developer </strong> then please <strong>share your journey</strong> <strong>how did you tackle or face the problem </strong>came during learning programming and how it change you and answer the comment/query below if you see any question is no one answered. 

<img src="https://thepracticaldev.s3.amazonaws.com/i/bll5ah0mk07zf8lumrfg.jpg">

Hope in this way it will motivate and will get a great and crystal clear future and also it'll motivate them.

See you guys in discussion . 

<img src="https://thepracticaldev.s3.amazonaws.com/i/tvmt2zzmeqd4dle1e1hs.png">

Thank you for reading.

Happy coding and Happy learning !!
Tomtit - Makefile alike task runner written on Perl6 with dozens of plugins
Tags: cli, perl6, make, linux
Published: 2018-12-14 23:17:28

---
title: Tomtit - Makefile alike task runner written on Perl6 with dozens of plugins
published: true
description: Announce of new command line tool for task automation
tags: cli, Perl6, make, linux
---

![tomtit example](https://thepracticaldev.s3.amazonaws.com/i/z1zioh9aiiapk0iexs23.png)

Try out [Tomtit](https://github.com/melezhik/tomtit) - Makefile alike tool to automate routine command line tasks. It comes with a bunch of plugins.
React Router - How to pass History object to a component
Tags: react, javascript, router, history
Published: 2018-12-14 21:24:09

---
title: React Router - How to pass History object to a component
published: true
description: 
tags: react, javascript, router, history
cover_image: https://thepracticaldev.s3.amazonaws.com/i/4a7vysbjisnp5ffdz1cg.jpg
---

I was in a middle of a project, and I didn't used React for a while. I had to solve the situation: I had got a component, which was embeded deeply in a Route component (this Route was under a Browser Router component). I needed to use history object from the Router history. I started to remember my bad adventures with old React Router and circumstantial history manipulation.

So, I was in a bad mood, when I opened the official documentation. It was a big surprise when I could solve my task in 3 minutes.

There is a magical higher-order component, that name is **withRouter**. It takes place in the [react-router-dom](https://www.npmjs.com/package/react-router-dom) package also. With its help, you can pass the whole history object to your component as properties. They contains several useful data about routing.

````javascript
import React, { PureComponent } from 'react';
import { withRouter } from 'react-router-dom';

class PassToMeMyRouterHistory extends PureComponent {

  redirectToHome = () => {
   const { history } = this.props;
   if(history) history.push('/home');
  }

  render() {
    const { history } = this.props;

    return(
      (history)
      ?
        <div onClick={this.redirectToHome}>You can go to Home 🥳</div>
      :
        <div>Oh, we did not get pathname! 🤔</div>
    );
  }

}

export default withRouter(PassToMeMyRouterHistory);

```
As you can see above, after we let the *withRouter* component to do its job, we can easily reach the necessary data and functions in connection with history. The history object has several property, you can check it in the [documentation](https://reacttraining.com/react-router/web/api/history).

Ps.: You need to handle the re-render logic in your component when you need this action, in case of location change. *withRouter* gives you the props but doesn't subscribe for the changes!
Hi, I'm Navie!
Tags: intro, introduction, helloworld
Published: 2018-12-14 19:00:23

---
title: Hi, I'm Navie!
published: true
description: 
tags: #intro #introduction #helloworld
---

Hello, world!

I'm Navie Narula and I recently graduated from Columbia University, where I studied computer science and journalism. I'm interested in language analysis, data education, and technical writing. If you have any cool opportunities in these areas, I'd love to hear about them! :)

I also love:

- attending hackathons (I've been to over 30, I think)
- teaching (currently advising at Codecademy)
- coffee (that speaks for itself)

I'm excited to be here on DEV and look forward to contributing here!