teleren/devto huggingface dataset:
HTTPS server with NojeJS
Tags: https, node, webhook, messenger
Published: 2018-09-05 23:48:05

---
title: HTTPS server with NojeJS
published: true
description: Writing my webhook and messenger bot over HTTPS
tags: https, nodejs, webhook, messenger
---

Hi :D 

This week I write a little bot for messenger ( Facebook chat). I have not had fb for some years.

I re-discover the facebook social network and join in developer.facebook.com, the documentation in this site is big confused.

well...

You need run your webhook over HTTPS server, and Facebook check your certs; if you run nodejs over local https; with self-generated certificates Facebook says: "..." I don't remember xD, but Facebook don't accept your "insecure" connection with your self-generated certificates with openssl.

I try install my self-generated certificates with openssl, and not found :(


But!.. in my post {% link https://dev.to/ab0nilla/install-ssl-certificate-with-certbot-in-centos-7-47b2 %} I use "certbot" and in this project I used an online service: zerossl.com they also use let's Encrypt.


Go to Zerossl.com and get your certificates, search the "Service FAQ" and "How-To Videos" in the website and get yours CA, CERT and Key archives.

Copy your download files in your workspace folder.
 
Ok, you have your files, generated in zerossl.com, now write the daily code for simple NodeJS; and add this require.

```javascript
var https = require("https");]
```

add your download files (the zerossl.com certificates)

```javascript
const options = {
  key: fs.readFileSync("/dir/key.key"),
  cert: fs.readFileSync("/dir/crt.crt"),
  ca: fs.readFileSync("/dir/ca.ca"),
}; 
```

Finally replace your  
```javascript
app.listen(3000); 
```
for this:
```javascript
https.createServer(options, app).listen(port,console.log("webhookk listen")).
```

Complete example:

```javascript
'use strict';

THE REQUIRES AND process.env.PORT AND BLAH BLAH cons and other magic trick

var https = require("https");
var  fs = require("fs");

const options = {
  key: fs.readFileSync("YOURDIR/key.key"),
  cert: fs.readFileSync("YOURDIR/crt.crt"),
  ca: fs.readFileSync("YOURDIR/ca.ca"),
};

app.post('/webhook', (req, res) => {  
 yourcode
});


app.get('/webhook', (req, res) => {
   yourcode
  });

function handleMessage(sender_psid, received_message) {
   yourcode
}

function handlePostback(sender_psid, received_postback) {
  yourcode
  callSendAPI(sender_psid, response);
}

function callSendAPI(sender_psid, response) {
  yourcode
}
https.createServer(options, app).listen(port,console.log("webhookk listen"));

```
Now, Facebook accept your secure connection :D

*remember that the certificates expire, you must renew them.*

*remember 2: Https use the port 443, configure your firewall and move your others server (apache , nginx).*
🐬 Swag for Dev #4 — DigitalOcean’s Sammy stickers!
Tags: programming, beginners, opensource, tips
Published: 2018-09-05 22:43:04

---
title: 🐬 Swag for Dev #4 — DigitalOcean’s Sammy stickers!
published: true
description: 😎👕🧦 Keep yourself updated with the latest swag opportunities for developers!
tags: programming,beginners,opensource,tips
canonical_url: https://medium.com/swag-for-dev/swag-for-dev-4-digitaloceans-sammy-stickers-45bada4f92b8
---
As a developer, nothing piques my interest more than developer swag! Continuing my attempt to list down the current swag opportunities for developers, here’s the latest update:

Currents is back! Take DigitalOcean’s survey on Open Source and get free Sammy stickers! [do.co/currents-survey](http://do.co/currents-survey)

![](https://pbs.twimg.com/media/ClLKoRDWEAAvgqK.jpg)

To get these updates in your inbox, subscribe to our newsletter: [https://upscri.be/67d2fa](https://upscri.be/67d2fa)

You can find the complete list on GitHub: [https://github.com/swapagarwal/swag-for-dev](https://github.com/swapagarwal/swag-for-dev)
keyword definitions of oops(php)
Tags: phpoops
Published: 2018-09-05 22:33:07

---
title: keyword definitions of oops(php)
published: true
description: Definition of oops keywords in php
tags: #php oops
---

**Class** -  A class is a user defined data type which has methods and properties. 
**Object** - A object is a instance of a class, Once we define a class we can make many objects or instances.
**Methods** -     A function inside a class is called as methods 
**Properties**  -  A variable inside a class is called as properties or also called as member variables.
**Inheritance** - The process of inheriting properties and methods from a base class or parent class is called Inheritance. The class that has inherited all the methods and properties is called as child class or derived class. 
**Constructor** - Special type of function which is automatically called whenever object is formed.  
**Destructor** - Special type of function which is automatically called whenever object is formed. The constructor and destructor are also called as magic methods. 
**Private** - A private member can be used only inside a class in which it has been declared. Private members cannot be used inside the inherited classes. 
**Protected** - Protected members can be used inside the same class and class that inherits the parent class. 
**Constant** - The constants are immutable , once it is declared it cannot be changed. It is declared using a keyword const.
**Abstract classes** - These classes cannot be instantiated instead it can be inherited. 
**$this** - To access a property inside a class $this keyword is used.
**Static** -  Static methods and properties can be accessed without instantiating a class
**::** - It is scope resolution operator used to access the static , constant and overridden properties and methods of a class
Vim won't make you a more productive developer
Tags: healthydebate, vim, editors, productivity
Published: 2018-09-05 21:54:06

---
title: Vim won't make you a more productive developer
published: true
description: A case against Vim
tags: healthydebate, vim, editors, productivity
---

*Disclaimer: I am playing devil’s advocate. I do believe Vim makes me more efficient with some trade-off, YMMV.*

We, as developers, spend a lot of our time on our text editor of choice. Choosing to use Vim, in my opinion, ultimately won't make a huge difference with any other editor. The majority of modern editors are more than capable to handle the task at hand and are much easier to get started with. 

You want to use Vim? Sure. After you are vaguely familiar with it, you will dive deep into Vim's ecosystem and soon learn about the variety of flavors Vim comes in and the many ways to manage plugins and configuration. Suddenly need to code in Java? well darn, you'll need to expand your code completion, syntax highlighting, and add additional functions like compilation.

And after going through all of that, would you argue that you emerged out of it a stronger better developer? Or would you say it was all but a distraction and the time spent there could've been spent on coding and learning about other facets of programming? 

I use Vim daily and I love it, but it's kind of difficult for me to recommend it because it truly is a time-sink. What the folks rave about is more about Vim-navigation and not Vim itself, and that is easily solved with Vim-mode, which is available in most editors.

![](https://www.vim.org/images/vim_superman.jpg)
<figcaption>whatever this is </figcaption>

So, what's your stance on the general push for vim?
JavaScript and manipulating the DOM
Tags: help, html, javascript, css
Published: 2018-09-05 21:27:55

---
title: JavaScript and manipulating the DOM
published: true
tags: help, HTML, JavaScript, CSS
---
This may sound like a silly question but I'm going to ask anyway because it's almost affecting my learning ability. :) 

Why do we use JavaScript to change HTML and CSS elements in a webpage when we can just do that in HTML and CSS? As I'm learning JavaScript and changing elements in the DOM I'm asking myself why... why would you want to randomly change text color?

My idea is that they're event based changes and more for the interaction between user and webpage? Like in an image carousel, clicking the arrows would slide in a new image.. am I on the right track with understanding?
I've been at this a long time and I have nothing to show for it.
Tags: culture, help, career, webdev
Published: 2018-09-05 20:48:42

---
title: I've been at this a long time and I have nothing to show for it.
published: true
description: I’m a father, husband and professional web developer. I honestly feel this way sometimes and I bet some of you do as well. 
tags: culture, help, career, webdev
cover_image: https://thepracticaldev.s3.amazonaws.com/i/jnzcp1h6d70lq4rswz7b.jpg
---



Except a good job with great benefits, 12+ years of professional experience and all the knowledge and skills that came with that experience. I’ve also worked with some great people, my peers respect my professional opinion and I can even call some lifelong friends. I’ve been at this a long time and it’s not that I don’t have anything to show for it (as stated above) I just don’t have what I wish I could show for it. I don’t have an app, I don’t have a popular blog, I don’t have an active community or large email list and that’s ok. I’m ok. I enjoy what I do and I get paid to do it, I’m more than ok - I’m one of the lucky ones. 

My name is Fernando Blanco but most people call me Nando. I’m a father, husband and professional web developer. Although the title’s a bit clickbaity, I honestly feel that way sometimes and I bet some of you do as well. It’s hard not to want to release something when it feels like everyone and their mother has a service, framework and/or library. It’s easy to feel inadequate because you’re not using the latest web technology that happens to be the focus of every article in your feed. I understand! The dev world moves so fast you can easily feel left behind by enjoying a weekend without your phone. 

I've been at this a long time and I DO have something to show for it.. And so do you! If you’re just starting, at minimum, you have the drive (or you wouldn’t be starting). If you’ve been at it for a couple of years, you have a project or 2 that you’re really proud of or that really challenged you to become a better developer. Career devs, we got it good: we’re in the field that we love and we get paid regularly - FANTASTIC!

If you honestly feel that you have absolutely NOTHING to show for it, not even a drive to continue… then why are you doing it? Personally, being a web developer isn’t only my profession, it’s my passion. I know it may sound a bit corny but I’m serious. I love this stuff. I used to come home after work and get right back on the computer to work on some side project or finish some work stuff that had me excited. I still would if the wife wouldn’t kill me and kids would let me. If I’m reading an article on my phone, 9/10 times its dev related. I frequently forward articles to coworkers after hours and sometimes get comments like “you know it’s after hours right?”. Yes but the article was interesting and I wanted to share! 

Anyways, I sometimes feel crappy about just developing at work and/or not coming out with something cool and useful but that's going to stop. This article is step 1 of my plan. :)
Deciding a database architecture for a Social Networking use-case? 
Tags: help, discuss, neo4j, orientdb
Published: 2018-09-05 20:42:11

---
title: Deciding a database architecture for a Social Networking use-case? 
published: true
description: 
tags: help, discuss, neo4j, orientdb
---

So I'm in the process of writing a Node-backed server, and one major part of the application is the Social Network Platform. I don't plan on using MySQL, even though it's reliable.

After some research, I stumbled upon multiple articles stating why you should use one over the other or with the other. It does make sense that using a graph database is the best option, better than a simple RDBMS/conventional NoSQL.

As of now, I've got these options with me
- MongoDB for document storage, and using `mongo-connector` in collaboration with neo4j for storing relationships, likes and stuff. Looks good to me, as some part of the application has already been developed with mongo, wouldn't have to rewrite everything.
- OrientDB as a whole package from the ground up
- Gremlin
- Apache Cassandra(No idea how this works, any help could save me some time :D)

I'll have you know that the social network relationship is but a part of other functions the application is supposed to execute, the other one being a chat interface, along with real-time mapping.

Any advice would be much appreciated!
Work Addiction | Symptoms and How to Recover?
Tags: discuss, productivity, health, advise
Published: 2018-09-05 20:41:16

---
title: Work Addiction | Symptoms and How to Recover?
published: true
description: People often justify themselves that are working great and it's better to work more but more they work, more they develop habits that make them Addicted.
tags: discuss, productivity, health, advise
cover_image : https://thepracticaldev.s3.amazonaws.com/i/23gter1psm56wip9i8vm.jpg
---


Are you addicted to work? Often find yourself working late hours in the office and continue working at home even then. 
People often justify themselves that are working great and it's better to work more but more they work, more they develop a habit in themselves that includes:

1. Staying late in the office, even not needed.
2. Distract yourself with work to reduce anxiety.
3. Over obsessed about projects and end up putting more time.
4. Love to talk about work and technology trends even in a small gathering.
5. End up putting yourself in a condition to cheer up when technology geeks are talking.
6. Work to avoid relationships and end up affecting them.
7. Told by someone to "Keep pace slow - Get a life".
8. Using mobile phones to kill time even not needed by doing nothing ( Exploring settings and more )

##Discussion & Suggestions 

What do you guys think? What should developers/managers do in order to refrain from this addiction?
Looking for a Job
Tags: help
Published: 2018-09-05 19:48:01

---
title: Looking for a Job
published: true
tags: help
---

Hi devs, I'm currently looking for a remote junior JavaScript developer job.
Here's my GitHub profile link : https://github.com/Youngestdev

I deal with NodeJS and Pure JavaScript, can also write HTML5 and a little bit of CSS3.

I'd prefer a backend job.
Jelly Fin: Badges? Yes, we have badges.
Tags: jellyfin, cicd, github, opensource
Published: 2018-09-05 18:51:00

---
title: Jelly Fin: Badges? Yes, we have badges.
published: true
description: Building a foundation
tags: jellyfin, cicd, github, oss
---

Hey Jellies!

Ok, we're trying something new here.  What do you think about being called a Jelly if you're a user? Corny?

Anyway, I wanted to touch base and let everyone know that we're building up the foundation of Jelly Fin a little at a time.  I've added badges to the README to highlight some of the groundwork on getting a build process going.

After talking with my contributors, I think we're settling on going strictly mobile-first then working in a web app in the future.  This means that we're planning on using React Native for the front end.

I use an Android and my wife uses iOS.  Which means, we will be supporting both platforms from the get-go.

I got TravisCI setup and I have another process that scans our documentation to make sure we have something good in those regards.

I've gotten a *LOT* of interest in folks wanting to contribute.  While we may not be at a place where people can jump in and code, we *are accepting opinions*.  Feel free to create a [GitHub issue on feature ideas](https://github.com/jonathan-irvin/jelly-fin/issues), help iron out details on existing features, OR if you want to help lay the groundwork, [submit a pull request](https://github.com/jonathan-irvin/jelly-fin/pulls).

Check out the repo and hit us up on Discord.

Don't forget to follow [#jellyfin](https://dev.to/t/jellyfin) for updates!

Lastly, here's a link to the project on GitHub.

{% github https://github.com/jonathan-irvin/jelly-fin %}
Why Has Extensibility Failed?
Tags: extensibility, ai, objectorientation, discuss
Published: 2018-09-05 18:19:07

---
title: Why Has Extensibility Failed?
published: true
description: Why has the promise of extensibility not lead to software development advancement, and a path toward artificial intelligence?
tags: #extensibility #AI #objectorientation #discuss
---

The promise of extensibility is that we can build levels upon levels of code starting with existing languages until we reach true artificial intelligence and then sit back and drink wine coolers while the AIs rule over us;)

Object oriented languages (and other kinds of extensibility) were supposed to make it so that we could build levels upon levels of objects. These levels would be available to everyone so that people could keep contributing levels.

I don't see this happening. Yes we have libraries, but we have no clearly defined levels to build on. I go to work every day and work with my object oriented language. Most of my time is spent writing loops and conditions and filling variables and so on. I am in the education industry and I should have an 'education level' to code from, not just language constructs. I have heard that some people have managed to get perhaps a level up, so that they work with things that were written in these languages. Still, nothing has stood out to the extent that people use such and such 'level'.

Outside of user interfaces, there is no community devoted to even one built-up level. And let's face it, as important as UI is, it isn't what the program really does. It displays things and accepts interaction, and yet it is not the core of the program. I see attempts in other areas, but little success.

On the whole, our programs still mainly just push data around, perhaps analyze it, store it, allow access to it, but not much else.

Why is this?

Why haven't we built a major well-known level, then built another major well-known level on top of that, then built another on top of that?

Where is the advancement in software development?

Why hasn't this happened?
On The Nature of OAuth2’s Scopes
Tags: oauth2, authorization, oauth, identitymanagement
Published: 2018-09-05 18:03:12

---
title: On The Nature of OAuth2’s Scopes
published: true
description: Stretching OAuth2 scopes beyond intended usage leads to trouble in complex architectures.
tags: #oauth2 #authorization #oauth #identitymanagement
canonical_url: https://auth0.com/blog/on-the-nature-of-oauth2-scopes/
---

Scopes only come into play in delegation scenarios, and always limit what an app can do on behalf of a user: a scope cannot allow an application to do more than what the user can do.

[Auth0](https://auth0.com/) Principal Architect Vittorio Bertocci on why you shouldn’t use OAuth2 scopes for every authorization scenario.

[Read on 🧙🏻‍♂️](https://auth0.com/blog/on-the-nature-of-oauth2-scopes/?utm_source=dev&utm_medium=sc&utm_campaign=oauth2_scopes)

![On The Nature of OAuth2’s Scopes](https://thepracticaldev.s3.amazonaws.com/i/c8k3li0kx4n0e79qo4sd.png)
"Parents Soundboard": Let The Smartphone Speak For You
Tags: showdev, ios, android
Published: 2018-09-05 17:45:10

---
title: "Parents Soundboard": Let The Smartphone Speak For You
published: true
description: A React Native smartphone app for parents
tags: showdev, showdev, ios, android
cover_image: https://thepracticaldev.s3.amazonaws.com/i/61xycqjbnhq2lzilwbhc.png
---

I have developed a small smartphone application for parents available on iOS & Android. 

It was developed using React Native. You can define your own texts and let the smartphone read them via TTS.

> Are you annoyed speaking the same sentences over and over again to your children?

> If yes, this soundboard will be your new best friend.

> You can define custom sentences and let the smartphone speak them for you. 

> Your kids will hate it ;-)

<img src="https://thepracticaldev.s3.amazonaws.com/i/s6p5kj5uu1ylz76d96jv.png" width="50%">

# Links

* [Get it on Google Play](https://play.google.com/store/apps/details?id=de.mokkapps.parentssoundboard)

* [Get it on iTunes](https://itunes.apple.com/us/app/parents-soundboard/id1434425575?mt=8)

* [Source code available on GitHub](https://github.com/Mokkapps/parents-soundboard)

Let me know what you think about it ;-)
Runtime Container Image Security with Anchore and OpenShift
Tags: openshift, kubernetes, security, containers
Published: 2018-09-05 17:06:40

---
title: Runtime Container Image Security with Anchore and OpenShift
published: true
description: An article about integrating Anchore Engine into the Admission Controller feature of Kubernetes and OpenShift to provide runtime container image security
tags: OpenShift, Kubernetes, security, containers
cover_image: https://thepracticaldev.s3.amazonaws.com/i/46n49f3qu6f7o7kda869.jpg
---

New article about building runtime image security on [Red Hat OpenShift](https://openshift.com) using [Anchore](https://anchore.com) and [Kubernetes Admission Controllers](https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/). Easily establish gates before pods are created using a simple webhook.

https://blog.osninja.io/runtime-container-image-security-with-anchore-and-openshift/