teleren/devto huggingface dataset:
Use Azure SQL Server with MSI
Published: 2021-07-25 14:27:39

<sub>Photo by <a href="https://unsplash.com/@kylejglenn">Kyle Glenn</a> on <a href="https://unsplash.com/s/photos/identity">Unsplash</a></sub>

I have just read this [interesting blog](https://mderriey.com/2021/07/23/new-easy-way-to-use-aad-auth-with-azure-sql/) about different scenarios [supported](https://docs.microsoft.com/en-us/sql/connect/ado-net/sql/azure-active-directory-authentication?view=sql-server-ver15) by SQL Data client.

I am interested in setting an Azure SQL server with:
- restriction for Managed Service Identity access
- allowing access for developers on only one server easily (without password)
- keeping one limited access

[This tutorial](https://docs.microsoft.com/en-us/azure/app-service/app-service-web-tutorial-connect-msi) covers everything i think.

I can:
- assign a MSI to one Azure SQL Server
- use Visual Studio Code / Visual Studio supported method to authenticate for developer
- create a group, to allow a different account to access SQL Server

[The Default authentication section](https://docs.microsoft.com/en-us/sql/connect/ado-net/sql/azure-active-directory-authentication?view=sql-server-ver15#using-active-directory-default-authentication) worth the read.

And [it seems](https://docs.microsoft.com/en-us/dotnet/api/azure.identity.defaultazurecredential?view=azure-dotnet) not to limit to SQL as the example shows:

```csharp
// When deployed to an azure host, the default azure credential will authenticate the specified user assigned managed identity.

string userAssignedClientId = "<your managed identity client Id>";
var credential = new DefaultAzureCredential(new DefaultAzureCredentialOptions { ManagedIdentityClientId = userAssignedClientId });

var blobClient = new BlobClient(new Uri("https://myaccount.blob.core.windows.net/mycontainer/myblob"), credential);
```

Hope this helps !
web dev intern
Published: 2021-07-25 14:11:45

Today I completed my 1 month web development internship at letsgrowmore and I am very happy to share that it was great experience and learning things at same time .
I have performed my tasks 
task-1 where I created a travel website where you can freely choose to travel the India and select your hotels at the same time 
task-2 it was web app using create react app where I created a food plaza where user can just fetch the data of recipes available in a single click
Next + Tailwind = Awesome Portfolio
Tags: nextjs, portfolio, webdev, tailwindcss
Published: 2021-07-25 13:47:41

Hi everyone. This post contains a link to my new [portfolio website](https://tusharpandey13.github.io/)

It is made using NextJS and TailwindCSS. I did the mockup in figma. It is hosted on github pages, as a static site.

Any constructive critism is welcome! I would love to read your comments about the site.

Cheers ✌️
5 idea for a Java backend developer can do free time.
Published: 2021-07-25 13:31:31

1.Involving Open Source community project like (Apache Kafka, Apache pinot, Apache fineract, Apache tomcat, Spring Project, MySQL, PostGRE, TIDB, Redis, Linux, Kubernetes, keycloak.) Or Involve any interesting project/team that can help in more learning.

2.Learn new tech like BlockChain,DeFI,NFT,AI& Data Science.

3.Continue Programming & DSA practice.

4.Educate Community /Junior or create tech content.

5.Continue Learning(Clean Code, Architecture, Design Pattern, SOLID,DRY, System Design,Security,Performance,Scalability,Distributed System, Micro Service,K8, new language like go, rust, elixir)
Redirect Server Side React
Published: 2021-07-25 13:28:05

Hi all,

I am trying to redirect user when he just copy and paste the link of particular page which appeared after sign in. I only functional component in my code. I also try to add JavaScript redirect rule indies useEffect then it redirect after render whole component which is not good practice. So I try to do that through server side but it gives me error like “window is not defined”.

Anybody help?
I built a note taking app to practice React
Tags: showdev, react, frontend
Published: 2021-07-25 13:19:39

Original Thai version: https://pontakorn.dev/blog/note-taking-app-with-react

I am during university vacation right now so I am kinda free. I have no idea what to do next and just stumble upon Zustand from a discussion about state management tools. So, I decided that I would try to it with React.


## Structure of Starnote

**React**: Yeah, I use React to practice React. Actually, I wanted to try CSS-in-JS solution except there are too few components to even benefit from it. 

**CSS Module**: Since there is no benefit using CSS-in-JS library. I tried using CSS Module instead. At least, I don't have to worry about cascading and naming much.

**Vite**: I use Vite for all projects including React, Vue, or even Svelte. It's easy to setup things and it's fast to reload.

**Zustand**: I found it from [this thread](https://dev.to/nickytonline/what-s-your-go-to-state-management-library-these-days-4kfe/comments). I am interested because it only uses React Hook and not wrapping components.

I use TypeScript for this project because it is easier to find bug and TypeScript has better autocomplete.

## Starnote Development

It is a side project without plan to publish. The MVP version includes CRUD operations, Markdown support, syntax highlighting and saving to localStorage.

![Starnote Project Structure](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0qk3i9fjli9j4c3078q0.png)

**store/note.ts**: This is where I put Zustand store and code working with localStorage. It might be large but I think it's too small to separate into different files.

**TheSidebar and TheEditor**: I only use one component so I prefix them with "The". They both connect with Zustand directly.

There is nothing interesting about development of Zustand enough to put on this blog. I want to write my own CSS so I didn't use WindiCSS or Tailwind. I use ReactMarkdown and ReactSyntaxHighlighter but not markdown editor. It's just a normal textarea.

![Starnote Preview Mode](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d9a6pgpkz858wezy3x6m.png)


## Possible improvement

If anyone tried to use Starnote with mobile, they wil find that it is not responsive yet. If there is anything to improve, I would try this one first. So, I can fully put live demo online.

Also, I would like to implement online saving. Users would be able to edit their notes from anywhere. I don't focus on this part yet. If I get a chance to do, I might try either Firebase or Supabase to not having to write backend.
6 WordPress website mistakes you should never make!
Tags: wordpress, webdev
Published: 2021-07-25 13:15:53

WordPress website brings many benefits for any business due to its user-friendliness, plugins, and eCommerce capabilities. However, some WordPress website mistakes can turn your website into a burden instead.

<b>Scroll down to know and be aware of these blunders. Let do this!</b>

Unsuitable Theme Relative to Your Business Niche
The first mistake people make is to choose a theme not fit best with the brand. Don’t get swamped by the colors and designs of the themes.

<b>Instead, while browsing through the themes, keep in mind:</b>

Does the theme convey your brand values?
Can the theme catch up to your business goals?
Can your mobile users easily navigate through the theme?
Quality coding of the theme
In addition,

Check for the SEO-friendliness
Responsiveness
Cross-browser compatibility
Security
It is best to consult a WordPress Development Agency or asks for a developer’s opinion to avoid such a mistake.

<b>Not Backing Up the Website</b>
The second one from WordPress website mistakes is to rely on automatic backups and doesn’t pay attention to securing the website files.

Unfortunately, website owners, sometimes, due to website crashes, cyber-attacks, data breaches, malware, and so forth, loss their site’s data. Eventually, there is no option left other than spending the thousands of money again.

WordPress has plenty of backup plugins (both free and premium); you can utilize them. Besides, keeping an eye on yourself or via a WordPress Development Agency on scheduling the backups or can save you from site issues and wasting loads of money.

Read More: https://www.navicosoft.com/articles/6-wordpress-website-mistakes-you-should-never-make/

Visit Us: https://cosmeticoplasty.com/
#MyFirstPost #python #Beginners
Tags: python, beginners, firstpost
Published: 2021-07-25 13:07:25

__Problem 1 - If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.__

__Find the sum of all the multiples of 3 or 5 below 1000.__

Solution:
```
total = 0
for number in range(1, 1000):
    if number % 3 == 0 or number % 5 == 0:
        total += number
print(f'The sum of all the multiples of 3 or 5 below 1000 is : {total}')
```
__Solution guidelines__:
1) Assign initial total as 0.
2) Loop over the range from 1 to 999
3) if any number is divisible by 3 or 5
4) Add that number to the total
5) Finally, print the total number
NPM - Fast-repo 🚀🚀
Tags: showdev, opensource, news, javascript
Published: 2021-07-25 12:44:56

*Perform quick actions on one or many repositories.*

* **Repo** - [https://github.com/luctst/fast-repo/](https://github.com/luctst/fast-repo/)
* **Package** - [https://www.npmjs.com/package/fast-repo](https://www.npmjs.com/package/fast-repo)

---

## Why ? 🐙
If you are the type of person who has a lot of ideas, often creates repositories and loves open source ? Then this project is for you.

Fast-repo is a module that literally allows you to create a repository with pre-configured settings, a README and gitignore file depending on the language you use and other features in a few seconds.

## Install
```bash
npm install -g fast-repo
```
> **Note** - We recommend using this version.

Or with NPX
```bash
npx fast-repo <commands> [options]
```

## Usage 🖍
```bash
fast-repo <commands> [options]
```

### Commands 🕹
* **config** [options] - Create the config to be able to perform actions.
* **create** [options] - Create the repository.

> **Note** - Enter `fast-repo --help` for more informations about commands and options available.

## Examples 🙋‍♂️
**First create config folder with the `config --create` command**

It is important to create before running this command a personal token on your github profile and select the `repo` and `delete_repo` scopes. More informations here [github token documentation](https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token)

![Github token scopes](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3bwszh2uxmgxqpvpnhli.png)

**Then create some repositories**

By entering the `create --name=<repo-name>` command a series of questions will be asked in particular if you'll like to create a folder linked to the github repository.
By default if no `-p`, `--path` flag is present we'll be using the `process.cwd()` function to determine where to create this folder, enter the `-p` flag with a new path to clear the old one.

**Delete one or more repositories**

![Delete repo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zu2m27zg1dryqfn4b2t6.gif)

---

If you like this project and want to contribute, do not hesitate to clone the repository and put a little like 🌟😇🌟

* [https://github.com/luctst/fast-repo/](https://github.com/luctst/fast-repo/)

Happy coding ! 🦄✨
How to Rotate Background Image
Tags: css, image, tricks
Published: 2021-07-25 12:35:15

It is as simple as adding a before or after element inside a container

```css
.container {
  position: relative;
  overflow: hidden;
}

.container::before {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  z-index: 10;
  background: url(background.jpg) 0 0 repeat;
  transform: rotate(30deg);
}

```
Some Underrated HTML Tag
Tags: html, css, webdev, firstpost
Published: 2021-07-25 12:22:21

## Address Tag
The `<address>` HTML element indicates that the enclosed HTML provides contact information for a person or people, or for an organization.
![Address Tag](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zqgrqz93beaf1vrs3aec.PNG)

Output: 
![Address Tag Output](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a19as5lh8kkz95bxyy6u.PNG)
## Output Tag
In the following example, the form provides a slider whose value can range between 0 and 100, and an `<input>` element into which you can enter a second number. The two numbers are added together, and the result is displayed in the `<output>` element each time the value of any of the controls changes.

![Output Tag](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sro09vn1svraf1awzaml.png)

Output: 
![Output Tag  Output](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3oujae0zeig1krb7efee.png)
## Datalist Tag
The `<datalist>` HTML element contains a set of <option> elements that represent the permissible or recommended options available to choose from within other controls.
![Datalist Tag](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gqqwsetm4zgvvscp1f4x.png)

Output: 
![Data List Output](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jcd25d5cx9luv7dh6rfc.png)

Reference: [https://developer.mozilla.org/en-US/docs/Web/HTML/Element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element)​

Want to read More, [Click Here](https://beginners-developer.blogspot.com/2021/07/some-underrated-html-tag.html?utm_source=dev2&utm_medium=post&utm_campaign=SOME+UNDERRATED+HTML+TAG+%284th+post%29%20-%206284687)
How to CRUD dynamically in Entity Framework
Tags: csharp, dotnet, entityframework
Published: 2021-07-25 12:19:01

This topic is mainly focused on performing CRUD operations using entity framework at runtime. That is, we can choose to which **Table/DbSet** we can CRUD data.

##### Prerequisite
Lets create a DbContext `MyDbContext` with 2 DbSets `Animals` and `Birds`.

```csharp
public class MyDbContext : DbContext
{
	public DbSet<Animal> Animals { get; set; }
	public DbSet<Bird> Birds { get; set; }
}

public class Animal : LivingThing
{
	public int NumberOfTeeths { get; set; }
	public int RunningSpeed { get; set; }
}

public class Bird : LivingThing
{
	public int MaxFlyingDistance { get; set; }
	public int IsHerbivorous { get; set; }
}

public class LivingThing
{
	public int Id { get; set; }
	public string Name { get; set; }
}
```

###Create
* To create an instance of a `Animal` or `Bird` entity. First get access to the `DbSet<>` by its name. Then take the first `Type` from its generic arguments.

```csharp
var entityType = _dbContext.GetType().GetProperty("Animals").PropertyType.GetGenericArguments().FirstOrDefault();
object livingThing = Activator.CreateInstance(entityType) as LivingThing;
```
* `Activator` can be used to create an instance of a given 'Type'. 
* Now you can set commonly available properties such as `Id` and `Name` directly and properties which are specific to an entity can set using reflection.
```csharp
livingThing.Id = 1;
livingThing.Name = "Tiger";

// Set other properties dynamically
Dictionary<string, int> otherProperties = new Dictionary<string, int>()
{
	{ "NumberOfTeeths", 10 },
	{ "RunningSpeed", 50 },
}

// This will set all the properties which are specific to a class.
foreach(var prop in otherProperties.Keys)
{	
	string propertyValue = otherProperties[prop];
	livingThing.GetType().GetProperty(prop).SetValue(livingThing, propertyValue);
}
```
* Add the entity
```csharp
_dbContext.Add(livingThing);
_dbContext.SaveChanges();
```
###Read
* Get the IQueryable<> property through reflection
```csharp
var linqQuery = _dbContext.GetType().GetProperty("Animals").GetValue(_dbContext) as IQueryable<LivingThing>;
var entity = linqQurey.Where(x => x.Id == 1).First();
```
###Update
* Get the entity by `Id`, update properties and call `SaveChanges()` to update the entity.
```csharp
var linqQuery = _dbContext.GetType().GetProperty("Animals").GetValue(_dbContext) as IQueryable<LivingThing>;
var entity = linqQurey.AsTracking().Where(x => x.Id == 1).First();
entity.Name = "New Name";
...
...
_dbContext.SaveChanges();
```
###Delete
* Get the entity by `Id`. Use `Remove()` to delete the entity.
```csharp
var linqQuery = _dbContext.GetType().GetProperty("Animals").GetValue(_dbContext) as IQueryable<LivingThing>;
var entity = linqQurey.AsTracking().Where(x => x.Id == 1).First();
_dbContext.Remove(entity);
_dbContext.SaveChanges();
``` 

**Thanks for reading...**
Is this link canon? Depends on the relationship.
Tags: html, cloudfront, latency
Published: 2021-07-25 12:17:22

Since I began posting on Medium and DEV Community, I have learned that it's a good idea to let search engines know they are the same content on different URLs. I have also just realised that you could let people read what you wrote on Medium without the paywall, and am a little surprised that HTTP/2 is not enabled by default on AWS CloudFront.

- **HTML**: having a canonical link (`<link rel="canonnical" href="https://example.com" />`) in your HTML helps prevent content duplication in search engines, good for SEO.

- **SEO**: to add a canonical link on DEV Community, use the front matter `canonical_url`. As for Medium - on your post, open up Story settings > Advanced Settings > check *"This story was originally published elsewhere"* and provide a canonical link.

- **Medium**: Friend Link grants free access to your post, find it on your post > Story settings > Promotion > Friend Link.

- **AWS CloudFront**: distributions don't support HTTP/2 by default. Check the settings manually, or on CloudFormation, add `HttpVersion: http2` to `DistributionConfig`.

- **Latency**: Hibernia Express / GTT Express is a submarine fibre-optic link that provides latency of under 60 milliseconds, which costed hundreds of millions to complete. Latency can be really expensive.

Thank you for reading and do let me know your thoughts about this post. If you want more content like this to be delivered to you, consider subscribing via Substack: [smallpotatodev.substack.com](https://smallpotatodev.substack.com/)

### Related Links

- RFC 6596 - the canonical link relation: [datatracker.ietf.org/doc/html/rfc6596](https://datatracker.ietf.org/doc/html/rfc6596)

- Google Search Central Blog - specify your canonical: [developers.google.com/search/blog/2009/02/specify-your-canonical](https://developers.google.com/search/blog/2009/02/specify-your-canonical)

- DEV Community - editor guide: [dev.to/p/editor_guide](https://dev.to/p/editor_guide#front-matter)
- Medium - about Friend Links: [help.medium.com/hc/en-us/articles/360006543813-About-Friend-Links](https://help.medium.com/hc/en-us/articles/360006543813-About-Friend-Links)

- AWS CloudFront distribution config with CloudFormation: [docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-distributionconfig.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-distributionconfig.html#cfn-cloudfront-distribution-distributionconfig-httpversion)

- Hibernia Express on Business Wire: [businesswire.com/news/home/20150924005286/en/Hibernia-Express-Transatlantic-Cable-Route-Connects-New-York-to-London-in-under-58.95-Milliseconds](https://www.businesswire.com/news/home/20150924005286/en/Hibernia-Express-Transatlantic-Cable-Route-Connects-New-York-to-London-in-under-58.95-Milliseconds)
Elasticsearch: Search & Query
Tags: elasticsearch
Published: 2021-07-25 12:15:13

####Agenda
* Source
* Pagination
* Sort
* Score
* Keyword
* Search for multiple terms
* Search with id
* Search with range values
* Search with date
* Search non null
* Search with prefix
* Search with wildcard
* Search with regular expression
* Full text query
* Matching phrases
* Multi*match query
* Bool query
* Name query
* Metrics aggregations
* Bucket aggregations
* Nested aggregations
* Filtering out documents
* Defining bucket rules with filters
* Range aggregations
* Histograms

Code: https://github.com/codebangkok/elastic

####ติดตามผลงานได้ที่
Page: https://fb.com/CodeBangkok​
Group: https://fb.com/groups/msdevth​
Blog: https://dev.to/codebangkok
YouTube: https://youtube.com/CodeBangkok
A Fun Programming Joke To Start Your Day
Tags: jokes, dailydeveloperjokes, watercooler
Published: 2021-07-25 12:00:19

---
title: "A Fun Programming Joke To Start Your Day"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
published: true
tags: #jokes, #dailydeveloperjokes, #watercooler
---

Hi there! Here's today's Daily Developer Joke. We hope you enjoy it; it's a good one.

![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e1258b924543.png)

---

For more jokes, and to submit your own joke to get featured, check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/). We're also open sourced, so feel free to view [our GitHub Profile](https://github.com/dailydeveloperjokes).

### Leave this post a ❤️ if you liked today's joke, and stay tuned for tomorrow's joke too!

_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:
A programmer's significant other tells them, "Run to the store and pick up a loaf of bread. If they have eggs, get a dozen."

The programmer comes home with 12 loaves of bread.
 -->
Create a Netflix clone from Scratch: JavaScript PHP + MySQL
Tags: javascript, webdev, mysql, tutorial
Published: 2021-07-25 11:56:43

In the beginning of the year,we challenge ourselves to clone twitter from scratch using php,mysql and javascript.

{% youtube b5bc24w3Tos %}

In this month,we are going to challenge ourselves by cloning a movie streaming website just like netflix using php,mysql and javascript.

Demo Video for what we are going to create:
{% youtube pB-kqGBJStw %}

 > Note: Videos used in the intro video are for demo purposes. We will be using 'free to use' content in the course - not actual licensed videos.

Do you want to become an expert in JavaScript, PHP and MySQL?

Do you want to build a real video streaming site just like Netflix?

If so, you’re in the right place! This course will guide you step by step in creating your own Netflix clone COMPLETELY from scratch.

We’re talking the kind of website that will amaze anybody that sees it. The kind of website that will get you hired in no time!
Okay so what’s the course about?

I will personally guide you, step by step, in creating your own video streaming site just like Netflix complete with:

User registration

Movie streaming

TV Show streaming

Live search system

Email Verification

and much more!

Whether you are a complete beginner* or an experienced programmer, this course will be massively beneficial to you.


If you like my work, please consider
[![Buy me a coffee](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jm11knj7d8zwcvo150q2.png)](https://www.buymeacoffee.com/cglikpo)
so that I can bring more projects, more articles for you

If you want to learn more about Web Development, feel free to [follow me on Youtube!](https://www.youtube.com/c/ChristopherGlikpo)
The Best Way to Learn Python (Beginners-Friendly)!
Tags: python, beginners, tutorial, programming
Published: 2021-07-25 11:25:25

The best way to learn Python is finally here. This project features everything a beginner or intermediate needs to know to become an expert. It features a simple yet effective way of learning with snippets of example code to show you. It walks you through many functions and encourages you to try them yourself. In fact, updates would be steadily coming at least every day. Check it out:
https://github.com/MatthewTamYT/LearnPython