teleren/devto huggingface dataset:
CARDIO API, by Nubentos
Tags: ios, android, microservices, management
Published: 2020-06-24 05:24:56

Hi!

Just another short post to share with you exciting news!

Our brand new API, Cardio API, is [available now in Nubentos API Store!](https://www.nubentos.com/ascvd-risk-calculator-api/?utm_source=devto&utm_medium=post&utm_campaign=microsite&utm_content=cardioapi) (applause)

Yes, after the success of our COVID-19 tracking API, ranking #1 in Apimetrics listing, we have been working in new ideas that will be developed in the forthcoming months.

Cardio API is our grain of sand to help fight heart diseases worldwide.

In particular, Cardio API returns an estimate of the atherosclerosis cardiovascular disease (ASCVD) risk according to the 2013 ACC/AHA Guideline on the Assessment of Cardiovascular Risk and the 2013 ACC/AHA Guideline on the Treatment of Blood Cholesterol to Reduce Atherosclerotic Cardiovascular Risk in Adults.

Different algorithms calculate this risk for different ethnic groups, since there are evidences that estimations vary from certain racial groups to others. We will add them in future versions to cover as many cases as possible. This first version uses the algorithm that shows accepted estimate for African-American and non-Hispanic white men and women 40 through 79 years of age.

There are a number of Apps and websites that offer this feature to their users. Why yours should offer less?


[Have a closer look to its microsite here](https://www.nubentos.com/ascvd-risk-calculator-api/?utm_source=devto&utm_medium=post&utm_campaign=microsite&utm_content=cardioapi), and please share with us your thoughts about any aspect of our brand new API.

We are paying special attention to pricing, because we want to make this profitable and affordable for you.

We've started from these pricing plans, but are opened to your suggestions and thoughts, so do not hesitate and let us know the cons you find (if any):

* Freemium tier: in this tier you can play with the API up to 100 requests per month at no cost. Overuse will charge 0,05€ per request.
* Basic tier: here you have up to 1.000 requests per month with a small fee of 0,005€ per request. For example, with 300 requests you will be charged 1,5€. **Remember that in Nubentos costs are auto scaled: it goes along with the real use made by your users**. Again, extra requests have a 0,05€ per request fee.
* Pro tier: allows you up to 10.000 requests per month, for 0,0075€ per request. This is, for example, 22,5€ for 3.000 requests.
* Payperuse tier gives you unlimited requests per month, with a constant fee of 0,01€ per request.

Again, we encourage you to share with us your suggestions. We are looking forward to learning and to helping, and nothing better than **your point of view** to do so.

We want to help Digital Health reach as many people as possible worldwide, and that will be possible only with YOUR help. So please, help us do things better and better!

Thank you and happy integration!
CommitSweeper - Pure CSS Game
Tags: codepen
Published: 2020-06-24 05:24:15

<p>A Github graph inspired Minesweeper-type game.</p>

<p>Click if you dare - or, just hover and "paint"  the graph of your dreams.</p>

<p>Unfortunately desktop-only due to lack of hover on mobile which would require JS to overcome and add touch events.</p>

<p>Learn more about this:
<a href="https://dev.to/5t3ph/commitsweeper-pure-css-game-4f8a" target="_blank">https://dev.to/5t3ph/commitsweeper-pure-css-game-4f8a</a></p>

{% codepen https://codepen.io/abhishek-t-s/pen/NWxjJRJ %}
What is Optional Chaining? - JavaScript Tutorial
Tags: javascript, tutorial, webdev, codenewbie
Published: 2020-06-24 05:23:32

Learn more about this new operator nearing to become standard for JavaScript!

Check out the proposal here: 
https://github.com/tc39/proposal-optional-chaining


If you'd like to see more of my videos, [head over to Youtube!](https://www.youtube.com/channel/UCWaB4SBBUCvhYb91fz5Vidg) 

For more content, stay tuned! A follow/sub comes a long way to show support!

Follow and connect with me on:
----------------------------------
🐦 Twitter: https://twitter.com/coderarchive
📚 Github: https://github.com/luvuong-le
💼 LinkedIn: https://www.linkedin.com/in/lu-vuongle/
📷 Instagram: https://www.instagram.com/coderarchive/
📝 Dev.to: https://dev.to/coderarchive
thoughts on GitHub design updates?
Tags: github, discuss
Published: 2020-06-24 05:09:34

---
title: thoughts on GitHub design updates?
published: true
description: 
tags: github,discuss
//cover_image: https://direct_url_to_image.jpg
---

I was curious what folks think about GitHub's design update rollout

https://github.blog/changelog/2020-06-23-design-updates-to-repositories-and-github-ui/

Better/worse?

I'm a fan of the mobile improvements having spent a considerable amount of time reading code on a phone.

I'm also a fan of surfacing releases on repo pages. I've long wanted a Releases tab in the old UI.

A dark mode would have been nice.

What do y'all think?
How to Build a Multiplayer Game with JavaScript
Tags: javascript
Published: 2020-06-24 04:51:02

Learn how to build a Multiplayer Game with JavaScript

Video Contents:
00:00:00 Introduction
00:04:03 Project structure
00:06:28 Basic Server
00:09:53 Introducing Socket.io
00:16:03 Creating a chat
00:20:08 Canvas
00:26:58 Exchanging turns
00:37:49 Rendering game board
00:49:59 Game state on server
00:59:50 Win conditions
01:10:47 Turn cooldown
01:14:30 Summary

{% youtube HG7KB3Dgc-s %}

Source code: https://github.com/Juriy/game-demo/tree/rec
What Is Typora
Tags: noted
Published: 2020-06-24 04:17:41

Typora

- Fast to for noting

  - Good for code noting  : Display Code line number

___
- How to set app route `“ ”`

  ```ts
  const routes: Routes = [
    {path: '', component: LoginComponent},
  
    {
      path : 'registeredCompanies',
      component: RegisteredCompaniesComponent
    },
  
  ];
  ```

- Angular implement service
React Redux Video | Create Youtube Player -1
Tags: react, redux, javascript, webdev
Published: 2020-06-24 04:17:10

I had recently started my YouTube channel — The Web Dev. I had decided to start putting all my blogs into the YouTube channel.

We had earlier converted the YouTube player to use flux. I decided to convert it using Redux.
As redux is still very popular and used in enterprises a lot, decided to convert the simple app to use Redux.

And here is my YouTube video.

[![alt text](https://res.cloudinary.com/dxkxvfo2o/image/upload/v1592971091/youtube-redux_mmap3q.png)](https://youtu.be/JAPLju_F9uc "Youtube Player Redux - 1")


Please do like it and [Subscribe](https://www.youtube.com/channel/UCRf7mazcufqZxd2pR3oQJuQ?sub_confirmation=1) to my channel for more videos.

You can also read the complete blog here -

https://thewebdev.tech/youtube-redux-1
What are objects in JavaScript?
Tags: javascript, beginners, objects, parwinder
Published: 2020-06-24 03:52:28

### What are objects?

Objects are fundamental building blocks in JavaScript. Everything in JavaScript is expressed as an object or could be expressed as an object.

Objects are in the form of `key` and `value` pairs. Where a `key` is the reference to the `value`. Let me give you an example:

```javascript
const person = {
    firstName: "Parwinder",
    lastName: "Bhagat",
    age: 33,
    nicknames: ["Ricky", "P"],
    vehicles: {
        car: "BMW X5",
        motorcycle: "Honda Rebel 500"
    }
}
```

What I have done above is to declare an object called **person**. This person is a collection of data about an individual. An object starts and ends with `{}` curly braces. Within the curly braces, we have keys on the left (and they don't need to be put in quotes) and the values on the right of a semicolon.

The keys in the above object are *firstName*, *lastName*, *age*, *nickname*, *vehicles*, *car*, and *motorcycle*. The rest are values for those keys.

> **Important** Always keep in mind that objects are for data where the order does not matter. We cannot guarantee the order of keys in an object.

### How do we access object values?

To be able to access the object values you need to refer to the key you are looking for. Examples:

```javascript
console.log(person.firstName); // Parwinder
console.log(person.lastName); // Bhagat
console.log(person.age); // 33
console.log(person.nicknames); // ["Ricky", "P"]
console.log(person.vehicles.car); // BMW X5
```

You can also refer to the value by key literal instead of using the dot notation.

```javascript
console.log(person["age"]); // 33
```

### How do I assign value to keys in an object?

You can do it exactly how we assign various values to variables. And yes, you can assign any type of value to object keys. In my example above, I have assigned a string, number, array, and object to keys.

```javascript
person.firstName = "Julius";
person.lastName = "Caesar";
person.age = 48;
person.vehicles = null;
```

### What are valid keys in Objects?

You can use:

1. Strings E.g. "firstName"
2. Dashes in the middle of String, E.g. "last-Name"
3. Spaces in the middle of Strings, E.g. "middle name"
4. Numbers if they are put in quotes (technically making them strings), E.g. "007"

You cannot:

1. Start the object key with an underscore `_` even though objects have a hidden property that begins with underscore (\_\_proto__)

### How do I delete an object property?

Use the `delete` operator! 🙂

```javascript
delete(person.age);
console.log(person.name); // Julius
console.log(person.age); // undefined
```

### Can object keys be set to functions?

Absolutely!

```javascript
person.greeting = function(greeting = "Hola") {
    return `${greeting} ${this.firstName}`;
};
person.greeting("Salute"); // Salute Julius
person.greeting(); // Hola Julius
```
✅ How To Set Your Selenium Grid using Zalenium(In 5 mins)
Tags: testing, tutorial, beginners, webdev
Published: 2020-06-24 03:48:18

✅ Join us - https://sendfox.com/thetestingacademy

In this video, We are going to learn How To Set Your Selenium Grid using Zalenium

### 🚀 What is Zalenium?
A flexible and scalable container based Selenium Grid with video recording, live preview, basic auth & dashboard. 

Start a Selenium Grid in seconds, a grid that scales up and down dynamically with this solution based on docker-selenium to run your tests in Firefox and Chrome

Get a grid up and running in a few seconds!

[![Zalenium ](https://i.imgur.com/0PN8YKL.png
)](https://youtu.be/T4KWaKY3pFo "Zalenium") 

### 🚀 Docker commands Used in Demo
-------------------------------------
1) Check docker version & Status:
```java
docker version
```
2) Check available docker images
```java
docker images
```

3) Check available containers
```java
docker ps
```

4) Removes all the stopped containers
```java
docker system prune -f 
```

5) Delete available docker images
```java
docker rmi image ID
```
6 docker start
```java
docker start container id
 ```
7)docker stop
```java
docker stop container id
```
----------------------------------------------------------------

 ### Zalenium Setup
------------------------------
1) If Zelenium images not downloaded earliar then start download using below commands

```java
docker pull elgalu/selenium  
docker pull dosel/zalenium
```
 
2) Starting Zalenium
-------------
```java
docker run --rm -ti --name zalenium -p 4444:4444 -v /var/run/docker.sock:/var/run/docker.sock -v /c/Users/admin/temp/videos:/Users/admin/temp/videos --privileged dosel/zalenium start 
```

3) Stopping Zalenium
----------------
```java
docker stop zalenium
```

URL's:
Grid Console: http://localhost:4444/grid/console
Live view: http://localhost:4444/grid/admin/live 
Live view(Refreshing Page): http://localhost:4444/grid/admin/live... 
Dashboard: http://localhost:4444/dashboard 
 
----------------------------------------------------------------

--
Be sure to subscribe for more videos like this!

[![ TheTestingAcademy](https://dev-to-uploads.s3.amazonaws.com/i/r7vcy6wbvyjbk1y1uu0o.png
)](https://www.youtube.com/TheTestingAcademy?sub_confirmation=1 "TheTestingAcademy")
Automate everything! - GitHub Actions Showcase
Tags: github, automation, cicd, devops
Published: 2020-06-24 03:13:33

GitHub Actions is now the most popular Build Platform on GitHub. But it is also much more than a CI system: it is a very powerful __automation engine__.

Let's take a look at how we can do CI with Actions, and how we can automate operations on our GitHub projects.

### Intro

Today I want to talk about GitHub Actions, and explore with you what we can do with it. Many people in fact think that Actions are just meant for CI CD. But in reality the service does much more than that.

It is a pretty powerful automation platform that is able to respond to __more than 90 events__, including of course the code push to the repo, which will indeed start a CI run, but also many others that are not related to code.
For example, you can do something whenever a user creates a _new Issue_, or when they open a _Pull Request_. Or even when a new _comment_ is added.
Basically, ___if you can automate it you can do it with Actions___!

To show you what you can do with Actions, I created some examples (which I have also used during the _Hong Kong Opensource_ conference I've presented at last week) and I've gone through them in the video below.

### The Video

Enjoy the watch!

{% youtube msCWg2F4sck %}

### Conclusion

This was a quick showcase of what you can do with GitHub Actions.

But as I've said before, you are by no means limited to what I've shown you here. You can do much much more.

You can take a look at the example in the [Github Repo](https://github.com/n3wt0n/HKOSCon2020) I've created, and please __leave me a comment below__ to let me know:

1. Do you already use Actions for something non CICD-related?
2. What do you think of GitHub Actions?
3. Do you have any other question?

### References and Links

- [Github Repo with all the examples](https://github.com/n3wt0n/HKOSCon2020)
- [Video on GitHub Actions for .Net Framework](https://youtu.be/g8tdrB3kbDU)

__Like, share and follow me__ 🚀 for more content:

📽 [YouTube](https://www.youtube.com/CoderDave)
☕ [Buy me a coffee](https://buymeacoffee.com/CoderDave)
💖 [Patreon](https://patreon.com/CoderDave)
🌐 [CoderDave.io Website](https://coderdave.io)
👕 [Merch](https://geni.us/cdmerch)
👦🏻 [Facebook page](https://www.facebook.com/CoderDaveYT)
🐱‍💻 [GitHub](https://github.com/n3wt0n)
👲🏻 [Twitter](https://www.twitter.com/davide.benvegnu)
👴🏻 [LinkedIn](https://www.linkedin.com/in/davidebenvegnu/)
🔉 [Podcast](https://geni.us/cdpodcast)

<a href="https://www.buymeacoffee.com/CoderDave" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" style="height: 30px !important; width: 108px !important;" ></a>
In search of the (at least damn near)perfect application architecture...
Tags: csharp, architecture, showdev, discuss
Published: 2020-06-24 03:12:34

so i've been messing around with a few different application layering styles & architectures and ended up with a solution i'm damn near perfectly happy with.

basically it's a pure vertical slice architecture where the service endpoints are isolated in their own slices that don't interact with each-other to avoid cross contamination.

i've also created a `dotnet new` template to help fast-track stubbing out new projects.

you can install the template and create a new project to play around with using the following commands:

```csharp
  dotnet new -i MongoWebApiStarter
  dotnet new mongowebapi -n MyAwesomeApp
```

github repo for the project can be found [here](https://github.com/dj-nitehawk/MongoWebApiStarter/blob/master/README.md)

i'd appreciate it if you guys could have a play with it and offer some feedback since i'm pretty sure there's room for improvement.

cheers!
Convert string to number
Tags: javascript, microoptimization
Published: 2020-06-24 02:43:37

![parseInt](https://dev-to-uploads.s3.amazonaws.com/i/4u8n3lv86p3oq9qa9r19.png)

Because:
1. *parseInt(n)* as name suggests, parses and doesn't simply convert.

Caveats:
1. For later two, the string should only represent a number otherwise it will return NaN.
2. However, *parseInt("10 apples")* can still parse string that starts with a number.
Let's rewrite Typescript in Rust!
Tags: typescript, javascript, deno, rust
Published: 2020-06-24 02:27:45

If I'm sure of one thing, it is that typescript completely changed the way developers viewed javascript.

working with javascript in small and medium projects is not a problem but in bigger and more complex projects it is much more difficult. JavaScript was not originally intended to be a language for creating complex applications as it is today, behaviors like these are some of the reasons why javascript is heavily criticized:

``` javascript

{} + "" // 0

[] + {} // [object Object]

10 + "10" // 1010

10 - "5" // 5

```

Yes, javascript is rare but it is the language that changed the world since it is the only programming language to run in the backend and frontend.

In 2012, typescript arrived as a superset language that compiled to javascript and brought javascript closer to languages ​​with strong types such as java or C#

*So far so good, what is the problem?*

## typescript bottleneck

the typescript compiler is slow, and don't get me wrong the compiler developers are doing a good job, the problem is node js, node js is designed to use a single core of the processor, it can work with multiple processes but in practice only a single core is used. which causes that when compiling typescript node js cannot take full advantage of the power of your processor, so the compilation can be slow in some cases.

*so what is the solution?*

### [Rust](https://www.rust-lang.org/)

rust is a multi-paradigm language, compiled and concurrent that saw the light in its first version in 2015, this is developed by mozilla and is open source.

[SWC](https://github.com/swc-project/swc) is a compiler for typescript and javascript written in rust and is being developed by a 22 year old South Korean student. is making it possible to lower compile times by using rust as the language.

if tools like webpack or babel were written in languages ​​like rust or go that allow us to use all the cores of our processor, we would have more efficient and faster development tools.

*then Let's rewrite Typescript in Rust!*


this post is inspired by the tweet of [Jonny Burger](//https://twitter.com/JNYBGR)
[Let's rewrite Typescript in Rust!](https://twitter.com/JNYBGR/status/1274386531096989696?s=20)
enchantedForest[2]
Tags: javascript
Published: 2020-06-24 02:18:20

Today we added Vue to our project!

We felt like this was going to be better than integrating something like React or Angular with Flask. 

Vue is pretty cool. 

Basically what you do is something like this:

```html
<!DOCTYPE html>
<html>
<head>
<script src="https://cdn.jsdelivr.net/npm/vue"></script>
 <style type="text/css" media="screen">
#blah2 {
  background-color:red;
  color:white;
}
 </style> 
</head>


<body>

  <div id="hmmm">
    <h1 v-for="i in asdf" :id="'blah'+i">
      <i>
      blah {{ i }}
      </i>
    </h1>
  </div>

<div id="app">
  <h1 v-for="item in items" :key="item.message">
    <b>
    {{ item.message }}
    </b>
  </h1>
</div>

<script>
var myObject = new Vue({
  el: '#app',
  data: {
    items: [
        { message: 'Hello Vue!', isComplete: true},
        { message: 'Hello Vue!', isComplete: true},
        { message: 'Hello Vue!' },
        { message: 'Hello Vue!' },
        { message: 'Hello Vue!' },
        { message: "Bar"}
      ]
  }
});


var blah = new Vue({
  el: '#hmmm',
  data: {
    asdf: [0,1,2,3,4]
  }
});

</script>

</body>
</html>

```



Pretty cool! (to run it, just do `python3 -m http.sever`, we're using CDNs so no installs necessary)

One thing that we ran into while doing this was
how to integrate Vue with Flask.
In particular, jinja template stuff collides with Vue (both use "mustaches" i.e. `{{ }}` for stuff). 

So the way we fixed this, was we just loaded the js thing as a static page. Vue is a tool for making static pages, so this works fine!
Here's the code:

```python
return app.send_static_file('index.html')
```

And, something that I found kind of surprising is that we were still able to do jquery requests even though the page is static!

So yay! probably next time we can integrate mongodb with our game.

- copolla
Day 16
Tags: 100daysofcode
Published: 2020-06-24 02:11:55


### June 23, 2020

**Python**
I started by finishing Codecademy's Veneer project that I began last night. For the first time, I felt like I really understood Python classes. I was able to complete most of the first 20-something steps without needing to search for help.

I learned about nodes and linked lists in Python. It reminds me a bit of TiddlyWiki. I'm not totally sure if that's an apt comparison, but it seems similar. I don't really get what nodes and linked lists can be used for yet, but I'm assuming there'll be a project soon that will make it clearer.

I completed the Towers of Hanoi stacks project.

**JavaScript**
I also went back to freeCodeCamp to do some JavaScript exercises. I'm on objects right now. I'm taking a break for the day because seeing "prototype" and "Object.create" is about to give me a migraine!
Microservices - Exception Handling - Circuit Breaker Pattern
Tags: design, microservices, exceptionhandling
Published: 2020-06-24 02:01:00

I have been working on Microservices for years. I am writing this post to share my experience and the best practices around exception handling from my perspective. Note that it may not be perfect and can be improved. 

I am working on an application that contains many microservices (>100). It is an event driven architecture. An event is processed by more than one processor before it reaches to Store(like Elastic Search) or other consumer microservices

One microservice receives event from multiple sources and passes it to AWS Lambda Functions based on the type of event. There could be more Lambda Functions or microservices on the way that transform or enrich the event. 

Here is a small part of my Architecture
![Alt MS Design](https://dev-to-uploads.s3.amazonaws.com/i/121ch04y3w9hvoyds5cj.jpg)

Microservices has many advantages but it has few caveats as well. Exception handling is one of those. If exceptions are not handled properly, you might end up dropping messages in production. Operation cost can be higher than the development cost. Managing such applications in the production is a nightmare. 

Following is the high level design that I suggested and implemented in most of the microservices I implemented. 
![Alt Circuit Breaker Patter](https://dev-to-uploads.s3.amazonaws.com/i/mkuil5l8bj072gaspuil.jpg)

It is important to make sure that microservice should NOT consume next event if it knows it will be unable to process it. The microservice should retry, wait, recover, raise alert if required. AWS Lambda re-processes the event if function throws an error. I have leveraged this feature in some of the exception handling scenarios. It is crucial for each Microservice to have clear documentation that involves following information along with other details

1. All possible exceptions
2. Happy flow logs
3. Errors and explanation in detail 
4. Type of errors - Functional / Recoverable / Non-Recoverable / Recoverable on retries (restart)
5. When to set an Alert
6. Memory and CPU utilisation (low/normal/worst)
7. Add metrics for each type of error 

If you have these details in place, supporting and monitoring application in production would be effective and recovery would be quicker.