teleren/devto huggingface dataset:
Azure CDN Purge in Azure Devops using PowerShell command using Azure CLI
Published: 2022-07-05 10:46:47

---
title: Azure CDN Purge in Azure Devops using PowerShell command using Azure CLI
published: true
date: 2021-12-03 12:04:09 UTC
tags: 
canonical_url: https://lkgforit.com/azure-cdn-purge-in-azure-devops-using-powershell-command-using-azure-cli
---

## CDN Purge cache:

Azure CDN is efficient for static websites which can store the content in nearby CDN servers cached values so that the website is faster in response for users. So, if we have updated the content in the storage account where the Azure CDN is pointed to then we must purge or refresh the cached contents in the Azure CDN servers so that all the users are getting updated files.

We can purge the Azure CDN content using the following comment using Azure CLI:

```
az cdn endpoint purge --content-paths
                      [--ids]
                      [--name]
                      [--no-wait]
                      [--profile-name]
                      [--resource-group]
                      [--subscription]

```

### Required Parameters

- --content-paths The path to the content to be purged. Can describe a file path or a wildcard directory.

### Optional Parameters

- --ids One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

- --name -n Name of the CDN endpoint.

- --no-wait Do not wait for the long-running operation to finish.

- --profile-name Name of the CDN profile which is unique within the resource group.

- --resource-group -g Name of resource group. You can configure the default group using az configure --defaults group=.

- --subscription Name or ID of subscription. You can configure the default subscription using az account set -s NAME\_OR\_ID._\*\*_

## Azure Devops Task for Purge CDN

Below is the task which we can use inside the Azure Devops Pipeline to execute the purge command in Azure CDN to clear and update the cache in CDN servers.

We are giving **_--no-wait_** so that we don't wait till the CDN is getting purged. If we don't have this parameter flag set, then this task will wait till the CDN content is purged fully.

```

  - task: AzureCLI@2
    displayName: "Azure CLI: Purge CDN"
    inputs:
      azureSubscription: $(azureSubscription)
      scriptType: "ps"
      scriptLocation: inlineScript
      inlineScript: |
        az cdn endpoint purge -g $(azureResourceGroupStorageAccount) --profile-name $(cdnProfileName) --name $(cdnEndPoint) --no-wait --content-paths "/path-of-folder-to-purge/*"

```

## Reference:

[https://docs.microsoft.com/en-us/cli/azure/cdn/endpoint?view=azure-cli-latest#az\_cdn\_endpoint\_purge](https://docs.microsoft.com/en-us/cli/azure/cdn/endpoint?view=azure-cli-latest#az_cdn_endpoint_purge)
Top Drone Delivery App Development Companies
Tags: machinelearning, javascript
Published: 2021-12-03 11:42:10

Instant gratification has become a global trend, and ecommerce businesses who can employ drones to ship and deliver things quickly stand to benefit significantly. Companies that build drone apps are in high demand. Drones in the logistics business are projected to boost e-commerce store revenues. If you are finding top drone delivery mobile app development companies you may read more.

**Foomotion:**
Foomotion is an emerging <a href="https://www.foomotion.io/">software development company in San Francisco</a>. As a leading software and app development company, the Foomotion team has served firms such as Cape with <a href="https://www.foomotion.io/drone-app-developers">drone app development</a>. they have developed an app that allows drone based live video streaming. The Foomotion team has a lot of expertise planning and developing drone apps for a variety of industries, such as education, entertainment, and logistics.

**Folio3:**
Folio3 is a California-based drone delivery app development company for entrepreneurs and Fortune 500 companies. They believe that electric flying taxis i-e drone could be the next big thing, ferrying people and goods high above congested roadways. Because drones are growing popularity, they aim to be the top drone delivery app development company.

**Devtechnosys**
Drone technology next generation technology, often known as robotics, is already in the works. Another app development company that can create drone delivery mobile applications is Devtechnosys. Many ecommerce companies distribute goods to customers while simultaneously attempting to innovate and adopt new delivery techniques, and drone delivery is getting popular in many countries. Devtechnosys team can develop drone delivery mobile applications.

**Belitsoft** 
Belitsoft is a leading app development firm with offices in the United States, the United Kingdom, and France. As a drone app development partner, they collaborated with one of the world's largest drone firms. We created an app to assist with drone deliveries. Belitsoft is a software solutions firm that was started in 2004 and has now expanded to 200 employees.

**Devteam**
Need assistance developing a drone control app but lack the necessary skills or experience? Please contact the DevTeam. Space is a prominent drone delivery app development business that has created drone apps for delivery companies on both iOS and Android platforms. They have a validated community of specialist development teams, each of which has deep knowledge of a specific tech stack or product type.
Don't mix Tailwind with CSS
Tags: css, tailwindcss, react, javascript
Published: 2021-12-03 11:41:31

Tailwind is the new kid on the block; it's fast, it's got a tiny footprint, and it encourages a new way of working in component-based architectures. That being said, it gets a lot of hate in the Frontend community and it's easy to see why.

## The problem

Followers of traditional HTML-CSS-JS workflows complain that it works against the principles we have all followed for the past 10-20 years of web development. Keeping all your styles in one place makes sense, and makes life much easier when it comes to maintaining a frontend. If you use a methodology like BEM, you can understand where the styles for a component will be just by reading the class name.

When we add Tailwind into a traditional frontend, every one of these principles goes straight out the window. Styling is no longer confined to one area or file type - it's split between CSS, HTML and sometimes even JavaScript. We might change a CSS property, only to realise there's a Tailwind class that overrides it completely. All of this leads to a mess that is difficult to understand and maintain. The choice between the two approaches should be either-or: No mixing Tailwind with CSS.

## So it Tailwind actually bad?

Tailwind, just like regular CSS, can work beautifully if used correctly. As is often the case with styles, the issues start to appear in droves as soon as we misuse the technology and ignore the rules that keep developers sane. Poorly written CSS is just as confusing as misused Tailwind.

This technology is still in it's early stages, but I'm a huge advocate for Tailwind and have used it in quite a few different projects. I've written more about why it's so good, and particularly how to use it, in my other articles:

*   [6 reasons to use Tailwind over traditional CSS](https://charliejoel.dev/blog/6-reasons-to-use-tailwind-over-traditional-css)
*   [How to keep Tailwind DRY](https://charliejoel.dev/blog/how-to-keep-tailwind-dry)
*   [How to love Tailwind](https://charliejoel.dev/blog/how-to-love-tailwind)
Top 10 trending github repos of the week👠.
Tags: hacktoberfest, programming, education, firebase
Published: 2021-12-03 11:37:29

---
title: Top 10 trending github repos of the week👠.
published: true
description: Most popular trending Github repos in this week.
cover_image: https://images.unsplash.com/photo-1627399270231-7d36245355a9?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=MnwxfDB8MXxyYW5kb218MHx8Z2l0fHx8fHx8MTYzODUzMTQzOA&ixlib=rb-1.2.1&q=80&utm_campaign=api-credit&utm_medium=referral&utm_source=unsplash_source&w=1080
tags: hacktoberfest,programming,education,firebase
series: Weekly Github top 10
---
GitHub is where over 65 million developers shape the future of software, together. Contribute to the open source community, manage your Git repositories, review code like a pro, track bugs and features, power your CI/CD and DevOps workflows, and secure code before you commit it.

Here is the most popular repos published on this platform.

## #1
![social banner of repo](https://opengraph.githubassets.com/09d8ad57646662d2c02c0ea875140b61905132d101b26ff7e80169bc24c994bf/phoboslab/qoi)
{% github phoboslab/qoi %}

## #2
![social banner of repo](https://repository-images.githubusercontent.com/214587193/00f59f00-90a6-11eb-8764-f49e3f731458)
{% github supabase/supabase %}

## #3
![social banner of repo](https://opengraph.githubassets.com/7e27165247d793837f1f0e7c446bbde63f9426e92715256904a373f91035f1ca/PaperMC/Paper)
{% github PaperMC/Paper %}

## #4
![social banner of repo](https://opengraph.githubassets.com/531eab3f63f6980b45a8dda0c06964a151cc17a6bb83ca123aefac9ed07618fe/mpcabete/bombcrypto-bot)
{% github mpcabete/bombcrypto-bot %}

## #5
![social banner of repo](https://opengraph.githubassets.com/d00ecf15a3295d9616638061786be29b07f38235956d4b2e9d2e11b2e825752d/papers-we-love/papers-we-love)
{% github papers-we-love/papers-we-love %}

## #6
![social banner of repo](https://opengraph.githubassets.com/d760e9fb73edc457c46eda8614f21e95ca1dbd512e57ae148240076c5e83ecd9/EbookFoundation/free-programming-books)
{% github EbookFoundation/free-programming-books %}

## #7
![social banner of repo](https://opengraph.githubassets.com/89d0826a893b8bcd6e634bb00238a6db469d3a533e40eeb1fc025a54a4911f88/PaperMC/Starlight)
{% github PaperMC/Starlight %}

## #8
![social banner of repo](https://opengraph.githubassets.com/ddf8fd13224165a40be8d4ed0b386777c1d9d42bf8efae00ce09da29eff7e744/google/filament)
{% github google/filament %}

## #9
![social banner of repo](https://opengraph.githubassets.com/0092b19f274e8be841ba48b35b348fa711bdbf798787b0c66e7a576cfae5e865/jesseduffield/lazygit)
{% github jesseduffield/lazygit %}

## #10
![social banner of repo](https://opengraph.githubassets.com/90cae22aba2f8a17f7e27034161e557e52d3d9e8c38ba493987ff6c8f88906ac/freeCodeCamp/freeCodeCamp)
{% github freeCodeCamp/freeCodeCamp %}

Enjoy these repos.
Follow me for more articles.
Thanks 💖💖💖
Comment or No Comment's in Code
Tags: javascript, enginners, devs
Published: 2021-12-03 11:16:49

Comment or No Comment in Code

It's a general convention "Always comment your code".
Comments in code usually serve different purposes/intents:

- Removing a block of code without deleting it
- Extra information about a block of code, method, class, or its usage
- Change annotations (use git please) and why the change
- "In-solution documentation"

“Any fool can write code that a computer can understand. Good programmers write code that humans can understand.”

Matin Flower said the above (not me please), it's pointing out that developers should write code that humans can read, in my view, a self-documenting code.

I put comments in my code, especially if it is JavaScript because I can have a similar experience to typescript by using comments to explain method return types, parameter types, etc. but I also strongly hold the opinion that sometimes comments can be redundant and can be a source of noise to the code. For example, a user service that checks if a user session is still active named "checkUserSessionIsActive" is descriptive enough within its namespace and wouldn't need extra comments around it to explain what it does.

Also, I have seen developers use comments to apologize because they choose not to refactor, well that's bad, please don't use comments to apologize.

What is your take on this as a CTO, Developer Experience Engineer, etc do you comment on your code and why?
Java Programming #2: Data Types
Published: 2021-12-03 11:09:52

When talking about programming and coding, it cannot be far away from **Data**. Data by definition means an individual fact, and one example of a fact is the number. In the context of programming, there is a thing called **Data Types**. From the name itself, Datatype literally means the type of data. The data types in Java is often be refering as the **primitive data types**.

---

### 1. Primitive data types
There are three most common data types used in Java (you can refer to the rest of the types [here](https://www.baeldung.com/java-primitives#:~:text=2.-,Primitive%20Data%20Types,about%20memory%20management%20in%20Java)), in which are **int (Integer), double (Double), and char (Character)**.

Integer is the type of data that is used to store **whole number**, in which is the number that consists of 0, 1, 2, 3, 4, ... (contains no fractions). Double is the type of data that is used to store **decimal number**, in which is the number that consists of 0.1, 0.2, 0.3, 0.4, ... (contains fractions). And finally, Character is the type of data that define a **character**, such as 'a', 'b', 'c'. 

You might ask, how about a text? is there any way that Java can define the datatype of a text? The answer is YES, in Java there is a thing called **String**, String is a "Wrapper" class and I will cover this in later article.

---

### 2. Implementation in Java
The following is the coding along with its explanation:
```java
int chicken;
double cow;
char bird;
```
The above code is the example of the data type implementation in Java. For you that wondering what is "chicken", "cow", and "bird" are, they are the "variable", and is used to store a data / value. To define the data type of a variable, a certain keyword needs to be placed beforehand. 

Let us see the variable `chicken` in here, this variable is an **Integer** variable, because the keyword `int` is placed before the variable name. The same concept is also applied with the `cow` in which a **Double** variable and lastly the `bird` that is a **Character** variable.

---

Alright, in this article we have seen what is a data type and how to implement it in a variable in Java. Eventhough the variable is already defined with its own data type, we have not define its value yet!, but do not worry, as in the later article, I will show you how to assign a value to each variable corresponding to their own data type.

---

I hope that my article helps you to getting started in learning Java programming language. You can give this article some comments, as any feedback is very valuable and important to me (also suggest me some ideas that you think I need to cover). Thank you for reading this article, and have a nice day :smiley:

---

**References**
- https://www.baeldung.com/java-primitives#:~:text=2.-,Primitive%20Data%20Types,about%20memory%20management%20in%20Java
- https://i.picsum.photos/id/730/1920/1080.jpg?hmac=zgyUxfPyOloYiT9MqMUZr8D-nVVZkhvm5EG2R1rTq7Q
Check to see if your NodeJs project has a network.
Tags: javascript, beginners, programming, tutorial
Published: 2021-12-03 11:04:20

With two distinct approaches, you may determine whether your web app has <kbd>connection</kbd> or not. 

![no network](https://media.giphy.com/media/T9JZeV9yvD7sWksx4d/giphy.gif)



## Method 1 🥦
```Javascript

require('dns').resolve('www.google.com', function(err) {
    if (err) {
        console.log("No network connection");
    } else {
        console.log("Connected to network");
    }
});

```

---

## Method 2 🥦

First, install the package `npm install internetAvailable`
```Javascript
const internetAvailable = require("internet-available");

internetAvailable().then(function(){
    console.log("Internet available");
}).catch(function(){
    console.log("No internet");
});

```

## Practical Example in a <mark>Nodejs</mark>
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nwyje26z6ta317jjxwah.PNG)
 
## Result
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4sg6f95qb3ms4xzqqzdv.PNG)
 

---

## Conclusion
If you choose, you can alternatively send the response to the <mark>Front End</mark>. I hope you found this article useful.
Thank you for taking the time to read this, and may the <kbd>Node force 👨🏾‍</kbd> be with you.



---
Improve Your Coding Skills & Productivity
Tags: javascript, react, codenewbie, node
Published: 2021-12-03 11:03:12

## Inspiration 

If you're following me on [LinkedIn](https://www.linkedin.com/in/yogesh-chavan97/), then you might already know that I regularly share useful tips, tricks & articles to help others.

Many developers found the content useful But I was not having any resource where you will find my all tips, tricks and article together.

And Because "A lot of my connections asked me whether I have a single resource where they can find the useful tips and tricks I share regularly and which are also shared in my lot of articles and tutorials."

And the answer was always **No**. So I wanted to create such a resource that is quick and easy to access whenever needed in the future.

## Launch of Ebook

So, I'm very excited to announce the launch of [130+ Tips, Tricks & Resources](https://tipsntricks.netlify.app/) ebook today.

The ebook includes:

-  HTML, JavaScript, CSS, React, Node.js Tips & Tricks
- Useful JavaScript Code Snippets
- List of Useful Articles and Tutorials
- Resources of Preparing for Interview

and a lot more.

This ebook will help you to improve your coding skills and productivity.

As a part of the launch offer, only for 2 days (Dec 03 - Dec 04), you will get the book  at just **$8** instead of the regular price of **$13**.

Also, you can get my [Mastering Modern JavaScript](https://modernjavascript.yogeshchavan.dev/) book and [Mastering Redux Course](https://master-redux.yogeshchavan.dev/) at just **$8** instead of the original price of **$13** and **$19** respectively.

I have also added a combined package where you can get both the books and the course at just $20.

**I have never offered such a huge discount and will never be offered again so get your copy of the course and book today.**

I'm sure you will find it useful. 

That's it about this short annoucement.

**Click the below image and get your copy of the ebook.**

[<img src="https://tipsntricks.netlify.app/book_cover.jpg">](https://tipsntricks.netlify.app/)
Let there be light 💡
Tags: codepen
Published: 2021-12-03 10:52:28

<p>Based on <a href="https://dribbble.com/shots/3032158-Switch-On-Off-DailyUI-015">Switch On/Off - DailyUI #015</a> by <a href="https://dribbble.com/lanars">lanars.</a></p>

{% codepen https://codepen.io/dilums/pen/eYgPrNq %}
Best React practice for component which both polls and submits ?
Published: 2021-12-03 10:43:20

Hi all,

I'm on a project which was coded well before I arrived but I'm wondering if it could better adhere to React principles; I'm looking for recommended general approach here rather than code-level fixes - hope that's OK. I should point out that it's an old React version and some callbacks are deprecated but I can't upgrade right now.

There's a JSX which is responsible for displaying live values from an air-conditioning unit back-end, e.g. a room temperature setpoint, fan speed, on/off mode, louvre direction - that sort of thing.

componentWillReceiveProps() is called; the new props contain all the current values and these are used to set state. As a result, render() is called and live values are now displayed. OK so far ?

The values on the screen are adjustable through various toggle/increment/decrement buttons; the design is such that a change of value isn't sent back instantaneously on a click of those controls but has to be confirmed with a separate SAVE button. Since the values sent to the back-end are now in line with what's displayed (assuming no errors, just to keep things simple in this example), then no further action is required.

However...

I've been asked to add a polling facility to the JS which requests a refresh of the live values every few seconds. I've done this with a simple setInterval(function) approach. Without going into transport details, this causes a fresh callback to componentWillReceiveProps() every ten seconds containing the latest polled values.

It 'works', but there's an issue. Say the current fan speed is MEDIUM. The user decides to change it to HIGH by clicking a 'selector' button but then, for some reason, dawdles and doesn't click SAVE straight away. On screen, the fan speed control has been changed from MEDIUM to HIGH but, all of a sudden, a poll occurs; the existing live value comes back through, the screen re-renders, and the value now returns to MEDIUM before the user has had chance to click the SAVE button. One confused user!

I think the way I would rather this work is as follows. The React detects that the user has changed from MEDIUM to HIGH but knows that SAVE hasn't been clicked yet to confirm submission of the change to the back-end. When the poll occurs and the next props arrive, the logic should detect this value-changed-but-not-yet-submitted condition and NOT set state using the newly polled props -- until, that is, SAVE (or CANCEL) is clicked and this event can be used to reset the condition.

Am I making this too complicated ? Is there a standard way in which React props/state/callbacks should handle this scenario without adding any of my own logic like this ?

Just some pointers please ?

Thanks
Scrapping weather data from google for live climate updates
Tags: android, webdev, python
Published: 2021-12-03 10:32:32

Web scraping is the process of using bots to extract content and data from a website . web scraping extracts underlying HTML code and, with it, data stored in a database. The scraper can then replicate entire website content elsewhere . Web Scrapers can extract all the data on particular sites or the specific data that a user wants. So, when a web scraper needs to scrape a site, first the URLs are provided. Then it loads all the HTML code for those sites and a more advanced scraper might even extract all the CSS and Java script elements as well. Then the scraper obtains the required data from this HTML code and outputs this data in the format specified by the user. Mostly, this is in the form of an Excel spreadsheet or a CSV file, but the data can also be saved in other formats, such as a JSON file. 


**Why python's used mostly for scrapping:**
Python's a most popular language these days and can be handled smoothly because of its easily understandable syntax. It is also predominantly used for scraping because of its variety of libraries which makes us do less work.

**Beautiful soup**

is a Python library that is highly suitable for Web Scraping. It creates a parse tree that can be used to extract data from HTML on a website.

**Requests**
Requests allows you to send HTTP requests extremely easily. This module also does not comes built-in with Python. So we can install it using pip install requests
Note: Same goes with every library in python

**Code**:

```
import requests
from bs4 import BeautifulSoup
#have to specify the city name before requesting the info
city = "chennai"
url = "https://www.google.com/search?q="+"weather"+city
info = requests.get(url).content
soup = BeautifulSoup(info, 'html.parser')
#After that using BeautifulSoup object we can search for the information and retreive it
temperature = soup.find('div', attrs={'class': 'BNeawe iBp4i AP7Wnd'}).text

```