teleren/devto huggingface dataset:
How to use private Nuget feed from Docker
Tags: dotnet, nuget, docker
Published: 2020-04-12 15:53:47

Previously, i have tried to use private Nuget feed hosted on Azure DevOps but face the issue to pass credentials to access it from Docker and perform the restore without nuget.exe.

It turns out the point has since been solved by Microsoft.

The solution is to use a [this tool](https://github.com/Microsoft/artifacts-credprovider) made by Microsoft and pass a Personal Access Token (PAT) in the Docker. I use a multi stage build so the credentials will be ephemeral.

The Github provides a [sample](https://github.com/microsoft/artifacts-credprovider/blob/master/samples/dockerfile.sample.txt) on how to use it.

Hope it helps !

[Credit for the idea!](https://github.com/microsoft/azure-pipelines-tasks/issues/6135#issuecomment-439272181)
Data Catalog Tagについて調べた（2020/04/10）
Tags: datacataloggcp
Published: 2020-04-12 15:53:24

### 調査の意図
- カラムの統計値など、メタデータの拡充と管理がしたい
- LyftのamundsenやLinkedinのdatahubのようなものはデカすぎるかつ、将来的にはGCPのData Catalogが同等の機能を有するので、できれば避けたい
  - [コチラ](http://mindtide.hatenablog.com) に詳しくまとめられていた。ありがたい
- data catalogのtagを使うと任意のメタデータを設定できそうなので調べてみる

### Tag

- 型ありのメタデータをテーブルやカラムに付与可能
- tag templateを設定しないと付与できない

### Tag template

- templateを作った上で、tableもしくはcolumnに付与する
- 複数のテンプレートを付与できる
- テンプレートはあとでフィールド追加・削除可能
- テンプレートはあとでREQUIRED制約を外すことが可能
  - 逆は不可能
- 削除は、テンプレート付与済みのテーブル・カラムにも影響を与える
- 設定した値は、catalogの対象テーブル上でのみ閲覧可能。グラフ化などもないので、可視化はかなり弱い
- APIで操作可能

### 一旦の結論
- Data Catalogを、LyftのamundsenやLinkedinのdatahubのような本格的なメタデータ管理として使うのはまだ難しそう。
- Data Catalogにメタデータを集中しつつ、メタデータクローラーとビューアを簡易なもので別建てで作るのが妥当か
Code Katas
Tags: challenge, algorithms, learning, javascript
Published: 2020-04-12 15:38:59

There are many ways to grow your software engineering skills. Learning algorithms, building tools, creating websites, crafting games.

## Earn Engineering Honor

One method I've been enjoying lately is participating in <a href="https://www.codewars.com/r/CUDs2Q">codewars.com</a>.

You earn honor by solving problems ("Katas") and contributing to the community. Some Katas take 15 minutes to solve, some require researching the internet and paging through your favorite algorithm book.

The gamified platform provides a web-based editor, a test framework and thousands of problems to choose from.

Want to learn JavaScript, Python, Go or Elixir? Katas exist for 50+ languages.

Once you've solved a problem, you unlock all the solutions that others created. You learn a lot from all the various approaches.

## Monthly Code Katas

This is even more fun when run as a social event.

I participating in a "Code Katas" session hosted by the [SeattleJS Hackers Meetup](https://www.meetup.com/seattlejshackers/).

This is now a 100% remote event anyone can attend via Zoom -- the March 2020 event was the first one held remotely due to COVID-19.

Here's how it works:

* Justin Oliver Lee ([@JustinOliverLee](https://twitter.com/JustinOliverLee)) and Jon Borgonia ([@theRemix](https://twitter.com/theRemix)) who lead the meetup, offer an initial "get to know each other" session for socializing. Classroom space and pizza is often provided by <a href="https://www.galvanize.com/campuses/coworking-space-seattle">Galvanize</a>.

* Then the introductory round of Katas start with Justin posting one coding problem in Slack. Everyone works on it for 20 minutes. Justin has solved many of these problems previously, so is happy to help.

* As people finish, they post their solutions back to a public Slack channel.

* At the end of the round, each person in turn walks through their approaches with the rest of the group. Almost every solution is different -- sometimes in small ways and sometimes in large ways -- but you learn from it.

* After the warm-up, it's time for a second round. Two Katas are posted -- choose one or both to work on. Then there's a third round.

In addition to having fun participating, you've earned some honor on Codewars along the way.

## Next Steps

To find the next scheduled "Code Katas" event, visit the [SeattleJS Hackers Meetup](https://www.meetup.com/seattlejshackers/). If latest event not yet posted, here's the [March 2020 meetup](https://www.meetup.com/seattlejshackers/events/268804072/) as an example of what to expect.

In-between events, keep working away on new challenges at home or with others.

I look forward to seeing you on <a href="https://www.codewars.com/r/CUDs2Q">Codewars</a>.

<img alt="badge for codewars.com/users/briangershon" src="https://www.codewars.com/users/briangershon/badges/small">
Awesome VS Code extensions 2020
Tags: vscode, javascript, beginners, productivity
Published: 2020-04-12 15:35:35

Code editors are essential for a peaceful coding experience ( in my personal opinion obviously ).

I personally use VS Code and find it quite intuitive.

So, here are 5 VS Code extensions that may improve your coding experience in 2020 .
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/qrujtqj71ym0z8cn2l44.png)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/b4al8ap6s8lzxkzmloyj.png)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/sdpiyo53kkcfqzsoirht.png)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/8qehlziu7yip06j84xaw.png)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/lmky15u7lj09qq4h7z54.png)
Start a new VanillaJS, React, Node.js, Eleventy or Svelte project with minimal dependencies
Tags: javascript, boilerplate, eleventy, webdev
Published: 2020-04-12 15:27:46

Each time I start a project I want a minimal template to get going. "Minimal" meaning least complicated and smallest number of dependencies while still having features every JavaScript project needs.

These repositories are all Github templates, so you can create a fresh repo using them.

## Vanilla JavaScript starter

[github.com/briangershon/vanilla-js-minimal](https://github.com/briangershon/vanilla-js-minimal) with minimal dependencies. Support for ECMAScript modules, hot reloading, lint and unit testing. Plus Github CI workflow. 

## React Starter

[github.com/briangershon/react-minimal](https://github.com/briangershon/react-minimal) with minimal dependencies. Support for ECMAScript modules, hot reloading, lint and unit testing. Plus Github CI workflow. 

## Node.js Starter

[github.com/briangershon/nodejs-minimal](https://github.com/briangershon/nodejs-minimal) with minimal dependencies. Support for ECMAScript modules, lint and unit testing. Plus Github CI workflow. Does not require Babel nor a bundler.

## Eleventy Site Generator Starter

[github.com/briangershon/eleventy-minimal](https://github.com/briangershon/eleventy-minimal) is the most minimal [Eleventy](https://www.11ty.dev) site, created as part of my [Choose Your Own Adventure with Eleventy](https://www.briangershon.com/blog/choose-your-own-adventure-with-eleventy/) presentation.

## Svelte Component Library Starter

[github.com/briangershon/svelte-minimal](https://github.com/briangershon/svelte-minimal) compiles Svelte components into ES5 and bundles as an ECMAScript module with minimal dependencies. Support for hot reloading, lint and testing. Plus Github CI workflow.
Bongo Cat Codes #2 - Jamming! JS vs. CSS for animations
Tags: javascript, css, webdev, svg
Published: 2020-04-12 15:25:40

---
title: Bongo Cat Codes #2 - Jamming! JS vs. CSS for animations
description: Bongo Cat animation with GSAP 
tags: javascript, css, webdev, svg
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/6vnsxy7g486k12yp4bhd.jpg
published: true
---

This is my codepen of Bongo Cat listening to some jams by animating SVG 
with [GSAP](https://greensock.com/ %}). 

## Variation with JavaScript (GSAP)

{% codepen https://codepen.io/carolineartz/pen/qBOEzQa %}

I previously did a version with CSS for animation. Comparing the two options, I prefer the JS approach -- much easier to update!

## Variation with CSS 

{% codepen https://codepen.io/carolineartz/pen/VwYwZaP %}
As a software engineer, I should probably write things down. So I built a thing.
Tags: writing
Published: 2020-04-12 15:23:23

### I like writing code but I also like to write.

I read [this article on how software engineers should write](http://www.shubhro.com/2014/12/27/software-engineers-should-write/) about 5 years ago and it still resonates. It's a quick read so please have a look when you get the chance.

As a full-time software engineer, taking notes and simply writing about what happened during my day has served beneficial. At the end of each work day, my team is asked to submit a daily "stand-up" / summary of our day via e-mail. 

---

### So how can I mix writing code with writing?

My teammate at work showed me a bash script that he wrote that automatically made a notes "template" in markdown I was inspired to make something like that for myself. So as a result, I wanted to write one in nodeJS.

...Voila! 

The tool is called `dev-note` and you can check it out [here.](https://github.com/lpcruz/dev-note)

### How it works (I mean...at least for me)

Once you've installed it on your machine, you should have access to the `dev-note` executable. In whatever current working directory you're in, it will automatically create a `/notes` directory along with a Markdown file that is date stamped.

```sh
> dev-note
Looks like this is your first time running dev-journal this month
We made a "notes" directory for your notes. Happy writing!
./notes/apr/2020-04-12.md successfully created!
```

### Example

You can look at the [example note that I made.](https://github.com/lpcruz/dev-note/blob/master/example/notes/apr/2020-04-12.md) It follows a similar template that we use at work:

---

### Notes 2020-04-12
========================

Today
* I made this example note for this repository so I can show it on my dev.to blog
* Had a good chat about `async` / `await` with a co-worker
* I attended this meeting about something I'm interested in so I think I'll keep going

Tomorrow
* Finish refactoring some code
* Call my mom

---

It's only fitting that during these odd times of self-isolation / distancing, writing has served to be therapeutic. 

> Even if nobody reads your essay, writing it will make an impact on you. It will clarify your opinion on a topic and strengthen– or even weaken– your beliefs. The process alone of putting jumbled thoughts into concrete words is valuable.

Happy writing.
Callback solution for useState hook in React
Tags: react, javascript
Published: 2020-04-12 14:55:50

In React class-based components we have this callback that would run after the state has been updated.

```
import React, { Component } from 'react';

class App extends Component {
  constructor(props) {
    super(props);
    this.state = {
      beer: 0,
    };
  }
  
  updateBeerCount = value => {
    this.setState({ beer: value}, ()=>{
      console.log('count updated!, I\'m the callback');
    });
  };

  render() {
    return (
      <div>
        <p>Try increasing the number and check your console!</p>
        <input
          type="number"
          value={this.state.beer}
          onChange={e => this.updateBeerCount(e.target.value)}
        />
      </div>
    );
  }

}

export default App;
```

But in functional components, we don't have any such callback function in useState hook. However, you can achieve this in a cleaner way using useEffect hook with correct dependencies. Check the example below:

```
import React, { useState, useEffect } from "react";

const App = () => {
  const [beerCount, setBeerCount] = useState(0);

  useEffect(() => {
    console.log("count updated! this is run after update!");
  }, [beerCount]); // run whenever beerCount is changed

  return (
    <input
      type="number"
      value={beerCount}
      onChange={e => setBeerCount(e.target.value)}
    />
  );
};

export default App;
```

---
Let's connect: 

Linkedin: [https://www.linkedin.com/in/mubbashir10/](https://www.linkedin.com/in/mubbashir10/) 

Twitter: [https://twitter.com/mubbashir100](https://twitter.com/mubbashir100)
How to change Tabbar appearance using CAShapeLayer in swift 4?
Tags: swift4, ios
Published: 2020-04-12 14:49:36

Hello, I'm new in iOS development,I want to make a tabbar using CAShapeLayer using swift 4? After creating path for tabbar my tabbar is like rectangle. How to create path for tabbar, rounded in both left and right sight top corner?
Here is my stack overflow link for more detail https://stackoverflow.com/q/61138188/11250737
Formatting large numbers in JavaScript
Tags: todayilearned, javascript
Published: 2020-04-12 14:33:28


How to get a formatted number easily in JavaScript that is human-readable with Intl.NumberFormat.

Let's say we want to display three million, 3000000. This isn't that easy to read, you need to look closely to check that it isn't 300,000 or 30,000,000.

```js
const number = 3000000;
const numberToDisplay = new Intl.NumberFormat().format(number)
```

Bonus, it will be formatted according to the users' local settings. For me in Norway, numberToDisplay is 3 000 000. While 'en-US' it will be 3,000,000 and 'de-DE' it is 3.000.000
Angry Chickens 2 - Easter slingshot game with physics [JavaScript]
Tags: javascript, tutorial, game, coding
Published: 2020-04-12 14:28:22

---
title: Angry Chickens 2 - Easter slingshot game with physics [JavaScript]
published: true
description: A fun tutorial - works with touchscreen devices and mouse
tags: JavaScript, tutorial, game, coding
---

[https://slicker.me/javascript/ac2/chickens2.htm](https://slicker.me/javascript/ac2/chickens2.htm)

Here's a demo:

![Angry Chickens 2](https://i.imgur.com/SiFrjTz.gif)
Some ES-6 Features 
Tags: es6, javascript, programming, wevdev
Published: 2020-04-12 14:24:47

##Rest Operator##
The rest parameter syntax allows us to represent an indefinite number of arguments as an array

     function add(num1,...args){ in args it will return array containing numbers
        return args[0]+args[1]
            
     }
      console.log(add(1,3,5));   in args there is 3,5 so the sum will be 8
    



##Spread Operator##
It will unpack the values of a array,this method will not affect a original element but creates copy

     let arr = ["a","b","c","d"]
     let arr2 = ["e","f","g"]
     let newarr = [...arr , ...arr2];    combine both array into new one
     console.log(newarr); result===>  ["a","b","c","d","e","f","g"]
     newarr.push("h");   it will just push into the new array           
     console.log(newarr);   result===>  ["a","b","c","d","e","f","g","h"]

##Template Literals##
It is replacement to single/double quotes,it also gives facility to addd variables or do operations,start with backticks instead of quotes

     var para = ` My Name is         
     Uzair `
     console.log(para); It will include line break in result
    
    
**Interpolate with backticks**
Adding variables in between or performing operations

      var  myVariable = `test1`

**${}** is used to combine variable in it

      var variable2 = `Something ${ myVariable }`  
 you can also perform operation in it

     var variable3 = `sum is ${1+2+3} ` you can also perform operation in it
     console.log(variable2 + variable3)   


**for of loop**
prints all the values of list 
iterates all the elements

     let list = [1,2,7,4,5,6] 
      for(let value of list){
        console.log(value); 
      } result ====> 123456
   
**for in loop**
it will iterate the length / index not elements

    let list = [1,2,7,4,5,6]
           for(i in list){
               console.log(i);
                } 0,1,2,3,4,5   all indexes of array 

##Arrow Functions##
An arrow function expression is a syntactically compact alternative to a regular  function expression,The fat arrows are amazing because they would make your this behave properly, i.e., this will have the same value as in the context of the function

     hello = () => {
         return "Hello World!";
      }

##Sets##
A Set is a collection of unique elements

    const arr = [5, 1, 5, 7, 7, 5];
    const unique = [...new Set(arr)]; // [ 5, 1, 7 ]

##Maps##
The map() method in JavaScript creates an array by calling a specific function on each element present in the parent array.

         var el = document.getElementById('root'); 
         var arr = [2, 5, 6, 3, 8, 9]; 
          
        var newArr = arr.map(function(val, index){ 
            return {key:index, value:val*val}; 
        })     
        console.log(newArr) 
Hope you find this article useful. Please share your thoughts in the comment section.
How to fix Github SSH Issue
Tags: git, ssh, github
Published: 2020-04-12 14:16:46

Today, I was working on Chakra UI and ran into a weird issue with git and GitHub.

I saw this error:

```sh
ssh: Could not resolve hostname github.com: nodename nor servname provided, or not known
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
```

I knew my SSH was there, I had the correct access and repo exists. It was a bit frustrating but I found a walkaround.

Here's the solution I found for macOS users:

1. Go to "System Preference" > "Network"
2. Select the network you're connected to
3. Click "Advanced"
4. Switch to the "DNS" tab and click the "+"
5. Add Google's DNS servers below 👇

```sh
# Here are the DNS servers for Google

8.8.8.8
8.8.4.4
```

That solved the problem!


PS: This is my very first post on DEV.to and I'm using this to flex my muscles in preparation for the other posts coming 😇
Airconsole for free
Tags: airconsole
Published: 2020-04-12 13:43:55

Airconsole is a pretty neat app that can turn any screen into a gaming console for mainly old arcade games.

I like it because there are so few gaming concepts out there that sport split screen multiplayer like them old days.

Starting today its free for two weeks. So I guess that's how Ill be spending easter.

Happy quarantine. Stay safe people.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/dzalzpnfpkex20ixbq3g.jpg)
What is Ansible? Ansible simply explained for Beginners
Tags: devops, ansible, docker, tutorial
Published: 2020-04-12 13:29:00

**Ansible is an automation tool for IT tasks.**

It is **popular and widely accepted**, because 1) it's usage of simple YAML language and 2) support for all types of infrastructure starting from Clouds to Virtual to bare metal servers.

In this video I explain examples of various IT tasks and how Ansible helps automate them to make daily DevOps tasks more efficient and less time consuming. 🙌🏼
 
I explain HOW Ansible does all this by going through its architecture:
- Ansible Modules (small programs that get executed on target machines)
- Ansible Playbook (instructions on HOW these programs get executed)
- Ansible Inventory (list of hosts, WHERE those programs gets executed)

In the end I also show how Ansible makes working with Docker more efficient and powerful and how it compares to similar automation tools like Puppet and Chef.

Happy Easter 🐣🥚🙂

{% youtube 1id6ERvfozo %}

-----------------

I'm happy to connect with you on 🙂
- [Private FB group](https://www.facebook.com/groups/techworldwithnana)
- [Twitter](https://twitter.com/Njuchi_)
- [YouTube](https://www.youtube.com/channel/UCdngmbVKX1Tgre699-XLlUA?sub_confirmation=1)
- [Instagram](https://www.instagram.com/techworld_with_nana/)
Sorting in Python
Tags: beginners, tutorial, python
Published: 2020-04-12 13:12:57

Python has a lot of applications, from chatbots to API's, we have a module for almost everything. But in order to get the most out of it, we should know the basics. One of the basic things in a language that is used almost every now and then is sorting. Here's how to use sorting in Python using the prebuilt methods.

## Options

1. sorted()
2. .sort()

## sorted()

The method that even the Python docs suggest is __sorted__. Under the hood, Python uses [timsort](https://www.geeksforgeeks.org/timsort/).

__Timsort__ is a hybrid sorting algorithm, derived from merge sort and insertion sort, designed to perform well on many kinds of real-world data.
[Here's] a better explanation.

The method takes just a few arguments.

```
sorted(iterable, *, key=None, reverse=False)
```

It's pretty straightforward to understand the arguments.

### iterable

Iterable is any datatype that can be iterated or looped over. Python currently supports tuple, list, or dictionaries.

```python
d = [1, 2, 3, 4, 5]

# Sort using the sorted method
d = sorted(d)
```

### key

Key is a function that takes one argument. Each element that is got while iterating over the iterable is passed as an argument to this function.

The return value of this function is used to compare where the passed arguments position should be.

The default value is __None__.

```python
d = [
  [2, "second"],
  [3, "third"],
  [-1, "first"]
]

# Function to return the zeroth element in each
# object
def getzeroth(el):
    return el[0]

# Sort the dictionary by using the 0th
# element in each object.
d = sorted(d, key=getzeroth)
```

__NOTE:__ We can also use a lambda function instead of defining a whole function.

```python
# Sort using the zeroth element using a lambda
# function
d = sorted(d, key=lambda x: x[0])
```

### reverse

This argument just takes a __bool__ as argument and the default value is __False__. If __True__ is passed then the result will be reversed, i:e the iterable will be sorted in descending order.

```python
d = [1, 2, 3]

# Make the list reverse ordered
d = sorted(d, reverse=True)
```

## .sort()

The __sort__ method sorts the list in place. It is a method of the list class itself so it takes one argument less than sorted. Just like __sorted__ this method uses __Timsort__ under the hood.

This method is usually simpler to use with lists.

The arguments passed are:

```
sort(*, key=None, reverse=False)
```

Just like __sorted__ we can pass key and reverse in this method as well.

```python
d = [1, 5,27, 89, -90]

# Sort the list using .sort
d.sort()
```

This article was aimed at those who are new to Python or even advanced Python programmers but need some kind of a bookmarkable post to look at the sorting methods in Python.

I also write at my personal site [https://deepjyoti30.github.io/](https://deepjyoti30.github.io/) about Python, technology and other stuff. Do check it out.
How I Built FreeCodeCamp - Technical Documentation Page (In a more interesting way) 😃
Tags: codepen, html, webdev, css
Published: 2020-04-12 13:05:45

## Introduction
On a sunny weekend, I started another FreeCodeCamp Certification Project - Building Technical Documentation Page.

## Hesitation
While I could I just create a very simple website to fulfill all the user stories. But I don't feel very good about that for the sake of just passing the tests, completed the project and grab the certification. 

## Bring the project extra mile
Susan Cain took 7 years to write her book - Quiet. Thus, I decided to take an extra effort to create a pretty real documentation website. Here's how the idea came, that I can re-create/revamp some of the API documentation sites that I always visit. I end up choosing the [ExpressJS website](https://expressjs.com/).

The technology and libraries I used in this project:
- HTML
- CSS
- [HighlightJS](https://github.com/highlightjs/highlight.js/) - For syntax highlighting

Codepen link is embedded below and feedback are welcome.

Thank you for reading and have a nice day.

{% codepen https://codepen.io/teklooncheah/pen/qBOBwmo %}