teleren/devto huggingface dataset:
JavaScript - Optional Chaining & Nullish Coalescing 
Tags: optionalchaining, nullishcoalescing, javascript, es6
Published: 2019-11-10 10:14:10

---
title: JavaScript - Optional Chaining & Nullish Coalescing 
published: true
description: Optional Chaining & Nullish Coalescing are coming to JavaScript!
tags: Optional-Chaining, Nullish-Coalescing, JavaScript, ES6
---

Optional Chaining & Nullish Coalescing are coming to JavaScript! They're short and readable. Both these features are currently in stage 3, however we can start using the same with the help of following plugins that [Babel](https://babeljs.io/) provides:

[@babel/plugin-proposal-optional-chaining](https://babeljs.io/docs/en/babel-plugin-proposal-optional-chaining)
[@babel/plugin-proposal-nullish-coalescing-operator](https://babeljs.io/docs/en/babel-plugin-proposal-nullish-coalescing-operator)


The optional chaining operator can be combined with the nullish coalescing ?? operator when a non-undefined default value is needed. This enables safe deep property access with a specified default value, addressing a common use case that previously required libraries such as lodash’s [_.get](https://lodash.com/docs/4.17.15#get):


```js
const object = { id: 123, names: { first: 'Alice', last: 'Smith' }};

{ // With lodash:
  const firstName = _.get(object, 'names.first');
  // → 'Alice'

  const middleName = _.get(object, 'names.middle', '(no middle name)');
  // → '(no middle name)'
}

{ // With optional chaining and nullish coalescing:
  const firstName = object?.names?.first ?? '(no first name)';
  // → 'Alice'

  const middleName = object?.names?.middle ?? '(no middle name)';
  // → '(no middle name)'

}
```


Github:
https://github.com/tc39/proposal-nullish-coalescing
https://github.com/tc39/proposal-optional-chaining

V8.dev:
https://v8.dev/features/nullish-coalescing
https://v8.dev/features/optional-chaining

If you find the article informative, please don't forget to follow.

Happy coding :)

**Interested in having a look at my other articles?**

Learn some of the best practices in web accessibility that will help your web content or web application reach out to a broader audience.
{% post https://dev.to/redraushan/accessibility-mantras-for-web-developers-2m76 %}

If you talk optimization and walk optimization, memoization is one of the basic concepts that you must add in your skillsets. Moreover you will also learn how you can easily memoize your React components.
{% post https://dev.to/redraushan/memoizing-react-components-2km7 %}


Learn how code splitting is a thing that you have been missing.
{% post https://dev.to/redraushan/route-based-code-splitting-in-reactjs-28ah %}
The Generalist or Jack of all trades
Published: 2019-11-10 10:10:26

Today I am a developer, sort of... In my career I have programmed frontend and backend systems and everything in between. I've written 6303 assembler for embedded systems and racked servers in a datacenter. I would definitely consider myself a generalist with a broad knowledge of IT systems.

The things I liked doing 25 years ago are different to the things I like now. People change over time, yet this change is deemed a bad thing.
"Jack of all trades and master of none."

No matter what I have been hired to do I have always given 100% and managed to master the technology at hand in order to deliver the project.
So this isn't simply a matter of getting to use the newest "shiny" either. I have the ability to pivot in order to cope with the unexpected. This has significantly benefited several of my employers over the years.

One example I could give was when I joined a company as a Perl developer. I didn't necessarily think I was an amazing Perl developer and I was honest about this during the interview, but I demonstrated through previous experience and Perl projects that I did in my free time that I was willing to learn and improve.

It was a "foot in the door" moment for me as this job was in a new country and I was happy that they'd decided to give me a chance.

Shortly after I started I found myself developing Java, C#, XSLT and a whole host of other diverse projects. Whilst nobody else in the IT department could pick up these other projects, I could. 
I did what needed to be done without the company having to go and hire individual specialists. They saved time and money interviewing and on-boarding and the work got done.

So come on interviewers, maybe give generalists a bit more of a chance in the future.
Convert sounds for Amazon Alexa Skills
Tags: alexa
Published: 2019-11-12 14:06:53

---
title: Convert sounds for Amazon Alexa Skills
published: true
date: 2019-11-10 09:58:13 UTC
tags: Alexa
canonical_url: https://boobo94.xyz/alexa/convert-sounds-alexa-skills/?utm_source=rss&utm_medium=rss&utm_campaign=convert-sounds-alexa-skills
cover_image: https://i0.wp.com/boobo94.xyz/wp-content/uploads/2019/02/alexa-skill.jpg
---

Convert sounds for [Amazon Alexa Skills](https://boobo94.xyz/ai/5-questions-build-custom-alexa-skill/) is an article that made me ask myself if this should be just a wiki note in [my project](https://boobo94.xyz/alexa/my-first-alexa-skill/). Or maybe to share it on my blog. So here we are

Amazon requests the sounds in a [special format](https://developer.amazon.com/docs/custom-skills/speech-synthesis-markup-language-ssml-reference.html#audio) to be played on its devices. You can find a tool [here](https://www.jovo.tech/audio-converter) which helps you to convert your files.

Some sounds can be in different formats, like `.wav` format and requires converting to `.mp3` before converting with [Jovo Audio Converter](https://www.jovo.tech/audio-converter) use [Online convert](https://audio.online-convert.com/convert-to-mp3) to get your `.mp3` file.

The post [Convert sounds for Amazon Alexa Skills](https://boobo94.xyz/alexa/convert-sounds-alexa-skills/) appeared first on [boobo94](https://boobo94.xyz).
The Shiny New Parts of Python.
Tags: python, python3
Published: 2019-11-10 09:53:43

---
title: The Shiny New Parts of Python.
published: true
description: New additions to the latest Python language.
tags: Python, Python3
series: The Shiny New Parts of Python.
---

This series is about the latest additions to the Python language which at the time of writing is Python 3.8. To kick start the series, this post will focus on <b>Positional-only parameters.</b>
Prior to Python 3.8, some inbuilt functions allowed for positional-only arguments in functions but this feature could not be used in code by developers. The addition of the ability to specify positional-only arguments in function definitions is a new enhancement to the Python language syntax and is based on [PEP 570] https://www.python.org/dev/peps/pep-0570/). 
Prior to Python 3.8, a function definition looked like:

{% gist https://gist.github.com/aitoehigie/f537f0bfc5a99f16658fdb8528a62e78 %}


but now with the addition of positional-only arguments, a function definition looks like:
{% gist https://gist.github.com/aitoehigie/abbc401216e638e0ae47fdbdc7bc1943 %}

**Explainer**
- The '/' marker specifies that all parameters to its left can only be passed by position during the function call as against the normal position-or-keyword argument passing. Its then followed by positional_or_keyword_parameters and a '*' marker which specifies the end of all positional parameters and then followed by keyword_only_parameters.
- If '/' is not specified in the function definition, that function does not accept any positional-only arguments.
- Once a positional-only parameter is specified with a default, the following positional-only and positional-or-keyword parameters need to have defaults as well.

**Examples**
{% gist https://gist.github.com/aitoehigie/08f80e7a9affae4bbf9ad03e936c8fd8 %}

**Playground**
{% asciinema 280395 %}

**Advantages of positional-only parameters**
- Speed and performance: The parsing and handling of positional-only parameters is faster.
- Logical ordering: positional-only arguments enforces the order in which arguments are mapped to parameters in the the function definition during a function call.
- Better API design. The new syntax will enable library authors to further control how their API can be called. It will allow designating which parameters must be called as positional-only, while preventing them from being called as keyword arguments.

**When and where can you use positional-only parameters?**
- Use positional-only if names do not matter or have no meaning, and there are only a few arguments which will always be passed in the same order.
- Use keyword-only when names have meaning and the function definition is more understandable by being explicit with names.
Configure your dev Windows machine with Ansible
Tags: ansible, ansibleplaybook, windows
Published: 2019-11-10 09:44:01

---
published: true
title: 'Configure your dev Windows machine with Ansible'
cover_image: ''
description: 'How to use the power of Ansible for configuring your own Windows environment'
tags: ansible, ansibleplaybook, windows
series:
canonical_url: 'https://worldwildweb.dev/configure-your-dev-windows-machine-with-ansible/'
---

Ansible is well known it the IT operations fields with its fantastic automation abilities.
You can do whatever you want with Windows too if it's a Powershell, bat script or one of the more than the hundreds modules.
I will use it to configure my personal machine and save the hustle every time I step on new one.
It's not a big deal to install a few programs but I'm sure this will repay in the long term. Can be pretty useful for configuring multiple machines too.
Using Ansible to target localhost on Linux is like click-click-go, but It's different when it's comes to Windows.
We need to install WSL on Windows, Ansible on WSL, Enable WinRm on Windows and finally control it from WSL.
And all this happens on your localhost.

# Install Ansible on WSL

From within PowerShell run the following commands.
Enable WSL:
`Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux`

Install Ubuntu distribution but you may choose to install whatever distro you want:
`Invoke-WebRequest -Uri https://aka.ms/wsl-ubuntu-1604 -OutFile Ubuntu.appx -UseBasicParsing`

Start your WSL and update packages:
`sudo apt-get update`

Install Ansible:

```
sudo apt install software-properties-common
sudo apt-add-repository ppa:ansible/ansible
sudo apt update
sudo apt install ansible
```

Install packages for WinRM support:

```
sudo apt install python-pip
sudo pip install pywinrm
sudo pip install xmltodict
```

# Enable WinRM

By default WinRM works only for Private or Domain networks. You can skip that by providing parameter to `Enable-PSRemoting -SkipNetworkProfileCheck` but I don't suggest doing that. Instead make your trusted network private.
Then enable WinRM:
`Enable-PSRemoting` running it in Powershell.

Enable Basic Auth:
`Set-Item -Path WSMan:\localhost\Service\Auth\Basic -Value $true`

Enable Unencrypted connection:
`Set-Item -Path WSMan:\localhost\Service\AllowUnencrypted -Value $true`

# Run the playbook

Using `ansible-pull` run the playbook which install Chocolatey and a few packages from it. Full details can found in the [repo](https://github.com/gmarokov/ansible-win-postinstall). Provide your username and password for your Windows machine.

`ansible-pull –U https://github.com/gmarokov/ansible-win-postinstall.git -e ansible-user=your_win_user ansible_password=your_win_user_password`

# Conclusion

I'm sure you as developer make a lot of tweaks to your os, me too. Having a few more tweaks to add, would be great to share some ideas and extend it even further.
I also created a playbooks for [Ubuntu](https://github.com/gmarokov/ansible-playbook-postinstall-ubuntu) and [Fedora](https://github.com/gmarokov/ansible-playbook-postinstall-fedora), check them out if you are using one of this distros.
Vim 速習ドリル ～ レジスタ 〜
Published: 2019-11-10 03:19:51

Vim機能の中で覚えにくい「レジスタ」について、集中的に習得しましょう！

つづきは[こちら](https://vim.blue/vim-study-register/)。
[https://vim.blue/vim-study-register/](https://vim.blue/vim-study-register/)
A PWA to fetch news headlines from news APIs. 
Tags: javascript, webdev, career
Published: 2019-11-10 05:17:25

---
title: A PWA to fetch news headlines from news APIs. 
published: true
description: A progressive Web app to fetch news headlines  from Newyork times Api and Newsapi.org. 
tags: javascript, 
      webdev, career, beginner 
---

I have created a progressive Web app for fetching news headlines from two APIs which are NewsApi.org and Newyork times API. 

I have used javascript fetch(url) method to hit the Api endpoint. 
The response comes as a json object. The news articles from the json object are then converted to an javascript object. The javascript object then gets mapped to an html unordered list to show the news articles as distinct posts. 

In the second update I have added the feature to show images received from the APIs. 

I have created a javascript function createNode() to create html elements 
and the data gets mapped using javascript map function. 

Today in the third update i have aaded a button to the actual news article from the news provider.

Tge link to the website is 

https://soulsam480.github.io/headliner/index.html

Visit the site and the github repo is available on

https://github.com/soulsam480/headliner
Primitivo – the JS library for SVG.
Tags: svg, javascript, webdev, react
Published: 2019-11-10 03:53:54

---
title: "Primitivo – the JS library for SVG."
published: true
description: "let's walk through examples."
tags: SVG, javascript, webdev, react
cover_image: https://i.imgur.com/T4DvJB3.png
---

I'm pleased to present the new Javascript library for SVG. It prepares data and doesn't manipulate the DOM. With it, you can create spinners, transition effects, or elements for illustrations.

GitHub repo: https://github.com/guandjoy/primitivo-svg

## What makes it unique

1. Morph paths via animate tag;
2. Powerful timing and spacing controls;
3. Phased animation;
4. Animate with SSR and without JS (except for interactive cases).

Let's walk through examples :milky_way:

## Sequence of Polygons
The first demo of how Primitivo generates shapes. Here we animate the `numOfSegments` parameter by changing the value from 2 to 44 with a 1.01 step increment.
_The artistic idea taken from Matt DesLauriers' [shot](https://twitter.com/mattdesl/status/1175456382541271042)._
{% codesandbox 2twr8 %}


## Smart Round

To create round shapes, Primitivo has the `round` parameter. With `smartRound` and `adaptArms` modes, you can get a circle from a non-equilateral polygon. This feature is fundamentally essential and allows us to make phased transitions. 

{% codesandbox 5iiks %}

## Noise of Distance

The `distance` value stands for a position of a vertex between a center of a polygon and its boundaries. 

The `-` and `+` buttons are responsible for the `depth` value, which is powering  `numOfSegments`. Here is the formula on how it works: 
`numOfVertexes = numOfSegments * Math.pow(2, depth)`

{% codesandbox h0c7t %}

## Phased Transition [interactive]

Inventing Phased Transition was a challenging goal. The Phases Layer generates key paths and seamlessly animates them in conjunction with the Spacing Layer. It allows us to create complex timing and spacing setups for a scene with many key paths. For example, if you want to seamlessly morph a triangle to a circle and then to a square using a single easing function, you can achieve that by using the Spacing Layer.

{% codesandbox gmksi %}

## Blobby Spinner

Play with this component on CodeSandbox and generate your's unique effects. Also, if you'll use Server Side Rendering, the animation by itself could work while JS being off.

{% codesandbox d6vrz %}

## Thanks for watching!

Click the star button on the [GitHub repo](https://github.com/guandjoy/primitivo-svg) and ask your questions in the comments below :cupid:

## New open-source project is coming soon :blush:

{% codesandbox nhn0i %}
Vim / neovim で pythonのパスを指定する方法
Published: 2019-11-10 03:20:08

近年の Vim や neovim では、多くは python がインストールされていることを前提とした仕組みになっています。 特に、neovim の :checkhealth をすべて通過するには必要不可欠です。 この記事では、vim/neovimでPython実行ファイルのパスを明示的に指定する方法を紹介します。

つづきは[こちら](https://vim.blue/vim-neovim-python-path/)。
[https://vim.blue/vim-neovim-python-path/](https://vim.blue/vim-neovim-python-path/)
Awesome Things I Read Or Saw Online This Week!
Tags: todayilearned, watercooler
Published: 2019-11-10 01:33:51

I'm a life long student and love learn thousands of random things. Here are some of the odd yet my favorite articles this week.

1. [An artificial-intelligence first: Voice-mimicking software reportedly used in a major theft](https://www.washingtonpost.com/technology/2019/09/04/an-artificial-intelligence-first-voice-mimicking-software-reportedly-used-major-theft/?noredirect=on) from the Washington Post.

2. [These superpowers of MongoDB will convince you to make the move](https://medium.com/fundscornertech/these-superpowers-of-mongodb-will-convince-you-to-make-the-move-575929eea431) I'm trying to up my MongoDB knowledge.

3. I'm in the Logistics business so this [Vice News](https://www.youtube.com/watch?v=Qs69m9T-4Rk) story I watched on Self Driving trucks was interesting.

4. Creating [load balanced](https://engineering.q42.nl/shitty-load-balancer/) systems is interesting. I studied networking in college so I'm fascinated by it and you can learn a lot from potty humor.

5. At Coyote our tech stack is evolving always I really enjoyed reading about tech companies in [LA] (http://www.builtinla.com/2019/09/06/tech-stacks-los-angeles-tech-companies) are doing.

6. One of my expertise is in Robotic Process Automation this week at the Microsoft Ignite conference they announced the rebranding of Microsoft Flow to [Power Automation](https://venturebeat.com/2019/11/04/microsoft-rebrands-flow-as-power-automate-adds-rpa-features-and-virtual-agents/amp/) along with the features to make it a full-on RPA Suite.
Show off your Hacktoberfest Swag!
Tags: hacktoberfest, watercooler
Published: 2019-11-10 01:02:56

I completed Hacktoberfest this year. It was actually the first time I participated. I am definitively looking forward to receiving my t-shirt and stickers, but in the meantime, if you got yours, post a pic or post your tweet!

I’m starting to see some pop up in my Twitter timeline.

{%twitter 1192948969610960896 %}

{%twitter 1193224304131035136 %}

{%twitter 1193274822870089730 %}

~~I’ll post mine here as well once it arrives.~~ Congrats to everyone who finished Hacktoberfest! 👏

Update 2019-11-26: look what came in the mail today!

{%instagram B5WKOqIJZCX %}
Keeping up with Ruby
Tags: ruby, code, webdev
Published: 2019-11-10 00:33:16

---
title: Keeping up with Ruby
published: true
description: Some beginner's rants about ruby
cover_image: https://upload.wikimedia.org/wikipedia/commons/5/57/Union_Pacific_844%2C_Painted_Rocks%2C_NV%2C_2009_%28crop%29.jpg
tags: ruby, code, webdev
---

Ha Ruby! some real gem there, believe me. My first impressions checking through the docs, when first starting out was: "This looks like C (now I know better, it doesn't)". Little do I know am going to be writing a post about it some few odd months after.

So what made me hooked enough to want to explore the language more? Well am not yet sure but i will tell you something along the lines of: 

+ It's syntax
+ Visual Appearance (makes a case for clear code out of the box)
+ Flexibility
+ Modules
+ Exception Handling

## Best parts for me so far

### Hashes

This will be equivalent of "Objects Literals" in JavaScript. Key/value pairs, two way binding, linked(you get the picture), they differ from Arrays in the sense that whereas Arrays are like lists, they are like dictionaries.

#### Create 'em:

```ruby
  example_hash = {
    "one": "okan",
    "two": "eeji",
    "three": "eeta"
  }
```

#### Use 'em
```ruby
example_hash["one"] # => okan
```


#### Love 'em
Read more about [Hashes] from the docs



### Modules

Modules is a way of classifying methods and constants, watch the word "classify", even though similar (well kind of) to classes yet modules cannot be instantiated (objects cannot be created out of it) and the keyword "new" does not work on it.

#### Create 'em
```ruby
module Alifabeti
  CONST = "A"
end
```

#### Use 'em
```ruby
module Alifabeti
  def oro?
    true
  end
end

class Ede
  include Alifabeti
end

ede_yooba = Ede.new
puts ede_yooba.oro? # => true

```

#### Love 'em
Read more about [Modules] from the docs

#### Symbols

Symbols represents code in your code (am confused as well) rather than string. It is a unique identifier for piece of data you need in your code. Even though it is like a string, it is not  a string (i think an example will do a better job than am trying to do right now).

#### Create 'em
```ruby
apamo = :faweli
```

#### Use 'em
```ruby
  apamo.object_id # => 1928988
  apamo.object_id # => 1928988
  apamo.object_id # => 1928988   

```
Did you notice it returned the same "object_id" for the that same symbol, Ruby only uses one object to represent all those symbols. And perhaps that's one of the obvious difference between symbols and string, for each time you use the same string in your code, it will create a new object each time. 

#### Love 'em
Read more about [Symbols] from the docs

So there you have it, well am still exploring the language and hope to keep this going as a serial kinda thing, thanks for reading.

[Symbols]: https://ruby-doc.org/core-2.6.5/Symbol.html
[Modules]: https://ruby-doc.org/core-2.6.5/Module.html
[Hashes]: https://ruby-doc.org/core-2.6.5/Hash.html