teleren/devto huggingface dataset:
Learn back-end development with Node.js and Express with this free in-depth course (2.5 hours)
Tags: node, beginners, tutorial, webdev
Published: 2019-02-15 19:54:29



---
title: Learn back-end development with Node.js and Express with this free in-depth course (2.5 hours)
published: true
description: Learn you all the basics of web app development
tags: nodejs, beginners, tutorial, webdev
---

{% youtube mG1L7C4y2c0 %}


[This course](https://getbuzz.io/c/learning-expressjs/stories/Learn-how-to-develop-a-NodeJS-application-4007962439)☝️ starts from scratch and shows you how to build a landing page, collect and manage sales leads developing an application using the CRUD pattern (create, update, delete). We develop an MVC style application with models, views, routes, controllers. If you are new to backend development and Nodejs this course is made for you.

[![CRUD snippet from tutorial](https://thepracticaldev.s3.amazonaws.com/i/ywngi0o02oapz3ipra1h.png)](https://getbuzz.io/c/learning-expressjs/stories/Implement-edit-update-lead-routes-6914824963)| 
|:--:| 
| *CRUD snippet from the tutorial* |

Topics covered include user sign up, login with PassportJS, installing and creating basic tables in PostgreSQL, issuing queries using the Sequelize ORM, what a middleware is and implementing user access control using middleware, form validation, how to divide your views using pug mixins and more.

[![Implementing form validations - snippet from tutorial](https://thepracticaldev.s3.amazonaws.com/i/8pvryfmwtn11sxg98yx8.png)](https://getbuzz.io/c/learning-expressjs/stories/Learn-how-to-implement-form-validation-and-re-rendering-forms-with-errors-3046248441)| 
|:--:| 
| *Implementing form validations - snippet from the tutorial* |

## Tutorial site with videos split into 28 lessons
[Here is more content about this tutorial](https://getbuzz.io/c/learning-expressjs/stories/Learn-how-to-develop-a-NodeJS-application-4007962439). If you liked the tutorial, join our Learning Express group free for updates, Q&A, source code and more: https://getbuzz.io/o/learning-expressjs/u/join-open-access

## I believe learning should be free and fast.
Fast as in:
* There are no enrollment hops until you reach a course. It starts immediately, online.
* Videos make their point right away. They are short and concise.
* And Fun: Learning must be fun, e.g. not solitary but a social activity.

For these reasons I am building [Tech Buzz](https://getbuzz.io/discover), a site for learning tech fast and free, - now focusing on tech areas towards building an online business.

## Update: Launching an online software service shouldn't be hard.

So I took this tutorial some steps further to build [SaaSBox](https://saasbox.net). It lets you launch an online web application / SaaS about 4 weeks faster.
What was your win this week?
Tags: discuss, weeklyretro
Published: 2019-02-15 17:32:29

---
title: What was your win this week?
published: true
description: Got to all your meetings on time? Started a new project? Fixed a tricky bug?
tags: discuss, weeklyretro
cover_image: https://cl.ly/188e843c2985/download/Image%202019-02-15%20at%202.36.37%20PM.png
---

It's weekly retro time!

Looking back, what was something you're proud of?

All wins count -- big or small!

Examples of 'wins' include:

- Getting to all your meetings on time
- Starting a new project
- Fixing a tricky bug
- Cleaning your house...or whatever else that may spark joy 😄
🎉
The pursuit of difference between CSS grid and flexbox
Tags: css, webdev
Published: 2019-02-15 16:00:01

Yesterday I came across the discussion of this question:

{% twitter 1088827201468813312 %}

And it seemed like the best answer is this from Rachel:

{% twitter 1088827732874747910 %}

It's a very straight forward answer and I was like "oh, ok." and moved on.

---

# 🤔

But last night when I was in bed, I got started thinking about this again: I just didn't think this is it.

And when I was thinking it more, I realized it's also about the organization and relationship between the parent and the children: __in flexbox, the children dictate how the layout is organized as well as its own space proportion; meanwhile in grid, the parent decides how things are aligned and what proportion of space each child should take.__

After realizing that, I went to sleep peacefully. 🌝

---

And this morning, I can't wait to share my discovery with the community.
When I was looking for the tweets above to embed, I saw the other branch of the thread, which has the same conclusion as I do! 🤓

{% twitter 1088831796819648512 %}
{% twitter 1088833882592555011 %}

So the conclusion is that the difference between flexbox and grid is _not just_ one dimensional or two, but also __whether the parent or the children should specify the size and proportion of the content.__

---

Last but not least, in case you're wondering which one to choose and use, here's a way to help you decide:

{% twitter 1088834299128958982 %}

Cheers and ciao! 😆
Some Lesser Known TypeScript Features
Tags: typescript, javascript
Published: 2019-02-15 15:06:20

---
title: Some Lesser Known TypeScript Features
published: true
description: Some Lesser Known TypeScript Features
tags: typescript, javascript
---

In the past few years, TypeScript has become a popular way to write JavaScript apps. The language is immense and can do a lot of things.

Here’s a short list of some rarer TypeScript features you may not be aware of to help with your development:

1. You can write numbers with underscores. For example, `1000000000` can be written as `1_000_000_000`. It will be compiled to the regular number in Javascript, but using this syntax makes things easier to read. The underscores can be placed anywhere in the number although writing `25` is more readable than `2_5`.

2. If you know a variable is defined you can add a `!` after it to access it without first checking if the value is `undefined`. For example, you may be injecting props into a React component using a decorator (e.g. `@inject(router)` or `@inject(store)`). You can now write `this.props.store!.someValue` even if the definition of store is `store?: Store`.

Be careful not to overuse this feature, but there are times where it comes in handy. You can read [here](https://github.com/mobxjs/mobx-react/issues/256) for further discussion of this problem. (You could always use an if statement too, but that’s more verbose for cases you know the if statement is truthy).

3. You can set a variable to have type `never`. This means it can’t be set to anything. How is this useful? One place it can be useful is to check you’ve handled every possibility of a switch statement. For example:

```ts
const someFunction = (temperature: 'hot' | 'cold' | 'warm') => {
  switch (temperature) {
    'hot': console.log("it's hot outside!"); break
    'cold': console.log("it's cold outside!"); break
    default: const x: never = temperature;
  }
}
```

The above code will throw a compile-time error, because `x` can be reached. If you add a switch case for warm with a break after it, the compile error will go away as the default block can no longer be reached.

4. Another lesser used type you can use is `unknown`. This just means we have no idea what the item we have is. This may happen if we’re calling a third party API for example. If we try do `x.substr(0, 2)` it will throw a compile error. We can use an unknown variable by first doing a type check. For example, writing `if (typeof x === “string”) x.substr(0, 2)` would no longer throw an error.

No any other useful TypeScript tricks that should be included? Feel free to mention them in the comments!
Introducing Myself
Tags: beginners, webdev, bootcamp, introduction
Published: 2019-02-15 14:26:46

---
title: Introducing Myself
published: true
description: 
tags: beginner, web development, bootcamp, introduction
---

Hello, Dev community!

I discovered this community just yesterday after listening to the most recent episode of the Product Hunt podcast featuring Ben Halpern. This seems like a great place to link up with other developers and aspiring developers such as myself. I'm about to begin a 10-week journey in a web development bootcamp in my home city to transition from the finance industry. I hope to write some posts here about my transition, learn from experienced members of the community and eventually give back by helping others out myself!

If you have a list/link with some good beginner resources or posts I can read I would greatly appreciate it. Looking forward to contribute to the site meaningfully in the future!

According to Ben, this is what I need to conclude my post with if I have nothing else to say...

###**Happy coding**!
WPA and Open System Authentication
Tags: networksecurity, wifi, wpa3
Published: 2021-12-04 19:20:31

---
title: WPA and Open System Authentication
published: true
date: 2019-02-15 04:21:00 UTC
tags: NetworkSecurity,WiFi,WPA3
canonical_url: https://blog.engyak.co/2019/02/wpa-and-open-system-authentication.html
---

Did you know that before you authenticate to your wireless network, it's using the same security mechanisms as open Wi-Fi?  
  
With TLS, it's fairly well known how (most) cipher suites implement the Diffie-Hellman exchange to provide reasonably effective forward secrecy. ECC Diffie-Hellman has largely superseded RSA, but the underlying reason for implementation remains the same - until you establish an encrypted session, confidentiality does not exist. The ultimate solution would be out-of-band exchanged pads, but that is technically infeasible. There will always be a compromise with sacrificial cipher exchanges to achieve forward secrecy.  
  
This is a really helpful video that visually describes the Diffie-Hellman Exchange:  
[https://www.youtube.com/watch?v=YEBfamv-\_do](https://www.youtube.com/watch?v=YEBfamv-_do)
Using Python Functions As Classes
Tags: python, trick, oop
Published: 2019-02-15 13:29:43

---
title: Using Python Functions As Classes
published: true
description: oop or functional? You decide!
tags: python, trick, oop
cover_image: https://i.ibb.co/NtByPw0/jason-leung-479251-unsplash-min.jpg
---

In Python, you can use functions as classes. In py, everything is an object. How? I'm no py expert. Here's how we do it!

## An Innocent Python Function

a function is like that

```python
def devdotto():
    pass
```

and a class is like that:

```python
class Car:
    def __init__(self):
        self.wheel = 4
        self.make = 'BWM' # i know

    def move(self):
        print('moving')
```

more info:

![alt text](https://thepracticaldev.s3.amazonaws.com/i/va7qakwzwhwzy2oi975w.png)

make and wheels are attributes
while move is a method

some tests

```python
car = Car()

print(car.wheel)
print(car.make)

car.move()
```
gives out

```python
4
BWM
moving
```
## Now Let Us Add Attributes

adding attributes to functions

```python
devdotto.name = 'dev.to'
devdotto.users = 1123234
```

testing

```python
print(devdotto.name)
print(devdotto.users)
```

gives out

```python
dev.to
1123234
```
## More Craziness: Adding Methods To Functions

adding an add method:

```python
devdotto.add = lambda x,y: x+y
```
some info:

![alt text](https://thepracticaldev.s3.amazonaws.com/i/fh92725hznxskdu19qow.png)

testing

```python
print(devdotto.add(1,2))
```

gives out

```python
3
```

## Conclusion

Since some one liner libs make use of IEF (Immediately Executed Functions) using lambdas to compile even loops, these can be useful, but i can't think of any use cases (for using functions as classes), this said, this is one of py's party tricks, hence the cover image.

img credit: Photo by Jason Leung on Unsplash

Any ideas? Comment them out below!
Dynamic Config Values for Each PHPUnit Test Case in Laravel
Tags: phpunit, laravel, tdd, php
Published: 2019-02-15 13:11:28

---
title: Dynamic Config Values for Each PHPUnit Test Case in Laravel
published: true
description: 
tags: PHPUnit, Laravel, TDD, PHP
---

_This was originally posted on my [blog](http://dbilovd-blog.herokuapp.com/dynamic-config-phpunit-laravel)_


###Problem:
I am currently working on a USSD application that supports switching between different gateway providers at runtime by changing a configuration value.

Testing each provider test case was simple and straight forward.  I would update the value in my phpunit.xml file and off I go. However, I ran into problems when I wanted to run my entire test suite.



###Solution:
It turns out the solution is quite a simple one: Facades. Laravel allows one to mock any Facade when writing your tests. The documentation however, discourages from mocking the Config facade. Instead one should use the Config::set method. 

So, I did something along the lines of the code below.

```
<?php
// define your namespace and dependencies here

use Illuminate\Support\Facades\Config;

class GatewayProviderOneTest extends TestCase
{
	public function setUp ()
	{
		parent::setUp();
		Config::set("defaultGatewayProvider", "firstProvider");
	}

	// ... your test methods come here
}
```

That’s all I needed. Now GatewayProviderOneTest will run its assertions against the value set as the defaultGatewayProvider: firstProvider.

Additionally, you can revert this to a default value every time in your tearDown method. I however didn’t need to do this.
Creating fake backend with GraphQL
Tags: graphql, webdev, backend, showdev
Published: 2019-02-15 11:33:42

---
title: Creating fake backend with GraphQL
published: true
description: Creating the mock backend has just become super easy (with GraphQL)
tags: graphql,webdev,backend,showdev
canonical_url: https://blog.graphqleditor.com/create-fake-backend/
---

## What is mocking?

Mocking is primarily used in unit testing and it’s a practice of creating a fake version of an object or a component, so you can isolate its behavior to develop other parts of your software independently.

## Importance of mocking data in modern projects

Creating a mock backend is considered a good practice for a couple of reasons:

### 1. Speed up development 
It’s very popular to start a frontend and a backend development at the same time. Having a mock backend let you work on frontend server-depended tasks even if you don’t have a working backend yet. 

### 2. It’s a safe way
Fake backend lets you run local tests. When you don’t need to connect to a real backend it's much safer (and faster). As the project becoming more and more complex, preparing a server infrastructure just to run some tests can be a very unpleasant task and might cause you a lot of trouble.


## Is it hard to create a mock backend?

As you see having a mock backend is definitely a huge benefit, then you must be asking yourself why this solution still isn’t that popular? I bet that the first reason that would appear in your mind is that it’s probably too difficult or time-consuming.  If that came to your mind you are partially right - creating a mock backend used to be difficult, but it’s not anymore! 

GraphQL made mocking data super easy! GraphQL is a strongly typed language. Type System defines various data types that can be used in a GraphQL application and these types can be easily shared between frontend and backend as they have all the information required to mock data.

We went a step further, our [GraphQL Editor](https://graphqleditor.com) allows you to the created mock backend with a single click! Don’t believe? Test it yourself. First, go to https://app.graphqleditor.com/ :

![](https://thepracticaldev.s3.amazonaws.com/i/8styfb5bn37r10y3jj03.png)

All you need to have is a valid GraphQL schema. You can upload an existing schema from a link or use one of our sample schemas. Once you have it loaded just save it and click “Mock Backend” button:

![](https://thepracticaldev.s3.amazonaws.com/i/ocdmjr69bufhbvqq4f29.png)

And that’s it! You have a ready to use fake backend endpoint ready for some tests. Use the GraphiQL window and play around with your mock backend:

![](https://thepracticaldev.s3.amazonaws.com/i/46qp1n0278j2oin02kfw.png)

PS:

The original article was posted on GraphQL Editor Blog - https://blog.graphqleditor.com/visualize-your-schema/

Here is the link to GraphQL Editor app in case you want to try it out - 
https://app.graphqleditor.com/showcase/fake-twitter/
3D Touch Peek & Pop
Tags: swift, xcode, ios, 3dtouch
Published: 2019-02-15 11:15:46

---
title: 3D Touch Peek & Pop
published: true
description: 
tags: Swift, Xcode, iOS, 3DTouch
---

https://medium.com/@ashok.nfn/getting-started-with-3d-touch-peek-pop-swift-d498da57ae19
How to add comments to package.json?
Tags: node, packagejson, comments
Published: 2019-02-15 10:54:57

---
title: How to add comments to package.json?
published: true
description: When you’re bored, you usually have your best ideas. Today I’ve figured out how to add comments to your package.json file without much hassle.
tags: nodejs, package.json, comments
---

**When you're bored, you usually have your best ideas**. While wasting some time on twitter this morning I met a legit question coming from [@caludio](https://twitter.com/caludio) (you should really follow him):

> Are there any plans to make it possible for package.json to contain comments? I can understand the implications but i.e., I would like to write the reason why I had to lock a package to a specific version (hello, TypeScript)

And I was a bit confused... It's a JSON, I can do whatever I want with it! So I've put together some code just to run an `npm install` on it...

```
{
  "name": "napolux-frontend",
  "version": "1.0.0",
  "description": "it's a test",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "MIT",
  "devDependencies": {
    "@babel/core": "^7.2.2",
    "@babel/preset-env": "^7.3.1",
    "babel-polyfill": "^6.26.0",
    "gulp": "^4.0.0",
    "gulp-babel": "^8.0.0",
    "gulp-rename": "^1.4.0",
    "gulp-uglify": "^3.0.1"
  },
  "dependencies": {
    "jquery": "^3.3.1"
  },
  "comments": {
    "dependencies": "we use jQuery because of reasons",
    "repository": "our beloved repo",
    "license": "we love MIT, so why not",
    "devDependencies": {
      "@babel/core": "it's @ version 7.2.2 because of...",
      "gulp-rename": "why not"
    }
  }
}
```

It works! It's not the best possible solution, for sure no inline comments for example, but if you maintain the structure of your `comments` section very close to the one of `package.json` it will be definetely readable!

This post originally appeared on https://coding.napolux.com, but was brought to dev.to for your reading pleasure ❤.
Front-end to Software Developer
Tags: frontend, software, beginners
Published: 2019-02-15 10:42:06

---
title: Front-end to Software Developer
published: true
description: Becoming a software developer
tags: Front-end, Software, Beginner
---
I have been wanting to ask this question guys

Can a front-end developer be referred to as a software developer? And if No, what are the steps to take in moving from front-end to becoming a software developer?
What is self-hosting, and is there value in it?
Tags: discuss
Published: 2019-02-15 10:21:36

---
title: What is self-hosting, and is there value in it?
published: true
tags: discuss
---

I got a chance to [talk with CppCast](http://cppcast.com/2019/02/edaqa-mortoray/)* and one of the questions that came up was self-hosting. I thought I'd write something quickly about it, and leave it open to discussion as to the value in it.

_*Sorry, no embed as they don't appear to be listed on the podcasts here. 😟_

I was working on the Leaf compiler, which we talked about on the show because it was written in C++. I was asked whether my goal was to self-host it.

Self-hosting means the compiler is written in the language itself. In this case, it'd mean the Leaf compiler is written in Leaf.  A lot of languages have this is a goal, such as Go or C#. Whereas a language like Python or JavaScript are not self-hosting.

I said that self-hosting was never a goal of Leaf. I think that answer was a bit unexpected. Sure, ultimately, it would be self-hosted, but I couldn't think of any short-term value in it. It brings no new features to the language, yet creates a boot-strapping hassle. Having another language written in C++ doesn't hurt either community. Just as Python being written in C doesn't detract from either Python or C.

Do you think that having a self-hosting compiler represents a kind of maturity for the language? Is it a case of eating your own dog food? Or is it unnecessary and distracting from a language's main goals?

What do you think?
Pure vs impure FP
Tags: functional
Published: 2019-02-15 08:41:08

---
title: Pure vs impure FP
series: Functional fundamentals
published: true
description: 
tags: #fp
---

When I first started writing about functional programming and its various benefits, I checked with Wikipedia to make sure I had the right definition of "functional": declarative (i.e. no side-effects) and based on the evaluation of mathematical functions. "Function *style*" was instead used to denote having functions as first-class citizens.

It was [brought to my attention](https://dev.to/didibus/comment/8ldn), however, that in academia the lack of side-effects is not always considered a necessity to call a language "functional".

Regardless of which definition is 'correct', I think it is better to be explicit to avoid future miscommunications.

It therefore becomes important to distinguish between *purely* functional programming and *impurely* functional programming.

Purely functional programming requires the lack of side-effects. Pure languages are generally typed. This makes sense, as e.g. `λa.a/7` will throw an error when a string is passed to it, as strings cannot be divided with a number. That would break the Curry–Howard–Lambek correspondence, meaning one would lose many interesting properties.
Purely functional programming languages include Haskell and Elm.

Impurely functional programming is perfectly fine with side-effects. It can be done in a fuckton of languages: JS, Clojure, Lisp, C, Scala, etc.

All my writing thus far has been strictly about *purely* functional programming and cannot be applied to impure languages, as they do not have the necessary properties for the Curry–Howard–Lambek correspondence to hold.

It is debatable whether the properties of purity make up for the effort of avoiding side-effects. I myself am firmly of the opinion that yes, purity solves so frigging many problems that it is absolutely worth it. On the other hand, things like displaying an output or reading user input are effects, so one always needs some kind of way to represent effects in the purely functional world.

Both the advantages of purity in practice, and how to represent effects, are subjects for future posts.
A Quick Guide On Software Development Life Cycle (SDLC).
Tags: softwaredevelopment
Published: 2019-02-15 07:30:16

---
title: A Quick Guide On Software Development Life Cycle (SDLC).

published: true
description: SDLC is an abbreviation of the Software Development Life Cycle. It is a framework designed to define & organize the whole process of software development. This is the process followed by the software development team of any software organization to develop software, this helps in performing tasks in a proven process for developing software. It contains a detailed plan describing how to develop and maintain software.   
tags: software development
canonical_url: https://digitalyuga.com/software-development-bhopal.html  
---