teleren/devto huggingface dataset:
Optional Chaining Operator
Tags: javascript, webdev
Published: 2021-01-07 07:49:29

The optional chaining operator `?.` is a new Javascript language feature introduced in ES2020.  It provides a way to access nested object properties without having to expressly validate that each reference in the chain is valid. 

The `?.` operator functions similarly to the `.` chaining operator, except that instead of causing an error if a reference is `null` or `undefined`, the expression returns a value of `undefined`.  When used with function calls, it returns `undefined` if the given function does not exist.

For example:

```
const obj = {
  prop1: {
    prop2: {
      prop3: "value"
    }
  }
};
```
If you attempted access a property in the above object that didn't exist: `obj.prop2.prop3` that would throw the following error:

`Uncaught TypeError: Cannot read property 'prop3' of undefined`

Typically, you could try to handle the case of potentially missing property by combining logical operators and a ternary expression:

```
const myProp3 = obj.prop2 && obj.prop2.prop3 ? obj.prop2.prop3 : undefined;
```

This verbose syntax can be written instead using the optional chaining operator which will automatically assign the value of `myProp3` to `undefined`:

```
const myProp3 = obj.prop2?.prop3; //undefined
```

For dealing with even more deeply nested objects, the optional chaining operator can be used multiple times in the same statement to safely accommodate the accessing of properties: 

`let temp = obj.first?.second?.third?.value;`

It can also be used with function calls to make sure a function exists, and if it doesn't will return `undefined`:

`let data = obj.someMethod?.(someArgument);  //undefined`

It can also be used with arrays:

```
const arr = [5,6,7,8];

arr?.[10] // undefined
```

With the Map data structure:
```
let myMap = new Map();
myMap.set("foo", {name: "baz", desc: "inga"});

let nameBar = myMap.get("bar")?.name;
```

And finally, with the nullish coalescing operator `??`:
```
const myCar = {
  make: "Ford",
  details: { year: 1982 }
};
const customerCar = myCar?.make ?? "Unknown Car";
console.log(customerCity); // Unknown Car
```
Enough JavaScript to get you Started : #2 Evolution of JS
Tags: 100daysofcode, beginners, javascript, webdev
Published: 2021-01-07 07:44:14

#### Evolution : <br>

This particular blog/article explains evolution of JavaScript as a language according to my personal opinions. According to my point of view in my starting days there's only one library used by developers namely **jQuery**.
but now the game is changed there are 100s of frameworks and libraries available by open source JS community.


![1_EC0bLuO6_TyQtbXX-F9gwQ.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1609864283888/2n7QRLqsl.png)


#### Thoughts :

- Release of **Node** Changed the game : in 2009 , a software developer named **ryan dahl** released a runtime known as **NODE** . 

Node is nothing but a runtime for JavaScript , many people confuses it with a new library or framework of JavaScript. but the right way to define node is **_a snapshot of v8 compiler which can work outside browser written in low level languages such as c/c++_**

<hr>

#### How Node changed game ?

**Node** provided a runtime which can run JS outside browser which gave a Huge push to JS community <br>

along with **Node** there came a **package manager** known as **NPM** or **Node Package Manager** . npm made thousands of packages available to developer with **ES2015** features.

Which resulted in JS becoming the largest one of the largest community in dev world.

<hr>

**With Node Devs can :**<br>
👉 Write JS outside browser <br>
👉 Write backend in JS <br>
👉 Install and develop different packages <br> 
👉 Publish Packages globally <br>
👉 Write Desktop/ mobile apps with JS <br>
👉 Use JS anywhere and everywhere <br>

<hr>

#### Rise of Frameworks
 
This Also gave push to developing robust **single page applications** by developing component based libraries like React , Vue and Angular


![front.webp](https://cdn.hashnode.com/res/hashnode/image/upload/v1609865319579/tlrajKGZb.webp)

On top of that backend was also improving Node supported Writing APIs with Express , Koa and Sails


![back.jpg](https://cdn.hashnode.com/res/hashnode/image/upload/v1609865329013/81DZbQlEV.jpeg)

> JS Ecosystem gave power to most influential devs to write piece of code by becoming one of the thriving dev community

<p>Let me know in comment section if you have any doubt or feedback. it's always worth to give time to thriving developer community :) <br>
<br>
Keep Coding ❤
</p>

#### Hey , Let' Connect👋
 [Twitter](https://twitter.com/codarsh) /
 [Github](https://github.com/WhoAdarshPandya/)
Cara Install nodeJs
Tags: javascript, node, programming
Published: 2021-01-07 07:43:03

Install Kusus Ubuntu Download dulu file nodejs
>`wget https://nodejs.org/dist/v15.5.1/node-v15.5.1-linux-x64.tar.xz`

kasih akses file jika diperlukan
 > `sudo chmod -R 755 ./`

ekstrak file
 > `tar xf node-v10.1.0-linux-x64.tar.xz`

pindah file
 > `sudo cp -r node/{bin,include,lib,share} /usr/`
Brain Bytes: writing quality content actually takes time
Tags: dohackathon
Published: 2021-01-07 07:32:16

I try to work on Brain Bytes for 30min to 1h every day.

With that time, I have managed to improve the submission system by:
- adding a title to each submission and,
- a preview system for the markdown editor

I also secured the app by only allowing registered people to post a byte (i.e. submit a post).

However, when it comes to creating content, writing bytes, I realized that it actually takes time to search for quality info and to write sentences that make sense.

So I have to revise my goal down of populating Brain Bytes myself with 100 bytes by Jan 10.

Hence, my next steps are:
- adding a tags system 
- adding a filter system (search all submission by tags)
- adding a search bar (search submissions by words)
- and maybe adding an infinite scroll

Once I will be happy with that, I will ask a few people to participate in the content creation.

But that exercise made me think about all those places that have to create content. For example, how did DEV.TO look like at the start? How did it become such a great place?
Go in 2 minutes
Tags: beginners, go, tutorial, devops
Published: 2021-01-07 07:19:16

Golang or Go was developed at Google as an open-source programming language and is one of the most trending programming languages among developers. Used by Google, Netflix, Twitter, and millions of users let's take a look at it.


## **What is Go?**
Golang is a **procedural and statically typed programming language**. The goal was to create a language, loosely based on the syntax of C. It can be used in place of Python, Node.js, or PHP in the backend. 

Go is not a free-form language, its conventions specify many formatting details, including how *indentation and spaces* are to be used. The language requires that none of its declared variables or imported libraries are unused, and all return statements are compulsory.

---

## **Why Go?**
- Go is a general-purpose language so it can be used for almost anything.
- Mostly for **scalable** and **efficient** (web) services.
- Another area is **cloud applications**. Google has high hopes for it becoming the defacto cloud language

---

## **Some features of Go**

- One defining feature of Go is **concurrency**, which means that multiple processes can be executed at the same time, which makes Go an efficient language.

- It’s compilation time is very **fast**.

- It supports the patterns which adapt to the surrounding environment similar to dynamic languages.

- It supports the **interfaces** and **embedded types**.

- It doesn’t require any external dependencies for the production of the statically linked native binaries.
   




---

## **Statistics**
Here are some stats from *Stack Overflow 2020 Developer Survey*.

> From last year, Go has jumped from 10th position to 5th position, making it in the list of **Top 5 most loved programming language**

- ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/n2po1wnon8kuajcg7c91.png)

---

> Go is also one of the **Top 3 languages associated with the highest salaries globally**.

- ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/bferwhncgvpg6tg05unm.png)

---

## **Bonus :fire:**
So up to this point, we have seen and understand what is Go and why to use go, now let's see how to write Go. It is a beginner's guide so we will just write code for everyone's favorite, Hello World!

#### **INPUT**
```golang
package main

import "fmt"

func main() {
	fmt.Println("Hello World !")
}
```

#### **OUTPUT**
> Hello World !

---

If you got to learn something new and useful show some love by giving this post a ❤️

If you have read so far, save this post and share it with your programming buddies 😃

---

### **Resources :crown:**

{% link https://dev.to/digitalocean/how-to-code-in-go-32p0 %}
{% link https://dev.to/pluralsight/the-top-10-places-to-learn-go-3lhp %}

---

Do you something else about Go? Do share that with the community in the comment section 💬
It's out! —The Prime Guide For Next Gen Developer🤩
Tags: codenewbie, books, webdev, 100daysofcode
Published: 2021-01-07 07:15:00

HAPPY NEW YEAR WISHES!🎉


Hello Everyone! — My new book  [Prime Guide](https://gum.co/nextgendev)  is now available for pre-order so I wanted you to be the first to know about my new book that will help you level-up in 2021.

![cover copy.jpg](https://cdn.hashnode.com/res/hashnode/image/upload/v1610003340865/w4p2m9FjH.jpeg)

As some of you already know my mission to help 5K+ software developers by end of 2021, In which I already cross 600+ now. I am very grateful that my experience is coming in handy for many out there.

This is an exclusive summary of my 10+ years of experience in tech. I will show you exactly what strategy, formulas & experience I came to know during the last 10 years, which allows me to live on my own terms, in a sustainable way, and without over working.

The book is everything you need in a typical career path of a software engineer or developer, from starting at a company as a fresher or new grad to senior software engineer.

It summarizes what I learned while being a software developer and how I mentored software engineers/developers at different stages in their careers over the last couple of years. 

>As a senior software engineer, I mentored dozens of software engineers, helping people level up faster. However, I still did not have a single book to recommend, which would recap the type of advice I found myself repeating.

I want to be honest with you: you will not get an overnight upgrade.

Growing and becoming better takes time, effort, dedication, and discipline, as well as reframing into a growth mindset.

You can pre-order the book here:  [The Prime Guide](https://gum.co/nextgendev) 

With this link, you can get the book today for just $15. 

The price goes up to $39 when it launches.

Still not convinced so let me make a deal with you...

If you choose to buy "The Prime Guide For Next-Gen Developer" today

On release day when you will read & like the book.

Send me a written recommendation for it and I'll refund you $5.

And if you send me a video testimonial, I'll refund you a whopping $10!

Does this sound good?

Here is the link again for Pre-order:  [The Prime Guide
](https://gum.co/nextgendev) 

![book.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1610003371300/jGDKHYZ2H.png)

Let me know if you have any questions/suggestions about the book!
 
Stay awesome,

Cheers
​
​- Ankur Tyagi

Your Mentor, Coach.

Creator of  [CLF ](https://codelifefitness.com/) and   [WETESTERR](https://twitter.com/wetesterr)
India Equities Static Data REST server for NSE and BSE Bhavcopy
Tags: dohackathon, equities, india, trading
Published: 2021-01-07 07:14:25

## Series: ["India Equities Static Data REST server"]

## What I built

The two biggest stock exchanges in India, NSE and BSE, distributes daily trading summary of the traded products in CSV files at the end of the business day, through their websites. Normally referred to as Bhavcopy files, the files provide information like Open Price, Close Price, Last Trade Price etc. I am creating a rest server so as to provide the users with a uniform, easier to use and strategic interface.

### Category Submission: 
Built for Business

### App Link
https://india-eq-productdata-restserver-75f5a.ondigitalocean.app/

### Screenshots

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/5gq9z4t39ucynhnusnyj.png)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/4tqyij8bd2p4g5k2r6a3.png)

### Description
The app acts as a REST server. Depending on the end point and request parameters, it will respond back with the appropriate json. 

### Link to Source Code
https://github.com/dipankargoswami/india-eq-productdata-restserver

### Permissive License
MIT License

## Background
Traditionally in India, people lack awareness and support system regarding investments. Most of the families across economic spectrums rely almost purely on savings account or saving schemes provided by Nationalised banks and post offices. With passing time, return from those mediums have decreased. Also, with better connectivity and globalisation , cost of living is increasing day by by day.  Also due to recent events like COVID, people are becoming more and more aware about the need of building a robust fund to take care of the rainy days. With that, there has been a marked increase in the number of people looking at Equities investment. 

My aim is to provide an easier access to the available data, which can be used by tech savvy individuals as well as fintech startups to make intelligent investment decisions. 

### How I built it 
The application is built in Python. It is using Flask framework to provide the REST interface. Various standard python libraries like panda are used for downloading, parsing the raw data and provide output.

Application is deployed using Digital Ocean App platform. 

### Additional Resources/Info
Starting a new challenge: #30daysofJs
Tags: learning, javascript
Published: 2021-01-07 06:51:50

#Why this challenge?
I started this challenge to get rid of my fear for **JavaScript.** I usually only watch tutorials and read *dev.to* posts. I just became the content consumer of those posts and YouTube tutorials. I watched loads of videos on JavaScript and feels that i knew JavaScript but in reality, when it comes to coding for practice, started forgetting the syntax and started questioning my self that if i am able to do this or not and after some time again fall into **_tutorial hell_**.

##Solution to this problem
To get rid of so called "tutorial hell", I decided to start this challenge. This help me to become more accountable towards my goals because i have to post about my progress everyday on twitter and on here. This forces me to write some actual code and learn the syntax that I am always forgetting.

<blockquote class="twitter-tweet" data-theme="light"><p lang="en" dir="ltr">From today onwards i am starting to post my daily progress on my <a href="https://twitter.com/hashtag/30daysofJsChallange?src=hash&amp;ref_src=twsrc%5Etfw">#30daysofJsChallange</a> <a href="https://t.co/WsTHL3DgzY">pic.twitter.com/WsTHL3DgzY</a></p>&mdash; Nirbhay Parmar (@NirbhayNP14) <a href="https://twitter.com/NirbhayNP14/status/1347063110381670402?ref_src=twsrc%5Etfw">January 7, 2021</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

Please follow me here and on twitter to help me accountable and to cheer me up.
Sending real-time server logs to remote server with nc
Tags: debug, netcat, nc
Published: 2021-01-07 06:15:32

---
title: Sending real-time server logs to remote server with nc
published: true
description: 
tags: debug, netcat, nc
//cover_image: https://direct_url_to_image.jpg
---

Remote debugging is hard, especially when you can't ssh into remote server, monitor the log generating. Maybe it is the server inside an office, or the security policy of your client doesn't allow remote login. But still, we can use nc to deliver the logs, real-timely. No complex setup required, just a little more than the beloved `tail -f` command.

nc(netcat) should be available in most the servers, so additional software are not required(and maybe your client doesn't have the permissions to install new software). 

Only two steps, first, on your own server, you may setup a server to listen for connections:

```
nc -lvk <PORT_NUMBER> | tee remote.log
```

Second, just let your client use the nc to sync the logs to your server, and now you get logs.

```
tail -f server.log | nc <SERVER_IP> <PORT_NUMBER>
```

Actually, even there is no nc at your client's server. You may actually send the by the following command

```
tail -f server.log > /dev/tcp/<SERVER_IP>/<PORT_NUMBER>
``` 

And remember to close the nc service when are done.
Git LFS track folder recursively
Tags: github, lfs, gitlfs
Published: 2021-01-07 06:51:20

If you want to recursively track folders with "n" folder and "m" sub-folders. I would recommend doing it this way.

2. Find all the files extensions using following command

```
find . -type f | perl -ne 'print $1 if m/\.([^.\/]+)$/' | sort -u
```

2. and then creating a <code>.gitattribute</code> file and adding git lfs track syntax. This command generates that for you, it tracks all the files and its extensions and creates lfs tracking syntax.

```
find . -type f | perl -ne 'print $1 if m/\.([^.\/]+)$/' | sort -u | awk '{print $1" filter=lfs diff=lfs merge=lfs -text"}' | sed 's/^/*./'
```

3. Copy paste output to the <code>.gitattribute</code> file and commit.

It works for
1. Any number of files and folder.
2. Large repo with large number of small files which makes the repo size very big.
3. Any number of folder and sub-folders.
Top Tools For Mobile Game Development

Published: 2021-01-07 05:59:38

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/5sa15tgm2ab4c6g16rwc.png)

Mobile game development is a hot market. Many companies have successfully developed stunning games. Before experiencing success there are countless failures you have to go through.

The usual reasons mobile games fail include:

The game cannot make money.
It exhausts the entire budget in development and user acquisition, leaving no room for innovation.
The game is too heavy. 
Which tool to choose for mobile game development? Here we will test the top mobile game development tools that you can use to begin your project:

Unreal Engine:

Unreal Engine 4 is the next version of UDK. This game development kit comes with immense options for mobile, PC, and console game development. It uses C++ as the scripting language by replacing the popular UnrealScript.

Unity:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/glp2ytrv7056x67pki05.png)

Unity is one of the top mobile game development platform used by top 3D Game Development Company. Unity is used for multiple gaming platforms like Android, iOS, Windows, and much more. You can create major 3D game applications and purchase assets from the asset library. 

Corona SDK:

Corona SDK is available for Mac and Windows operating systems. Corona SDK has over 500+ APIs for all range of functions from animation to networking. With a free plan, Corona has attracted many developers and has created a huge support community.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/9fsd9zpgq6igvepkurk0.png)

Lumberyard:

Amazon’s Lumberyard is a free AAA game engine that can be used for Android, iOS, PC, Xbox One, and PlayStation 4. It offers you great features like source code, networking, rich sound engine, seamless integration including AWS cloud. It accelerates its graphics with a range of terrain, character, rendering, and authoring tools which help to create photo-quality 3D environments at scale.

Cocos2D-x:

Through Cocos2D-x you can create any size of the game even as low as 1.5 MB. It uses OpenGL to render optimized 2D graphics and provides you a great game development SDK for small to midsize projects.

This platform has developed dramatically over the past few years and has become a preferred choice for many developers around the world. It’s free pricing and library of existing resources make it a good competitor for 2D game development. 

Wrapping-up:

Do you have a killer game idea? Glownight is a top Unity Game Development Company. It offers you the service of 2D, 3D, visually appealing games, and much more.

Website: http://glownightgames.com/
Activating Outbound Attribute Expression in AngualrJs Directive
Tags: angular, directive, worknote
Published: 2021-01-07 05:55:42

This is a #worknote.

## Scenario

In cases where an attribute directive is needed and a component cannot be used and the desire is for the directive to pass some data to the using parent component.

In a component, we can use `&` binding. But in a directive, we need to do the `&` work ourselves. 

## Solution

*Directive Controller*
```js
function ($scope, $attrs, $parse) {
  const exprFn = $parse($attrs.myDirective);
  
  const newScope = $scope.$new(false, $scope);
  newScope.variableToPass = 1234;

  exprFn(newScope);

  newScope.$destroy();
}
```

*Parrent Component*
```html
<div my-directive="$ctrl.setValue(variableToPass)"></div>
```

* $attrs is a special object that for each injected component/directive contains the attrs of the attached element.

* If `myDirective` is registered as `myDirective`, it will also be in `$attrs` object as `myDirective` by the same name.

* Angular `$parse` service allows us to compile a string representing an AnuglarJs javascript expression into an activation function. That function can be activated which in turn runs that expression in the context of the params given to that function

* We create a new scope so the outside user of the directive can use the parent scope variables also in the provided expression in case needing them. Otherwise we would just do `exprFn({ someVar: 1234 })`

* new scopes need to be disposed of to prevent leak.
Namespace 'google.maps' has no exported member 'MouseEvent'
Published: 2021-01-07 05:51:35



I wanted to integrate Google Maps with my Angular project. In the pilot version, I was just following this link https://angular-maps.com/guides/getting-started/. Currently, I am stuck in error:

node_modules/@agm/core/lib/directives/map.d.ts:232:43 - error TS2694: Namespace 'google.maps' has no exported member 'MouseEvent'

232     mapDblClick: EventEmitter<google.maps.MouseEvent>; 

I went to the file location and got this

    mapClick: EventEmitter<google.maps.MouseEvent | google.maps.IconMouseEvent>;
    /**
     * This event emitter gets emitted when the user right-clicks on the map (but not when they click
     * on a marker or infoWindow).
     */
    mapRightClick: EventEmitter<google.maps.MouseEvent>;
    /**
     * This event emitter gets emitted when the user double-clicks on the map (but not when they click
     * on a marker or infoWindow).
     */
    mapDblClick: EventEmitter<google.maps.MouseEvent>;
    /**

Dependencies: npm install @agm/core npm i @types/googlemaps
office.com/setup
Published: 2021-01-07 04:47:10

Download, install, or reinstall Microsoft Office from the official site <a href="https://big4office.com/">office.com/setup</a> on your device. You can use your Microsoft services accounts such as Outlook, Skype, Xbox Live, or others. Sign in with an MS office account at <a href="https://big4office.com/">www.office.com/setup</a>
 or create an account.