teleren/devto huggingface dataset:
Creating a VSCode extension for all other extensions
Tags: vscode, extensions, tooling
Published: 2021-07-08 12:32:11

Earlier this week, I wanted to a couple of action buttons to the Visual Studio Code sidebar. To do this, you will need to register a button for the activity bar and create a view panel to show your sidebar actions.

As this extension would only have two to three actions, it would be a bit overkill, but the use case was still there. A button makes it easier than searching the command in the command palette. This use case made me wonder, can I create an extension that another extension can use to share or enhance their experience.

I wanted to make it easier for extensions to add their actions to a side panel without too much overhead. With this idea in mind, I started developing.

## The extension

The extension I created is the [Extension panel](https://marketplace.visualstudio.com/items?itemName=eliostruyf.vscode-extension-panel), and it offers a sidebar view panel which allows other extensions to link their actions to it.

![Example of how it is used for the Writing Style Guide extension](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s39s9do9ti4y2juaxllr.png)

## The communication flow

As extensions run in their context, I needed to find a simple way to make it possible to share the configuration between them. 

The trick here is to use a VSCode command. The extension panel code, will try to execute the `<publisher>.<your-extension-name>.panel.registration` command. To register your extension, all you need to do is specify this command with a configuration like this:

```typescript
context.subscriptions.push(vscode.commands.registerCommand('<publisher>.<your-extension-name>.panel.registration', () => {
		return {
			id: '<your-extension-name>',
			title: 'Extension actions',
			description: 'Actions for testing purposes only.',
			actions: [{
				title: 'Action 1',
				command: 'vscode-extension-panel.panel.test',
				data: true,
				type: "checkbox"
			}, {
				title: 'Action 2',
				command: 'vscode-extension-panel.panel.test',
				data: 'Just extra text',
				type: "button"
			}]
		};
	})
);
```

When the extension panel's code executes the registration command, it will retrieve the specified configuration and show the defined actions.

When there is no registration command present, it will fail internally and skip the extension.

If you are an extension developer for Visual Studio Code, add your actions without writing a whole new sidebar panel. I recommend you to give the [Extension Panel](https://marketplace.visualstudio.com/items?itemName=eliostruyf.vscode-extension-panel) a try.

PS: If you would use the extension, please submit a PR to add your extension to the README.
Migrate all of your repos from Github to Gitea
Tags: github, gitea, bash, migrate
Published: 2021-07-08 12:26:57

So I’ve been thinking about using a self-hosted Gitea instance for a while now, but there was one thing holding me back : the import from Github.

There is an import feature in Gitea but it’s limited to single repositories, and I had around 60 to import. Needless to say I didn’t want to import them one by one, and so I went to my best friend : Google.
I found many tools for importing from Gitlab, from Gogs and other things I didn’t need, but nothing to bulk import from my Github organisation. Well, I did found one but of course it was not working.
So I dug in the Github and Gitea documentations and this is what I came up with, which worked flawlessly !


## How to use
You'll need some basic dependencies
```bash
sudo apt update && sudo apt install -y git jq curl sed
```

## The script
Here's what's inside. 

```bash
#!/bin/bash

GITHUB_USERNAME=
GITHUB_TOKEN=
GITHUB_ORGANISATION=

GITEA_USERNAME=
GITEA_TOKEN=
GITEA_DOMAIN=
GITEA_REPO_OWNER=



GET_REPOS=$(curl -H 'Accept: application/vnd.github.v3+json' -u $GITHUB_USERNAME:$GITHUB_TOKEN -s "https://api.github.com/orgs/$GITHUB_ORGANISATION/repos?per_page=200&type=all" | jq -r '.[].html_url')

for URL in $GET_REPOS; do

    REPO_NAME=$(echo $URL | sed 's|https://github.com/$GITHUB_ORGANISATION/||g')

    echo "Found $REPO_NAME, importing..."

    curl -X POST "https://$GITEA_DOMAIN/api/v1/repos/migrate" -u $GITEA_USERNAME:$GITEA_TOKEN -H  "accept: application/json" -H  "Content-Type: application/json" -d "{  \
    \"auth_username\": \"$GITHUB_USERNAME\", \
    \"auth_password\": \"$GITHUB_TOKEN\", \
    \"clone_addr\": \"$URL\", \
    \"mirror\": false, \
    \"private\": true, \
    \"repo_name\": \"$REPO_NAME\", \
    \"repo_owner\": \"$GITEA_REPO_OWNER\", \
    \"service\": \"git\", \
    \"uid\": 0, \
    \"wiki\": true}"

done
```

## How to exec
* Copy this and put it in a file named import.sh (or whatever you want)
* Give the script execution permissions :
    ```bash
    chmod +x import.sh
    ```
* You need to fill in the variables at the top before you can run it
* Exec !
    ```bash
    ./import.sh
    ```

If all went well, your should have transfered all of your repos to your new Gitea instance.

You made a mistake and don't want to delete the repos all one by one ? Here's the bonus script.
```bash
#!/bin/bash

GITHUB_USERNAME=
GITHUB_TOKEN=
GITHUB_ORGANISATION=

GITEA_USERNAME=
GITEA_TOKEN=
GITEA_DOMAIN=
GITEA_REPO_OWNER=

GET_REPOS=$(curl -H 'Accept: application/vnd.github.v3+json' -u $GITHUB_USERNAME:$GITHUB_TOKEN -s "https://api.github.com/orgs/$GITHUB_ORGANISATION/repos?per_page=200&type=all" | jq -r '.[].html_url')

for URL in $GET_REPOS; do

    REPO_NAME=$(echo $URL | sed 's|https://github.com/$GITHUB_ORGANISATION/||g')

    echo "Deleting $REPO_NAME if it exists on Gitea ..."

    curl -X DELETE "https://$GITEA_DOMAIN/api/v1/repos/$GITEA_REPO_OWNER/$name" -u $GITEA_USERNAME:$GITEA_TOKEN -H  "accept: application/json"

done
```

That's all folks. 
Have a good morning, and if I don't see you good afternoon, good evening and good night !
A Clean and Simple Internet Speed Test
Tags: tools
Published: 2021-07-16 23:20:56

---
title: A Clean and Simple Internet Speed Test
published: true
date: 2021-07-08 12:09:00 UTC
tags: tools
canonical_url: https://dils.blog/a-clean-and-simple-internet-speed-test/
cover_image: https://dils.blog/content/images/2021/07/Cloudflare-Internet-Speed-Test.png
---
I like  [Clouldflare’s Speed Test](https://speed.cloudflare.com/) . Its clean and simple without any ads or cruft. It just starts up and shows your internet speed without a fuss.

More of these please.
Daily Developer Jokes - Thursday, Jul 8, 2021
Tags: jokes, dailydeveloperjokes
Published: 2021-07-08 12:00:08

---
title: "Daily Developer Jokes - Thursday, Jul 8, 2021"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
cover_image: "https://private.xtrp.io/projects/DailyDeveloperJokes/thumbnail_generator/?date=Thursday%2C%20Jul%208%2C%202021"
published: true
tags: #jokes, #dailydeveloperjokes
---

Generated by Daily Developer Jokes, a project by [Fred Adams](https://xtrp.io/) ([@xtrp](https://dev.to/xtrp) on DEV)

___Read about Daily Developer Jokes on [this blog post](https://xtrp.io/blog/2020/01/12/daily-jokes-bot-release/), and check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/).___
### Today's Joke is...
![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e12590a84b94.png)

---
*Have a joke idea for a future post? Email ___[xtrp@xtrp.io](mailto:xtrp@xtrp.io)___ with your suggestions!*

*This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit.*

<!-- 
Joke text:
___Q:___ What are computers' favorite snacks?

___A:___ Microchips, phish sticks, and cookies. But just a few bytes of each.
 -->
Javascript sort array of objects
Tags: javascript, programming
Published: 2021-07-08 11:45:02

Before trying to sort array of objects in javascript, we must check if all objects in that array has a common property name.

For example, below is our sample object:

```js
let obj = [
{a: 2, b: 1, c: 3},
{a: 7, c: 8},
{b: 0, c: 5}
];
```

Can you identify the common property name among all the array objects? Yes, ‘c’ is the common property among all the objects. So, we can sort these objects by the property ‘c’.

Next, we have to check what is the data type of the common object property. An object can have multiple types of properties. Type means data type of any property. In this article, I have explained the three most commonly used type based sorting.

### Three most commonly used object property based sorting in javascript.

- *Sort array of objects in javascript by a string property*
- *Sort array of objects in javascript by number property*
- *Sort array of objects in javascript by date property*

There are many approaches that we can use to code all three of these solutions. Manually we can compare object to object by property values and sort objects. Go for it and give it a try if you love solving algorithms problems.

Or, we can use inbuilt javascript functions to quickly code these solutions. For this article we are going to use the `sort()` function.

If you do not know what is a `sort()` function then do not worry. I am going to explain it next.

The sort function is powerful. It is easy to use and reduces the requirement of any external library for sorting.

The `sort()` function takes only one parameter, a compare function. Compare function contains the logic that performs an in-place comparison between two values and applies sort logically.

### Below is an example, to sort an integer array in ascending order.

```js
var numbers = [40, 100, 1, 5, 25, 10];

numbers.sort(function(a, b){return b-a});

console.log(numbers);  // [1, 2, 5, 10, 25, 40, 100]
```

[Read more...](https://anjandutta.com/javascript-sort-array-of-objects)
How to participate in the Web Monetization Workshop
Tags: webmonetization, interledger, webdev, event
Published: 2021-07-08 11:36:01

The countdown is on to Web Monetization [workshop](https://dev.to/coil/announcing-the-web-monetization-workshop-wmw-2oid)! And we hope you'll join us on July 28th at [workshop.webmonetization.org](https://workshop.webmonetization.org/).

There are many ways to participate in the workshop, and you can choose one or more of the options below!

---

### 1. Attend to watch the project Showcase
To attend the event and watch the project Showcase, RVSP at [workshop.webmonetization.org](https://workshop.webmonetization.org/). Only your email is required.

---

### 2. Submit topics for discussion
Is there a feature you would like to see supported in Web Monetization? Is there a challenge you have experienced working with or talking about Web Monetization? Or do you have new ideas or general feedback about the Web Monetization API, specification, documentation, or adoption? If yes, please share them, and we will curate them to be discussed during the workshop. You can create a new issue on the [Web Monetization Github repo](https://github.com/WICG/webmonetization/issues) or reply below, and we will include it in the list.

---

### 3. Join the technical discussion session
The topics submitted above, alongside other community feedback received in the last few months, will be curated and discussed at the technical architecture session. The purpose of the architecture session include:

- In-depth technical discussion on the declarative and imperative APIs
- Discussion of community feedback
- Update of the Web Monetization specification from agreements reached during the discussion

Session 1 will be led by Ben Sharafian, CTO of Coil, and Session 2 will be led by Marcos Caceres, Co-chair of Web Applications WG at W3C. Contact [Uchi](https://dev.to/uu) or email devs@coil.com to receive more information.

View the schedule at [workshop.webmonetization.org/schedule](https://workshop.webmonetization.org/schedule).

---

### 4. Showcase your project
If would you like to do a 3 - 5 minute demo of your Web Monetization project, please reach out to [Uchi](https://dev.to/uu), reply below, or email devs@coil.com to receive more information.


See you on **July 28**  at [workshop.webmonetization.org](https://workshop.webmonetization.org/)!


---
_**Updated July 8, 2021.**_
Conditional Statements
Tags: csharp, beginners
Published: 2021-07-08 11:31:20

Sometimes, we need to do things based on information we have.
For these scenarios, we have the conditional statements such as `if`, `else`, `if else` and `switch case`.

## if statement

The if statement enters if the condition returns true.

### Structure

```csharp
if(*condition is true*)
{
   // Execute this code block
}
```

### Example

```csharp

int x = 10;
int y = 5;

if(x - y == 5)
{
   // Do some work
}

// More awesome work

```

## else statement

The `else` statement works only after a `if` statement and it's called if the condition in the `if` statement above is false

### Structure

```csharp
if(*condition is false*)
{
  // This code block will not execute.
}
else
{
  // Execute this code block
}
```

### Example

```csharp
int x = 10;
int y = 5;

if(x - y == 10)
{
  // Will not execute this code block
}
else
{
  // Execute this code block
}
```

A good thing to notice, is that the `else` statement will hit every time the `if` statement is false.

## if else

If you need to check for different values, there's the `if else` statement.

### Structure

```csharp
if(*condition is false*)
{
  // Will not execute this code block
}
else if (*condition is true*)
{
  // Execute this code block
}
```

### Example

```csharp
int x = 10;
int y = 5;

if(x - y == 10)
{
  // Will not execute this code
}
else if (x - y == 5)
{
  // Will execute this code
}
else
{
  // Will not execute this code since the condition above was met
}
```

## && and || operator

### &&

The `&&` means `and` in programming language, which indicates that both checks must returns true.

```csharp
int x = 10;
int y = 5;

if(x == 10 && y == 5)
{
  // Will execute since x value is 10 and y value is 5
}

if(x == 10 && y == 4)
{
  // Will not execute because the value of y is not 4
}
```

### ||

The `||` means `or` in programming language, which indicates that at least one of the checks must returns true.

```csharp
int x = 10;
int y = 5;

if(x == 10 || y == 5)
{
  // Will execute since x value is 10 or y value is 5
}

if(x == 10 || y == 4)
{
  // Will execute because the value of x is 10
}
```

## switch case

The `switch case` statement executes a single section from a list of candidates based on a pattern.

### Structure

```csharp
switch (*value to look for*)
  case *scenario 1*:
    // code block
    break;
  default:
   // Will be called every time if no candidates are found.
   break;
```

### Example

```csharp

int useThis = 2;

switch (useThis)
{
  case 1:
    // This will not be called because we're looking for 2
    break;
  case 2:
    // This code block will be executed.
    break;
  default:
    // This code will be called if no candidate is found
    break;
}

```

You can also use the same code block for different values:

```csharp
int useThis = 3

switch(useThis)
{
  case 1:
     // Will not execute.
     break;
   case 2:
   case 3:
     // Will execute if `useThis` values is 2 or 3
   break;
}
```
Angular Change Detection
Tags: angular, tips, webdev, inspiration
Published: 2021-07-08 11:20:30

---
title: Angular Change Detection
published: 2 August 2021
tags: angular, tips, webdev, inspiration
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0nbrddp4opzrx3watpp0.png
published: true
canonical_url: https://blog.kuncevic.dev/angular-change-detection
---

💫 **The "magic glue" that connects the view and the model, keeping them both in sync.**

Angular Change Detection is one of the most complex topics in software engineering and obviously in Angular as it is relying on that a lot. It can definitely be compared to the **"magic glue"** that connects the view and the model, keeping them both in sync".

On a broader scale, it is a mechanism built into Angular that allows Angular to decide what actions can be performed when the state of the app changes. The good news is that most of the time, developers do not have to deal with change detection manually.

However, if you find yourself caught in a loop, the only way to simplify your journey is to follow specific strategies, for example OnPush and trigger change detection manually if you need to. 

There are four ways you can trigger change detection manually. Let’s look at them in detail:

**tick() on **[ApplicationRef](https://angular.io/api/core/ApplicationRef)** **that activates change detection for the entire application by staying consistent and respectful to the strategy component of the change detection.

**detectChanges() **on [ChangeDetectorRef](https://angular.io/api/core/ChangeDetectorRef)  runs change detection on a current component.

**markForCheck()** on [ChangeDetectorRef](https://angular.io/api/core/ChangeDetectorRef) controls change detection through the marked components where the OnPush strategy has been set.

**run() **on** **[NgZone](https://angular.io/api/core/NgZone) that allows you to execute a function inside the Angular zone. This function, and all asynchronous operations in that function, trigger change detection automatically at the correct time.

Here is a very handy tip, which can simplify your life. 


![Untitled design (1).png](https://cdn.hashnode.com/res/hashnode/image/upload/v1625739160735/O-BQFW3Ed7.png)

If you want to learn more listen to [Angular Change Detection Episode](https://angularrocks.com/episodes/angular-change-detection) at [angularrocks.com](https://angularrocks.com)
Best 6 Free Icons Pack For Web Dev And Designer
Tags: webdev, css
Published: 2021-07-01 16:03:37

This post repost from:- https://the-dev-community.blogspot.com/best-6-free-icons-pack-for-web-dev-and

#Ricon v.1 Demo — 240 Essential Interface Icons
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o2te0mrvt3ikavnx6ilt.png)
A growing pack of 240 fully vector icons. Icons are based on a 24px grid system and balanced among each other using common proportions, curvatures, and white spaces. The set is designed to save your time and enhance your design - no matter if it's a 
website, mobile app, slide deck, or print design.

link :- https://remadesign.gumroad.com/l/ricon

#Blobs Icons
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ka4enujihh68c067630k.png)
Enjoy a custom set of icons made to be highly customized. Change colors and sizes without having to worry about scalability issues. Add a unique look and feeling to your design and express more with less text.

link :- https://www.baianat.com/freebies/blobs

#Gamer Life Free Icon Pack
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9jhg914zoxgmahlsax4k.png) 
Check out this free icon pack made by Aakash Raj Dahal. A nice collection of free icons related to video gaming that you can use for web and mobile application interfaces. Icons are available in SVG, PNG, AI, and Figma file formats. All the 250 icons come in two weights: regular and light. Again, thanks to Aakash Raj Dahal for creating and sharing these free icons.

link  :- https://themeui.net/gamer-life-free-icon-pack/ 

#Comercily – eCommerce Free Icon Set
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ub2zwc9hiuy5rqx9o3bh.png)
Here is a nice little freebie from Dipa Inhouse. Comercily is a free icon set for eCommerce and any transactional websites. The kit includes 40 well-crafted scalable vector icons. Icons are available in Figma, Sketch, SVG, EPS, and PNG file formats. Again thanks to Dipa Inhouse for sharing this freebie!

link :- https://themeui.net/comercily-ecommerce-free-icon-set/

#Free Christmas Icons Set
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bt7h7hjom3vhb6fe16m7.png)
On the occasion of Christmas, Iconscout has designed for us special Christmas icons that come in three different styles line, flat, and colored outline. The icons come in PNG and SVG formats. You can use them anywhere you want. They are free of cost and can be used in both personal and commercial use.

link :- https://themeui.net/free-christmas-icons-set/

#Line Icon Pack
A set of free icons that started as a side project. Now it has 320+ icons and still growing. A nice design resource you can use for your next project. The freebie is compatible with today’s popular design tools. Huge thanks to Petr Bilek for providing us with this awesome free icons.

link :- https://themeui.net/line-icon-pack/

**Note:-** visit my youtube channel for frontend tutorials

**subscribe to my youtube channel :-** https://www.youtube.com/channel/UCR64vQptythbJ1SmI-ub0Rg

**Resent post :-** 
{% link https://dev.to/innocentcoder/top-5-best-resources-to-learn-javascript-e3p %}
Call of Data Program
Published: 2021-07-08 11:05:58

# Overview
Like other crypto networks, Bluzelle has a chicken and egg problem. Developers want to use infrastructure that is battle-tested for security and availability. But the only way to be battle-tested is to have developers use it.
To address this we’re launching an incentivization program named Call of Data. DeFi networks use token incentives to build up initial traction and create network effects. We are doing the same. BLZ holders are incentivized to create and upload data sets that are stored on Bluzelle. The benefits are:
1. Network activity increases
2. Validator nodes begin to earn more fees
3. More validators are encouraged to join
4. Bluzelle network becomes more decentralized
5. Developers have data sets they can use for their applications
6. More developers use Bluzelle to store their data and use the data
7. Increases network activity

## How it Works
Call of Data is a specific application built on Bluzelle. BLZ holders sign-in on the app and upload data sets to Bluzelle. Bluzelle will offer suggestions of what kinds of data sets to create, but participants can upload whichever data sets they want. After the data set is uploaded, the participant needs to gather votes for their set in order to reach the top rankings. Those in the top rankings earn BLZ rewards. Each week the contest restarts. The goal is to keep having datasets uploaded and compensate people for their work. To prevent bad data from spamming the network, we have the crowd-sourced voting mechanism.

Bluzelle has allotted up to $10,000 each week to be given to participants. The more people that participate, the higher the rewards will be.

Call of Data will continue for the foreseeable future with no end period in place for now. The goal is to launch and add features to increase activity until we reach the point that developers are joining the network at an acceptable pace. Call of Data is not meant to be a short-term program but a long-term application that can evolve and be used for other activities for Bluzelle.

## Current Status
Call of Data is currently in Private Beta and is being tested on by selected Bluzelle community members. Once the results are satisfactory, we’ll launch the public beta for all community members to participate. When the public beta is released, we’ll give more details on the game mechanics.