teleren/devto huggingface dataset:
Writing ES6 in your Node.js Applications
Tags: javascript, es2015, babel, node
Published: 2018-08-27 09:53:26

---
title: Writing ES6 in your Node.js Applications
published: true
description: How to write ES6 code in your node applications.
tags: javascript, es2015, babel, node.js
---

ES6 (ECMAScript 2015) is the latest stable version of JavaScript. It includes new language syntaxes and implementations for the language. Three years later implementation of these new features in JavaScript engines is still ongoing but you'd still like to write your code in ES6 because who wants to stay behind in this industry.
We'd be using [Babel](https://babeljs.io/) here to convert our ES6 code that can be understood by the existing Javascript engines. Babel is a compiler that allows us to write ES6 features in JavaScript and run it in the older/existing engines.
How to set up Babel with your Node.js App

* You should have the latest node.js installed and running on your machine.
* Create a new project or run and move to this directory ```$   mkdir new_project
  $   cd new_project```
* Create a file `app.js` and write some ES6 code in there ```import request from 'requests';
let helloWorld = 'Hello World!`;
console.log(`${helloWorld} this is some ES6 JavaScript code`);```
* Create a `package.json` file by running `npm init` . Enter the required details or press return for fields you do not recognise. At this point your `package.json` should look like this
        ```{
              "name": "es6project",
              "version": "1.0.0",
              "description": "using babel with node",
              "main": "app.js",
              "scripts": {
                "test": "echo \"Error: no test specified\" && exit 1"
              },
              "author": "",
              "license": "ISC"
        }```
* Install babel and babel preset as a dev dependency
    ```$   npm install -D babel-cli
    $   npm install -D babel-preset-es2015```

* Babel uses different [plugins](https://babeljs.io/docs/en/plugins/) to enable different features. In our case we can use the es2015 plugin. We will need to create a `.babelrc` configuration file.
    ```$   touch .babelrc```
and paste the following in the file
    ```{
      "presets": ["es2015"]
       }```
* Create an npm build command to compile your ES6 Javascript. Modify your `package.json` with 
    ```"scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "build": "babel --presets es2015 -d lib/ src"
}```
this compiles all of your ES6 code in the src directory to the lib directory.
You should see your code compiled in the lib directory and now you are good to go and run this.This code is present in the this Github [repository](https://github.com/nendhruv/es6_with_babel).


This post was originally published on [medium](https://medium.com/@nendhruv/writing-es6-in-your-node-js-applications-8aba8170761d)
Couple Code Therapy
Tags: discuss, beginners
Published: 2018-08-27 09:34:01

---
title: Couple Code Therapy
published: true
tags: 
    - discuss
    - beginners
---

I wanted to share with you a project that I am working on with my partner
It’s called Couple Code Therapy, a new twist on teaching web development for an absolute beginner, where I teach my wife how to update her own website.

Episode 3 is coming this Wednesday.

Any feedback is welcome

website: https://couplecodetherapy.com/
Itunes: https://itunes.apple.com/de/podcast/couple-code-therapy/id1419785443?mt=2
Spotify: https://open.spotify.com/show/1kKWGqKj41otz3V4b4TNOv?si=7-_SkScwSOegbUksdm0U9A
CSS Selectors in Selenium WebDriver with Examples
Tags: selenium, webdriver, java, automation
Published: 2018-08-27 09:27:31

---
title: CSS Selectors in Selenium WebDriver with Examples
published: true
description: CSS Selectors in Selenium WebDriver with Examples
tags: #selenium #webdriver #java #automation
---

Post Link : <a href="https://www.skptricks.com/2018/04/css-selectors-in-selenium-webdriver-with-example.html"> CSS Selectors in Selenium WebDriver with Examples </a>

CSS Selector is the combination of an element selector and a selector value which identifies the web element within a web page. The composite of element selector and selector value is known as Selector Pattern. Selector Pattern is constructed using HTML tags, attributes and their values. The central theme behind the procedure to create CSS Selector and Xpath are very much similar underlying the only difference in their construction protocol.

<img src="https://1.bp.blogspot.com/-FG7qr5LzZ3E/WsLpGE_XS0I/AAAAAAAABew/Wo8leGFelug2lR6HbchOtbz4Sli2Zks8QCLcBGAs/s400/css%2Bselectors.jpg" />


In this post we are going to discuss <a href="https://www.skptricks.com/2018/04/css-selectors-in-selenium-webdriver-with-example.html">how to use css selector in selenium WebDriver java</a>. Most of the automation testers believe that using CSS selectors makes the execution of script faster compared to XPath locator. CSS Selector locator is always the best way to locate elements on the page. CSS is always same irrespective of browsers.


To learn more about CSS Sector, do visit the below page :
https://www.w3schools.com/cssref/css_selectors.asp

Some benefits of using CSS Selectors :
CSS Selector is faster (especially in IE).
CSS Selector more readable.
In terms of performance, CSS perform well as compared to XPATH.
NOTE : While selecting an element make sure that element should be unique, descriptive and unlikely to change.

Syntax for CSS Selector in selenium WebDriver : 
driver.findElement(By.cssSelector("input[class='username']")).sendKeys("skptricks-3"); 
To identify the web element using css selector, we need to call cssSelector() method.

Check out below web page link, we are going to use this link for CSS Selector demonstration : 
DEMO LINK :
https://skptricks.github.io/learncoding/selenium-demo/login%20registration%20page/Register.html

<a href="https://www.skptricks.com/2018/04/css-selectors-in-selenium-webdriver-with-example.html">Read more... </a>
Tips for new front-end developers ( vlog )
Tags: html, css, javascript, frontend
Published: 2018-08-27 08:29:20

---
title: Tips for new front-end developers ( vlog )
published: true
description: 
tags: html, css, javascript, front-end
---

https://youtu.be/kLtNmhbmBIw

I just published some tips on YouTube for new front-end developers! 

I’m sorry for that wind noise. I've added subtitles when the wind is hitting hard. I’ll make sure to get a wind muff for future vlogs.
Security holes in PHP
Tags: joke, discuss, php, security
Published: 2018-08-27 08:24:29

---
title: Security holes in PHP
published: true
description: What is your most annoying vulnerability in PHP?
tags: joke, discuss, php, security
---

![Security holes in php](https://thepracticaldev.s3.amazonaws.com/i/a6pj28t0nvc24ru1suyw.jpg)

What is your most annoying vulnerability in PHP?
Method Chaining In Java
Tags: java, methodchaining, corejava
Published: 2018-08-27 05:27:52

---
title: Method Chaining In Java
published: true
description: Method Chaining In Java 
tags: #java #methodchaining #corejava
---

Post Link : https://www.skptricks.com/2018/08/method-chaining-in-java.html

The term method chaining refers to both a design and a convention. Each method returns an object, allowing the calls to be chained together in a single statement. Chaining is syntactic sugar which eliminates the need for intermediate variables. A method chain is also known as a train wreck due to the increase in the number of methods that come one after another in the same line that occurs as more methods are chained together even though line breaks are often added between methods.

<img src ="https://3.bp.blogspot.com/-gt6lGPNtdJI/W4OIOz9kntI/AAAAAAAAB1c/9ze1u9CiyjolRVdqCf_mnjDJFcI4djp-wCLcBGAs/s400/me.jpg" />


class User {
 
private String name;
private int age;

// In addition to having the side-effect of setting the attributes in question,
// the setters return "this" (the current Person object) to allow for further chained method calls.

public User setName(String name) {
    this.name = name;
    return this;
}

public User setAge(int age) {
    this.age = age;
    return this;
}

public void getUserDetails() {
    System.out.println("User name is " + name + " and " + age + " years old.");
}

// Usage:
public static void main(String[] args) {
 User user= new User();   
    user.setName("skptricks").setAge(22).getUserDetails();
}
}

Ouput :
User name is skptricks and 22 years old.
Simple Mathematics With Python
Tags: python, beginners, programming
Published: 2018-08-27 07:28:31

---
title: Simple Mathematics With Python
published: true
description: learning simple mathematics with Python
tags: python , beginners , programming
cover_image:  https://palash.tk/assets/images/abacus.png
---


**The Reason we Code is to solve Problems**

![.](https://www.elegantthemes.com/blog/wp-content/uploads/2017/07/programming-languages-to-learn-for-wordpress-featured-image.png)



[Programming](https://en.m.wikipedia.org/wiki/Computer_programming) is not all about Mathematics, it's about solving problems we face in our daily life, and doing so we sometimes need Mathematics.

![](http://www.progressiveteacher.in/wp-content/uploads/2016/07/002-581x252.jpg)

So let's do some simple Mathematics with [Python](https://python.org), we've chosen Python because it's easy to learn and has a clear syntax.

> I recommend reading my previous article about starting with python <https://palash.tk/Simple-Introduction-To-Python-Programming>, read that before going further if you're new to Programming or Python

So let's start..

## Start Python

If you've python installed locally run [IDLE](https://en.m.wikipedia.org/wiki/IDLE) otherwise use online interpreter like [Repl.It](https://repl.it/languages/python3)

If You've Opened IDLE or Other [REPL](https://en.m.wikipedia.org/wiki/Read–eval–print_loop) you'll see a prompt like this,

`>>>`

If you're using  [Repl.It](https://repl.it/languages/python3), on the right pan you'll also see a prompt like 

`>`

_If nothing wrong happened, goto the next chapter.
If you find any problems please comment below the article, I'll surely help you_

## Simple Calculations With Python 👀

If you've successfully completed the previous chapter, now you have a `>>>`  or `>` prompt on your screen.

In the `>>>` type `1+2` and press enter. If you've done everything correctly you'll see a output of `3`

Try other,

- Addition ,
    `>>> 1 + 30 + 2`
    You'll get 33 


- Subtraction,
    `>>> 9-8`
    You'll get 1


- Multiplication ,
    `>>> 9 * 11`
    You'll get 99


- Division ,
    `>>> 444/2`
    You'll get 222.0

### Let's Do a Complex Calculation ✊

`(123456789 + 987654321) * 8`

Looking for the answer?

I'll not tell you, find Yourself using Python 😉 if you're able to find it , comment your answer below in the comment box 👇. 

That's the fun of Programming 😁


---
### Hey Guys I have a kind request, please follow me on twitter [@bauripalash](https://twitter.com/bauripalash) , I feel very lonely there 😢

---
That's it for now friends , see you next time. Till then let me know your thoughts, suggestions and questions in the comments below 👇

---
If You Like My Work (My Articles, Stories, Softwares, Researches and many more) Consider [Buying Me A Coffee ☕](https://www.buymeacoffee.com/palash) 🤗
Ionic angular src vs [src]
Tags: ionicangular
Published: 2018-08-27 07:08:39

---
title: Ionic angular src vs [src]
published: true
description:  Difference between angluar [src] and src on image tages
tags: ionic angular
---

Straight to the point, src will not cache your images [src] will cache your images. So if you want to load image resources from server and use them when the device is offline, use [src]="your url goes here" instead of src="your url goes here".
Simple Form Validation In JQuery Using Regular Expression
Tags: regularexpression, regx, formvaldation, jquery
Published: 2018-08-27 06:51:21

---
title: Simple Form Validation In JQuery Using Regular Expression
published: true
description: Simple Form Validation In JQuery Using Regular Expression
tags: #regularexpression #regx  #formvaldation #jquery
---

Post Link : https://www.skptricks.com/2018/01/simple-form-validation-in-jquery-using-regular-expression.html

In this tutorial we are going to share some idea how to validate simple form using Jquery with the help of regular expression. As we know a regular expression is a special sequence of characters that helps you match or find other strings or sets of strings, using a specialized syntax held in a pattern.

Here we have created user registration form with the help of html and performing form validation using Jquery with the help of regular expression. We have covered below validation :
1. Username validation using regular expression.
2. Email Id Validation using regular expression.
3. Mobile Number Validation using regular expression.
4. Website URL Validation using regular expression.
5. Password Validation using regular expression.

In Case you want to build more understanding on Regular Expression Validation, Check out our blog archive below :

Build Basic Understanding About Regular Expression.
User Defined Function to validate Regular Expression

<img src="https://3.bp.blogspot.com/-pG6qCcVn12s/WmMRQFYbjsI/AAAAAAAABMc/d6aJYKTqpRAJU-f4zuMKl2H0Ix2ebyCzACLcBGAs/s400/save.PNG" />


{% youtube dxECdlwvBhLE %}


<a href="https://www.skptricks.com/2018/01/simple-form-validation-in-jquery-using-regular-expression.html" > READ MORE... </a>
How do dev.to make money?
Tags: discuss, money
Published: 2018-08-27 06:24:47

---
title: How do dev.to make money?
published: true
description: 
tags: #discuss #money
---

* [Membership](https://dev.to/membership)
* [Shop](https://shop.dev.to/)
* [Sponsorship](https://dev.to/sponsors)
Wordpress Installation: Error establishing a database connection
Tags: wordpress, help, webdev, beginners
Published: 2018-08-27 04:57:49

---
title: "Wordpress Installation: Error establishing a database connection"
published: true
tags: wordpress, help, webdev, beginner
---

Hi Dev's, I need some help.

I have a Digital Ocean droplet, and I was trying to install WordPress on my domain, but I am getting an error message that "Error establishing a database connection".

The tutorial I'm following [How To Install WordPress with LAMP on Ubuntu 16.04](https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-with-lamp-on-ubuntu-16-04)

Not sure what I have done wrong. Any ideas would be helpful.
What do you wish you were better at?
Tags: discuss, mentorship, career
Published: 2018-08-27 04:31:38

---
title: What do you wish you were better at?
published: true
tags: discuss, mentorship, career
canonical_url: https://www.iamdeveloper.com/posts/what-do-you-wish-you-were-better-at-4ak9/
cover_image: https://thepracticaldev.s3.amazonaws.com/i/tegc5w5d9i1ul82iwseh.gif
---

I'm sure all of us wish we were better at certain things regardless of where we are in our careers. What do you wish you knew better? Post your answers in the comments.

Some people new to the platform may not be aware, but there is a mentorship program that you can [sign up for](https://dev.to/settings/mentorship). You can be a mentor, a mentee or both.

{%link https://dev.to/devteam/changelog-mentor-matchmaking-3bl0 %}

I'm new to Ruby, so I'm going to be requesting a Ruby mentor.

{%link https://dev.to/nickytonline/what-arewere-your-go-to-resources-for-learning-ruby-and-rails-5611 %}

What about you?
Enterprise Application?
Tags: discuss
Published: 2018-08-27 03:57:21

---
title: Enterprise Application?
published: true
description: 
tags: #discuss
---

I have been working at enterprise application for these years. Actually I do not what application could be called as enterprise application. 

Thanks a lot for all comments. You let me know the general idea of enterprise application.

# Enterprise Application

Enterprise Application is generally a System which widely used within an enterprise for business flow. It involve the effort of many people in the corporate in order to produce the applicaion. The enterprise should help solve problem and create productivity for big team. 

Current enterprise context make the enterprise application extremely complicated. Generally, the non-functional requirement include the below.

* Security
* Scalable
* Distributed
* Mission Critical
* Administration Efficient
* Maintenance Efficient
* Integrated with third-party application 

*We generally agree enterprise application as a complicated application which should be essential and critical to an enterprise. However many enterprise would like to outsource their application development to third party company. Why?*
What is the most influential programming language you have learned?
Tags: discuss
Published: 2018-08-27 03:52:06

---
title: What is the most influential programming language you have learned?
published: True
description: 
tags: discuss
---

I say "learned" here because we don't always use every language we learn. But, what is the most influential languages you have learned? Why was it influential? Is it the language you currently use? If no why not?

For me this has kinda been in 2 stages. First when I was new I started with PHP. and after knowing it and using it in a job for some time, i started learning C# on the job and helped with it. It was eye opening. Mostly because I learned more about how languages like PHP worked "under the hood". It was like a cover was lifted. But to this day, I never really took use to it full time or for my own uses.

Other than that, so far I would have to say the most influential language for me was learning Erlang. By this time I used PHP for a long time. I had toyed with python and used javascript. Looked at others. But Erlang was such a different paradigm (functional) I feel like it made me a better developer since it made me think of problems in such a different way. Find simple cases and work out from there one step at a time. Recursion, and more. Currently I don't use it though as when I learned it, it felt like there was very little people using it and Elixer had not been around very long. 

After that, I started playing with python a lot more which is mostly what I use today along with PHP.
who need unit test in their open source project?
Tags: opensource, contrib, newbie, discuss
Published: 2018-08-27 01:14:47

---
title: who need unit test in their open source project?
published: true
description: i need to practice testing in java and js. And i want to start contributing to community
tags: #opensource #contrib #newbie #discuss
---
i need to practice unit testing in java and js. And i want to start contributing to community
Change the time zone on a Heroku app
Tags: heroku, deploy, timezone, cloud
Published: 2018-08-27 00:49:21

---
title: Change the time zone on a Heroku app
published: true
description: How to change the timezone on a Heroku app to avoid date related bugs.
tags: heroku, deploy, timezone, cloud
cover_image: https://i.imgur.com/XdYJzFJ.png
---

I discovered [Heroku](http://heroku.com) a few weeks ago. It's a great platform to deploy your apps, specially because of their Free plan which I've been using as dev env to work with my team remotely.

Lately I started working on a new project. On this particular project I rely on **dates** for most of the main operations. The app has a front-end built with Angular 5, and a back-end built with Node.js

Everything was working perfectly on my local environment, but when I deployed to Heroku all the date operations started to behave kind of random (spoilers: it wasn't random at all).

Well, here's the thing. I'm from Argentina, and I had the front-end deployed on a local server, but the back-end was on Heroku and the default region for new heroku apps is "us". So basically my front-end and back-end were on **different time zones**. 

This is not the first time I deal with this kind of date issues (there aren't many local cloud services in my region) so I found the source of the problem almost immediately, and I wanted to share it with you in case you encounter a similar issue.

Luckily Heroku let's us change the timezone of our app simply by adding a new config var. 

##From the Heroku CLI
1. Open the command shell
2. Login to heroku
3. Navigate to your app's directory
4. Setup your TZ

```shell
heroku config:add TZ="America/Argentina/Buenos_Aires"
```

##From the Heroku dashboard (web)
1. Login into the Heroku dashboard from a browser
2. Navigate to the app
3. Click over the Settings tab
4. Press the "Reveal Config Vars" button
5. Set the key to "TZ" and the value to your timezone (E.g.: America/Argentina/Buenos_Aires)
6. Press the Add button


##How do I know which is the correct TZ value
Follow this [link](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) to see the complete list of time zones

##Check the new TZ value
Use the following command to check the value of the new config var from Heroku CLI:
```shell
heroku config:get TZ
```

###For more info about Heroku
[What is Heroku?](https://www.heroku.com/what)

###For more info about Heroku's Config Vars
[Configuration and Config vars](https://devcenter.heroku.com/articles/config-vars)
Python GraphQL client requests example using gql
Tags: python, graphql, webdev, graphqlclient
Published: 2018-08-27 12:53:59

---
title: Python GraphQL client requests example using gql
published: true
tags: python, GraphQL, webdev, graphql-client
canonical_url: https://codewithhugo.com/python-graphql-client-requests-example-using-gql/
---

> An example consuming a GraphQL API from Python using gql.

Full code example at [HugoDF/python-graphql-client-example](https://github.com/HugoDF/python-graphql-client-example).

> This was sent out on the [Code with Hugo newsletter](https://buttondown.email/hugo) last Monday.[Subscribe](https://buttondown.email/hugo) to get the latest posts right in your inbox (before anyone else).

```sh
$ pip install gql # You should use a virtualenv
```


```python
from gql import gql, Client
from gql.transport.requests import RequestsHTTPTransport

_transport = RequestsHTTPTransport(
    url='https://graphql-pokemon.now.sh/',
    use_json=True,
)

client = Client(
    transport=_transport,
    fetch_schema_from_transport=True,
)
query = gql("""
{
    pokemon(name: "Pikachu") {
        attacks {
            special {
                name
            }
        }
    }
}
""")

print(client.execute(query))
```

```sh
$ python fetch.py
{'pokemon': {'attacks': {'special': [{'name': 'Discharge'}, {'name': 'Thunder'}, {'name': 'Thunderbolt'}]}}}
```

[Isis França](https://unsplash.com/@isisf?utm_medium=referral&utm_campaign=photographer-credit&utm_content=creditBadge "Download free do whatever you want high-resolution photos from Isis França")