teleren/devto huggingface dataset:
Node.js - REPL (Read Eval Print Loop)
Tags: javascript, node, testing
Published: 2020-04-07 20:07:29

Before start with this post, I would like to explain what is **node.js.**

Node.js is not entirely true a JavaScript that runs on the backend, it is a **wrapper** of a **VM** who is running the **JavaScript V8 engine**,
knowing that, node.js come with a lot API that we can use in conjunction with JavaScript but I will leave that topic for another post.

Now let talk about **REPL**.

**REPL** it is a node API that let us to write or test script in the terminal.
To enter in to the REPL mode we need to type `node` in the terminal.

```terminal
> node
>
```

After that are going to see an empty `>` its mean that we are into the **REPL** mode, now we can have fun and write some code.

```terminal
> console.log('hello REPL') // => hello REPL
```

REPL let us write an inline code by default, if we want to write a multiple line of code
```terminal
> function printHelloAliens() {
```

then left `{` open and press `enter` you will see the next line with `...`

```terminal
> function printHelloAliens() {
> ...
```

it means that we are ready to continue with the function content, add a `console.log('hello aliens')` and press `enter` and you will see the next line with `...`

```terminal
> function printHelloAliens() {
> ...console.log('hello aliens');
> ...
```

to finish with the function content with need to add `}`

```terminal
> function printHelloAliens() {
> ...console.log('hello aliens');
> ...}
> undefined
```

after press `enter` the terminal will print `undefined`;
if you want to test your function just invoke the function, in my case is `printHelloAliens()`

```terminal
> function printHelloAliens() {
> ...console.log('hello aliens');
> ...}
> undefined
> printHelloAliens() // => hello aliens
```

they are a lot of options, if you want to know it just type `.help`

```terminal
> .help
.break    Sometimes you get stuck, this gets you out
.clear    Alias for .break
.editor   Enter editor mode
.exit     Exit the repl
.help     Print this help message
.load     Load JS from a file into the REPL session
.save     Save all evaluated commands in this REPL session to a file
```

for this tutorial we're only going to see the `.editor` command.
The `.editor` command allow you to write a multiple line of code more easy.

```terminal
> .editor
// Entering editor mode (^D to finish, ^C to cancel)
```

Now with can write a multiple line of code with just pressing `enter`

```terminal
// Entering editor mode (^D to finish, ^C to cancel)
function printMyName() {
 console.log('Johan Guzman')
}
> undefined
```

For close the editor mode type `CTRL + d` and the terminal will print `undefined`;

if you want to test your function just invoke the function, in my case is 
`printMyName()`

```terminal
// Entering editor mode (^D to finish, ^C to cancel)
function printMyName() {
 console.log('Johan Guzman')
}
> undefined
> printMyName() // => Johan Guzman
```

The **REPL** is very helpful to test a node or JavaScript code without open the editor or write a little program.
Feedback Buffer - Space Flame Orb
Tags: codepen
Published: 2020-04-07 20:06:55

<p>Using shader-doodle, a web-component for writing and rendering shaders. 
Click and drag the sphere around to check out the fluid motion demo.</p>

<p><a href="https://github.com/halvves/shader-doodle" target="_blank">https://github.com/halvves/shader-doodle</a></p>

{% codepen https://codepen.io/pjkarlik/pen/poJYLea %}
OpenNMS Meridian 2019.1.5 (Saturn) Released
Tags: news, docker, kafka, meridian
Published: 2020-04-20 21:07:42

---
title: OpenNMS Meridian 2019.1.5 (Saturn) Released
published: true
date: 2020-04-07 20:06:05 UTC
tags: News,docker,kafka,Meridian
canonical_url: https://www.opennms.com/en/blog/2020-04-07-opennms-meridian-2019-1-5-saturn-released/
cover_image: https://i.imgur.com/74fmzvG.png
---

Release 2019.1.5 is the sixth release in the Meridian 2019 series.

It fixes a few more security issues, as well as a number of other bugs and a couple of enhancements. Hat tip to Johannes Moritz for the security report.

The codename for 2019.1.5 is _[Saturn](https://en.wikipedia.org/wiki/Saturn)_.

##### Bug

- SNMP Remove from definitions fails for definitions with profile label (Issue [NMS-12413](http://issues.opennms.org/browse/NMS-12413))
- persisted defaultCalendarReport database reports are broken (Issue [NMS-12438](http://issues.opennms.org/browse/NMS-12438))
- Security issue disclosures, 31 Jan 2020 (Issue [NMS-12513](http://issues.opennms.org/browse/NMS-12513))
- Selecting an Icon on Topology Map breaks the map (Issue [NMS-12532](http://issues.opennms.org/browse/NMS-12532))
- Description: Cannot create monitored-service with JSON via ReST (Issue [NMS-12625](http://issues.opennms.org/browse/NMS-12625))
- Confd download fails silently on Docker install (Issue [NMS-12642](http://issues.opennms.org/browse/NMS-12642))

##### Enhancement

- Event documentation is missing tokens (Issue [NMS-12228](http://issues.opennms.org/browse/NMS-12228))
- Splitting Docker documentation in Horizon, Minion and Sentinel (Issue [NMS-12529](http://issues.opennms.org/browse/NMS-12529))
- Improve OIA performance when mapping alarms (Issue [NMS-12581](http://issues.opennms.org/browse/NMS-12581))
- Events not balanced across partitions when using opennms-kafka-producer (Issue [NMS-12616](http://issues.opennms.org/browse/NMS-12616))
AMA AppSec: What would you tell University Students about Application Security?
Tags: appsec, security, ama, university
Published: 2020-04-07 20:04:57

---
title: AMA AppSec: What would you tell University Students about Application Security?
published: true
description: In a recent 'Ask Me Anything; Application Security' live stream, Tanya Janca discusses 'What would you tell University Students about Application Security?' This video is approximately 9 minutes.
tags: appsec, security, AMA, university
---

In a recent 'Ask Me Anything; Application Security' live stream, Tanya Janca discusses 'What would you tell University Students about Application Security?' This video is approximately 9 minutes.

![Ask Me Anything; Application Security](https://dev-to-uploads.s3.amazonaws.com/i/6bhh4mmech78z1864jtd.jpg)

####Summary:
* There are over a million jobs in the security field for which there is no qualified security person available to fill; you will never be without work if you choose this field
* I explained that learning how to use zap is easy, and breaking things is fun
* Doing hands-on things right away is a good way to learn
* I explained that I started THIS SITE. How meta of me to discuss it here. 
* I also talked about my long term goals for the site; to create affordable training so that we can create AppSec and DevSecOp engineers, and find them their first job.
* Discussion of two large problems in InfoSec; not enough highly skilled people to do all of the work and there is no clear career path to get into our field.
* Plans for SheHacksPurple.dev: to create theory and hands-on lessons with security tools.  Especially the "not free" tools, that you are more likely to be expected to use at work. I am currently contacting vendors to see how we can create a deal so my students can try their products for free or almost-free.
* I describe how I want to teach my courses, how I hope to help people learn.
* Then I nerd out about Vulnerability Management and Metrics, because I really like those topics.
* Then someone in the chat changes the topic and that will be my very next post!

If you want to be invited to my free live streams **[sign up for my newsletter](https://newsletter.shehackspurple.ca)**!

 {% youtube Dcu4ifNExoo %} 

—
**For this and more, check out my book, [Alice and Bob Learn Application Security](https://aliceandboblearn.com/) and my online training academy, [We Hack Purple](https://academy.wehackpurple.com)!**
Regular Expressions Cheat Sheet in Node.js
Tags: javascript, node
Published: 2020-04-10 19:33:28

---
title: Regular Expressions Cheat Sheet in Node.js
published: true
date: 2020-04-07 19:40:35 UTC
tags: javascript,nodejs
canonical_url: 
---

[![](https://cdn-images-1.medium.com/max/2600/0*_zDio712oJdK_J3h)](https://medium.com/javascript-in-plain-english/learn-to-use-regular-expressions-like-a-ninja-in-node-js-20cfb6806f26?source=rss-bba4d4e74108------2)

A detailed story to learn, write and execute regular expressions easily.

[Continue reading on JavaScript in Plain English »](https://medium.com/javascript-in-plain-english/learn-to-use-regular-expressions-like-a-ninja-in-node-js-20cfb6806f26?source=rss-bba4d4e74108------2)
Wrocław TypeScript meetup online
Tags: meetup, online, typescript, wroclaw
Published: 2020-04-08 18:48:37

---
title: Wrocław TypeScript meetup online
published: true
date: 2020-04-07 19:31:03 UTC
tags: meetup,online,typescript,wroclaw
canonical_url: https://krzysztofzuraw.com/blog/2020/wroclaw-typescript-online
---

In this blog post, I want to write about the last [Wroclaw TypeScript](https://www.meetup.com/pl-PL/WrocTypeScript/) meetup & encourage to take partin the next one (disclaimer: I’m one of coorganizer).

You may ask what was so special about this meetup? It was the first one made online!

You know that all the current real-life events such as meetups are going so that is why we decidedto do the same. Fortunately, you need a youtube account to start streaming in those days so we don’t needto set up our own streaming.

How it went? You can see it on your own eyes on [youtube](https://www.youtube.com/watch?v=2fHBBiBGYio).Our speaker [Alex Dodge](https://twitter.com/alexmdodge) gave a talk about state machines.It was an interesting talk about how you can implement your own finite state machine and what are theoptions if you want to use already existing libraries. Slides can be found on [Google](https://docs.google.com/presentation/d/1uEc9844u59ujNzE_gKDuB1hzi4B52oX3ZB37hQP8Mlc/edit#slide=id.g6c9450f387_0_52).

If you see youtube video you may notice cool transitions between different speakers or mc. As far asI know there were made in After Effects by Damian - great work 👏.

But this is not the end! We have a new event coming.

It is planned on April 29th (Wed) at 18:30 CEST. You can see what it will be in your [timezone](https://www.timeanddate.com/worldclock/converter.html?iso=20200429T163000&p1=664).

We planned two talks: `Code analysis and visual code representation` by [Mateusz Strąg](twitter.com/MateuszStrag)and `Pimp your codebase & scale it!` by [Mateusz Ziarko](inkedin.com/in/mateuszziarko). You can RSVP on [meetup](https://www.meetup.com/WrocTypeScript/events/267280145/)or ask youtube to remind you [here](https://www.youtube.com/watch?v=4aZ8WMyJiWU&feature=youtu.be).

## Summary & TL;DR

There was the first [Wroclaw TypeScript](https://www.meetup.com/pl-PL/WrocTypeScript/) meetup online last month.You can see it on [youtube](https://www.youtube.com/watch?v=2fHBBiBGYio). I encourage to come to the next - April 29th (Wed) at 18:30 CEST under this [link](https://www.youtube.com/watch?v=4aZ8WMyJiWU&feature=youtu.be)
Up and running with TimescaleDB
Published: 2020-04-07 19:28:43



I've been getting into time-series databases over the past few months. I got into playing with TimescaleDB and was super impressed with its capabilities. One of the important things to understand is that TimescaleDB is just Postgres at its core which means technically TimescaleDB is an extension. Following is my usual MO to quickly run an instance of TimescaleDB.

Getting a docker container up:
```bash
docker run -d --name timescaledb -p 5434:5434 -e POSTGRES_PASSWORD=password timescale/timescaledb:latest-pg11
```

Connecting to said docker container:
```bash
docker exec -it timescaledb psql -U postgres

```

Creating your database:
```sql
CREATE database tstutorial;

```

Connecting to your new database:
```bash
\c tstutorial
```

Adding the TimescaleDB extension:
```sql
CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;

```

That's it! Now you have a dockerized TimescaleDB instance up and running.
Sorbet (Ruby type checker) seems really neat!
Tags: sorbet, ruby, opensource
Published: 2020-04-07 19:19:02

Sorbet first came on the scene almost a year ago, so this post isn't really news.

{% link https://dev.to/nickytonline/sorbet-a-type-checker-for-ruby-3l07 %}

But having not really gone into depth about how it actually works, I really enjoyed this podcast episode about how it works.

{% podcast sedaily/sorbet-typed-ruby-with-dmitry-petrashko %}

Basically it is a _gradual typing_ system designed for uneven adoption because that is what was needed at Stripe, and this makes it really appealing to adopt on an as-needed basis in a codebase based on individual team preferences and problems.

{% github sorbet/sorbet %}

The whole thing seems quite well thought out and useful, and the pattern of starting with type-free Ruby for prototyping and then moving to typing once business logic starts to congeal seems great.
Launched Interview Mocks App
Tags: bestinterviewquestionsapp, onlineinterviewquestions, jobinterviewquestions
Published: 2020-04-07 19:14:56

---
title: Launched Interview Mocks App
published: True
description: Interview Mocks Andriod App
tags: Best interview Questions APP, online interview questions, job interview questions
---
https://play.google.com/store/apps/details?id=com.online.interview.questions&showAllReviews=true

Hello, Friends Today I have launched a new mobile for job seekers to prepare job interviews by checking some FAQ on various programming languages.
You can review that on Play store
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/5xyv15w2ffshl38kiah4.png)

I request you to have a look and provide your suggestions and contribute to new questions.
How to deal with Imposter Syndrome?
Tags: career, computerscience
Published: 2020-04-07 19:12:53

If you are a programmer already, you might feel like you haven't achieved enough, but that's normal. That feeling is called Imposter Syndrome. I felt this myself and It wasn't really easy to deal with it. The best way to deal with this is to look back when you just started programming and just realize how much have you achieved over time. Take a look at your first program that you wrote and compare it to something you wrote recently and tell yourself, wow I did this!
What practices make mature software development and release
Tags: discuss, development, delivery
Published: 2020-04-07 19:12:36

---
title: What practices make mature software development and release
published: true
description: 
tags: discuss,development,delivery
---

When software development and its delivery will be considered mature. what practices, tools, models will make the building and maturely release of the software.

Curious to hear your thoughts around this
Configuring both CSS Modules and global CSS for ReactJS in Webpack
Tags: react, webpack, cssmodules
Published: 2020-04-07 19:04:25

---
title: Configuring both CSS Modules and global CSS for ReactJS in Webpack
published: true
description: 
tags: #reactjs, #webpack, #cssmodules
---
I prefer to keep all common CSS style rules in a global CSS style, called `app.css` for example. For style rules that only pertain to a particular component, then I'd like to keep in a separate CSS module. However, I want to be able to use the same `className` everywhere. For example, I might have a `.logo` class that are used everywhere, but my `Header` component needs a different logo. In this case, I might want to use both global CSS and CSS modules. This is a simple concept but the tricky part is in the details which is the Webpack configuration `webpack.config.js`. 

The `.logo` class is defined in the global `app.css` as follow:

{% gist https://gist.github.com/khle/6e70cae8d997f1da79918b22567a626b %}

####1. CSS module naming requirement
For the `Header` component, Webpack dictates that the CSS module has to be named according to the pattern `something.module.css`. So in this example, I will name it `header.module.css`.

####2. Name mangling
The .logo is defined in the `header.module.css` as follow:

{% gist https://gist.github.com/khle/0c87fb0466819b7f9b892d9eca7611e0 %}

To differentiate the two `.logo` classNames, Webpack does the heavy lifting. It mangles the className `.logo` in `header.module.css`. If we look at the page source, we will see something like `_app_header_module_css__WEBPACK_IMPORTED_MODULE_2___default.a.logo` as opposed to simply `logo` in `app.css`.

####3. webpack.config.js 
We don't care about the above heavy lifting that Webpack does, but we have to abide by its requirement. We will need to configure 2 different rules: one for the global CSS and another for CSS module. 

{% gist https://gist.github.com/khle/a0a5acebb2279ccdd8bc94e135953776 %}

The first rule is for CSS module and second is for global CSS. You can easily tell by looking at the `include` key in each rule.

####4. Outdated information
You might have seen some older posts which showed outdated information:

For example,

```
test: /\.css$/,
  loader: 'style!css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]'
```

or 

```
{
    test: /\.(css|scss)$/,
    use: [
      'style-loader',
      {
        loader: 'css-loader',
        options: {
          modules: true,
          importLoaders: 1,
          localIdentName: '[name]__[local]__[hash:base64:5]'
        }
      }
    ],
    include: /\.module\.css$/
},
```
These will break the Webpack compiling `npm run webpack`. Don't use them.

####4. Consume CSS style rules in ReactJS
Write the code for ReactJS is the easiest part:

```
//from global CSS
import './app.css'

return (
   <div>
      <div className='logo' />
   </div>
)
```

```
//from CSS Module
import styles from "./header.module.css"

return (
   <div>
      <div className={styles.logo} />
   </div>
)
```
Tell us what your top unpopular tech opinion is 😈
Tags: discuss, healthydebate
Published: 2020-04-07 18:49:31

---
title: Tell us what your top unpopular tech opinion is 😈
published: true
description: 
tags: discuss, healthydebate
---

DEV is in the process of launching a podcast and we'd love for you to be involved! We're recording the episodes in advance, and this week we'd like to know:

**What is your top unpopular tech opinion?**

If you'd like to participate, please: 

- Call our Google Voice at at +1 (929)500-1513 and leave a message 📞
- Send a voice memo to pod@dev.to 🎙
- OR, if you don't want your voice recorded...just leave a comment here and we'll read your response aloud for you 🗣

Thank you!
OpenNMS Meridian 2017.1.22 (meridianu(s) Budense) Released
Tags: news, circleci, confd, docker
Published: 2020-04-20 21:07:03

---
title: OpenNMS Meridian 2017.1.22 (meridianu(s) Budense) Released
published: true
date: 2020-04-07 18:47:15 UTC
tags: News,circleci,confd,docker
canonical_url: https://www.opennms.com/en/blog/2020-04-07-opennms-meridian-2017-1-22-meridianus-budense-released/
cover_image: https://i.imgur.com/74fmzvG.png
---

Release 2017.1.22 is a small update to 2017.1.21 that fixes another security issue that affects most current OpenNMS releases. Hat tip to Johannes Moritz for reporting this.

The codename for 2017.1.22 is _meridianu(s) Budense_.

## Bug

- Security issue disclosures, 31 Jan 2020 (Issue [NMS-12513](http://issues.opennms.org/browse/NMS-12513))
- Confd download fails silently on Docker install (Issue [NMS-12642](http://issues.opennms.org/browse/NMS-12642))

## Enhancement

- Backport CircleCI pipeline to foundation-2017 (Issue [NMS-12603](http://issues.opennms.org/browse/NMS-12603))
On.NET Episode: Introduction To GraphQL
Tags: dotnet, graphql, webdev, webapi
Published: 2020-04-07 18:37:34

In this episode, Brandon comes on to give us an introduction to GraphQL. He talks to us about its origin, its benefits, and he even walks us through the GitHub GraphQL API.

Learn more: https://codetraveler.io/DotNetGraphQL

{% youtube anW5Qpuh5kI %}

If you liked this video and would like to see some more of our .NET content, please subscribe to our [.NET Developers YouTube Channel](https://www.youtube.com/channel/UCvtT19MZW8dq5Wwfu6B0oxw).


## Useful Links
* [GraphQL for .NET](https://github.com/graphql-dotnet/graphql-dotnet)
* [Hot Chocolate: GraphQL Server for .NET](https://hotchocolate.io/)
* [ASP.NET Core Docs](https://docs.microsoft.com/en-us/aspnet/core/?view=aspnetcore-3.1&WT.mc_id=dotnet-c9-cephilli)
Twilio Conference API Question
Tags: twilio
Published: 2020-04-07 18:09:08

### Background: I am a software developer at AMC Technology and am working on building an integration with Twilio. 

The problem I am having is in regards to the StatusCallback functionality of the conference API [here](https://www.twilio.com/docs/voice/twiml/conference#attributes-statusCallback)

When I attempt to create a conference using the code below inside a Twilio function it succeeds but the status callback event is never triggered.

>dial.conference(
>    {
>      startConferenceOnEnter: true,
>      endConferenceOnExit: true,
>      waitUrl: `${context.URL}/playRingtone`,
>      statusCallback: `${context.URL}/updateConferenceParticipants`,
>      statusCallbackMethod: 'POST',
>      statusCallbackEvent: 'join leave start end'
>    },
>    conferenceName
>  );

1. The conferenceName is a string for the name
2. The statusCallback is the path URL to another Twilio function that I want to trigger on the following events, join, leave, end, and start for the conference.

Every time I have tried to trigger the statusCallback it fails to trigger the other Twilio function that will perform some logic upon capturing the event. 

Some guidance on what I can do to properly trigger these events would be very helpful.
Var in JavaScript
Published: 2020-04-07 18:04:13

**Var**
Before the advent of ES6, var declarations ruled. There are issues associated with variables declared with var though. That is why it was necessary for new ways to declare variables to emerge,First however, let us get the chance to comprehend **var** more before we talk about those issues.

**Scope of Var**

Scope basically implies where these variables are available for use. var declarations are globally scoped or function/locally scoped.

The scope is global when a var variable is declared outside a function. This means that any variable that is declared with var outside a function block is available for use in the whole window.

var is function scoped when it is declared within a function. This means that it is available and can be accessed only within that function.

**Example**

    var text= "hey hi";

    function newFunction() {
        var hello = "hello";
    }
We'll get an error which is as a result of hello not being available outside the function.

**var variables can be re-declared and updated **
Means you can re-assign the values created by var


    console.log (text);
    var text= "say hello"


**Hoisting of var**
Hoisting is a JavaScript mechanism where variables and function declarations are moved to the top of their scope before code execution. This means that if we do this:

    console.log (text);
    var text= "say hello"

it is interpreted as this

    var text;
    console.log(text); //textis undefined
    greeter = "say hello"

Because hoisting takes all the declarations at top but if you initialize it later  without var key word than it will not moved to the top.

Dis-Advantages of Var

  var text= "hey hi";
  var conter = 6;

    if (counter> 4) {
        var text= "hello world"; 
    }
    console.log(text) //"hello world"

Since counter>4 returns true, text is redefined with hello world it is not a problem yet, it will be complex when you didn't know that var text has already been declared/defined.If you have used text in other parts of your code, you may be shocked at the outputyou may get. This will likely cause a lot of bugs in your code. This is the reason for introducilet and const are necessary.