teleren/devto huggingface dataset:
ASP.NET Web API - JWT (JSON Web Token)
Tags: csharp
Published: 2021-08-27 13:34:13

## What is JWT?
JSON Web Token (JWT) is the approach of securely transmitting data across communication channel. For authentication and authorization, it uses the technique of passing digitally signed tokens. JWT comprises of three parts: Header, Payloads and Signature.

Header is used to identity the signing algorithm used and it appears like:

```
{ “alg”: “HS256”, “typ”: “JWT”}
```

Payload looks like:
```
{ “Name”: “Manoj Ramesh”,”Admin”: “true”,”iat”: “146565644”}
```

The signature is created by Base64 encoding Header and Payload as:
```
data = encoded( Header ) + “.” + encoded( Payload )
signature = HMACSHA256 (data, secret key);
```

## JWT in Theory

JWT authentication process can be broken into following 4 steps-

1. User is validated against database and claims are generated based on user’s role.
2. Payload containing claims or other user related data is signed with key to generate token and passed back to user.
3. User sends this token with each request, normally in header or cookies and then received token is decrypted to validate claim.
4. Once user is identified, User is allowed to access Resource server based on his claim.

Advantage of Token based authentication paradigm is that instead of storing authentication or authorization related information linked to every user in session, a single signing key is stored at the authorizing server/service. Task of Authorization can be delegated to any server making it completely decoupled. Users are identified by verifying the claims which was generated in the first step based on his/her permission. Claims can be trusted because it was generated by server in the first step and then was digitally signed using one of the algorithm like HMAC SHA256. It is also assured that rights or claims has not been tampered with.
Unique thing here which saves lots of memory and adds to scalability is that only one key is required at server for decrypting the token and identifying the user, no matter what number of users it supports.
After identification is done, identity should persist for the current user throughout the request. This is where every implementation may differ. Next section covers all the four steps involved while using JWT token with ASP.NET Web API.

Cheers!!!
disguised pointer in Go
Tags: go
Published: 2021-08-27 13:30:42

ในภาษา Go นั้นมี pointer
ครับ ใครๆก็รู้ ซึ่งก็จะมี operator อยู่สองตัวที่จะมาใช้ก็คือ * และ &

แต่ๆๆ มันมีตัวแปรที่เป็น pointer แต่แกล้งทำหน้าตาไม่เหมือน pointer อยู่ใน Go อยู่หลายตัว ได้แก่

slice, map, chan, interface

4 type นี้เป็น pointer แต่แกล้งทำหน้าตาไม่เหมือน พิสูจน์ง่ายมาก แค่ประกาศตัวแปรลอยๆไว้แล้วถามเลยแบบนี้

```go
	var s []string
	var m map[string]string
	var i interface{}
	var ch chan struct{}

	if s == nil { fmt.Println("s is nil") }
	if m == nil { fmt.Println("m is nil") }
	if i == nil { fmt.Println("i is nil") }
	if ch == nil { fmt.Println("ch is nil") }
```

ผลลัพธ์มันตอบ nil ทั้ง 4 บรรทัดเลย คือไอ้ตัวแปรประเภท pointer เนี่ย มันมี zero value เป็น nil ไงครับ

ด้วยความที่หน้าตามันไม่เหมือน pointer ปกติบางทีเลยอาจจะเข้าใจมันผิด เพราะฉะนั้นวันนี้มาบอกไว้ก่อนเพื่อเป็นข้อมูลนะครับ ส่วนจะมีอะไรให้พิสูจน์ต่อก็คอยติดต่อตอนหน้านะครับ
How to support text direction LTR and RTL in an app
Tags: html, css, javascript, dir
Published: 2021-08-27 12:52:51

When creating a web application in western countries, we want to read it from the left-to-right and from top-to-bottom.

Once you want to support [languages that are read right-to-left](https://en.wikipedia.org/wiki/Right-to-left_script), there are some things we need to configure to make the frontend work for all text directions.

## Set the attribute 

The global [dir](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/dir) attribute can be used on all markup elements to indicate the text direction. We can set three values:
- `dir='ltr'`: text direction left-to-right, ie English.
- `dir='rtl'`: text direction right-to-left, ie Arabic.
- `dir='auto'`: text direction auto, the user agent decides.

The `dir` attribute is inherited and can be overwritten.

When we want to set text direction dynamically depending on the used language or a configuration, it is helpful to write a service that holds the current text direction, so that this value can be used wherever needed.

```
export class TextDirectionService {
  public currentTextDirection = TextDirection.RTL;

  public constructor(public store: Store<AppState>) {}

  public get currentTextDirection$(): Observable<TextDirection> {
    return this.store.pipe(selectCommonTextDirection);
  }

  public setCurrentTextDirection(currentTextDirection: TextDirection): void {
    this.currentTextDirection = currentTextDirection;
    this.store.dispatch(commonUpdateTextDirection({ updateTextDirection: currentTextDirection }));
  }
}
```

Once the service is in place you can set the current text direction, wherever you need it.

```
<div class="content" [dir]="currentTextDirection">
  <!-- content -->
</div>
```


## Style the elements 

Now the text direction changes, depending on the set `dir` attribute value. 
When we use padding, margin, flex-direction or similar properties to style our app, we need to make some styling adjustments, if the text direction is changed.

```
.content {
    display: flex;
    &[dir='ltr'] {
      flex-direction: row;
      border: 1px solid blue;
    }

    &[dir='rtl'] {
      flex-direction: row-reverse;
      border: 1px solid red;
    }
}

``` 


## Handle exceptions

Sometimes we need to use a different text direction for part of the text. For example if we use proper names somewhere in the text.
 
In that case we can use the [bi-directional isolation `<bdi>`](https://www.w3.org/TR/2014/REC-html5-20141028/text-level-semantics.html#the-bdi-element) HTML5 element. 
This is similar to the [bi-directional overwrite `<bdo>`](https://www.w3.org/TR/2014/REC-html5-20141028/text-level-semantics.html#the-bdo-element) HTML element. The difference is that the `<bdo>` reverses the direction. This may lead to unwanted behaviour, so it is more error prune to use the `<bdi>` tag. 

## Native speaker check
When everything is adjusted — generally we want to have everything mirrored — it is always a big win to have a native speaker to check and test the app.
State of Go / Golang in 2021
Tags: go, discuss, webdev, backend
Published: 2021-08-27 12:40:10

What is the state of Go in 2021 in your opinion? Is it worth learning or write applications? 

The performance of apps written in Go is great but for many businesses, that's not enough. Crucial is also stability, the potential of maintenance in long therm and so on. What do you think about the ecosystem around Go language?
My Goals for HNG i8 Intership
Published: 2021-08-15 17:54:31

It was a pleasant morning on August 13th 2021, when i woke up seeing an Email from [I4G X HNGi8](https://internship.zuri.team) inviting me to the slack work space for the internship. I didn't register for the internship but here is how i got the email.

I registered for the prerequisite of HNG, The Zuri training to learn to code as a beginner. I got to the Project Phase but couldn't finish the project with my team because i felt i am not well weaponized to finish up with them. It was fun there and a good foundation for me thanks to all my mentors there.

I read a lot about the Internship on Twitter and how tough it is, so i'm trying to have fun and not push too much pressure on myself while at it. This internship will measure my Kotlin Programming Knowledge, with this program i will be able to know if i'm still at the beginner level or intermediate. Getting to the 6th/7th stage is my goal for this internship and will be so happy with myself for getting to that stage.

If you are new to Tech, here are some links/tutorials for getting you started in tech:

For **UI/UX**, [Figma](https://figma.com) is a vector graphics editor and prototyping tool which is primarily web-based. It is used for designing the interface of web/mobile apps. Here is a Figma tutorial on Youtube {% youtube 4W4LvJnNegA %}

**GIT** is software for tracking changes in any set of files, usually used for coordinating work among programmers collaboratively developing source code during software development. Its goals include speed, data integrity, and support for distributed, non-linear workflows. *Its an essential tool for all programmers at all levels to know*. Here is a tutorial to learn about GIT {% youtube dI_CUlVKrFw %}

For **Android Development** Kotlin is a mordern and concise Language for creating Mobile Application, it is the official programming Language for Android Development. Here is a youtube tutorial to get you started to learn Kotlin {% youtube QsrQV0wXh2E %}

You can follow / learn more about HNG on twitter on www.twitter.com/hnginternship
https://training.zuri.team
https://internship.zuri.team
A New Episode Dropped
Tags: podcast, jokes, career
Published: 2021-08-27 12:33:54

Want to hear some BONKERS news? Taylor Desseyn (the Recruiter Against Recruiters) is interviewed on the episode that just dropped!

Taylor says some recruiters are like celery, and he REFUSES to apologize for this!

{% spotify spotify:episode:4Bb97Mcx8hh8dnW3kgMPJX %}
What You can do with python (Quick 2021 guide)
Tags: python, programming
Published: 2021-08-27 12:14:19

Intro
-----

Everyone after learning basics asks what should I do now and gets confused and sometimes unmotivated so i decided to give some help

Solve problems and Quizzes
--------------------------

I love this one so much because it's very helpful and i recommend it for every beginner. There is a lot of Websites who gives you problems and quizzes to practice with. and here's a list.

1.  [Hackerrank](https://www.hackerrank.com/domains/python)
2.  [LeetCode](https://leetcode.com/)
3.  [CodeChef](https://www.codechef.com/problems/school/?itm_medium=navmenu&itm_campaign=problems)
4.  [Interviewbit](https://www.interviewbit.com/coding-interview-questions/)
5.  [W3schools](https://www.w3schools.com/quiztest/quiztest.asp?qtest=PYTHON)

Learn more
----------

After getting familiar with Python. You should go deeper into learning and more specified. here's a list of what you can learn

1.  AI and Machine learning
2.  Data visualization, and analysis
3.  Web Development
4.  Game development
5.  Cyber security check [Network scanner](https://blog.icodes.tech/2021/08/15/network-scanner-discover-all-ip-address-on-your-network.html)
6.  Mobile apps development
7.  Data science

Projects
--------

The best way to practices what you've learned is by building projects but what kind of projects you can build?

1.  Create a bot
2.  Scrape data from websites -- [Scrape movies from imdb](https://blog.icodes.tech/2021/03/12/pick-random-movie-with-a-python-script.html)
3.  Build a website with web development frameworks
4.  Build an Android app
5.  build a game
6.  Script to automate something [Automate files organizing](https://blog.icodes.tech/2021/06/12/python-files-organizer-automate-boring-files-organizing-using-python.html)

The end.
I would be happy to read your feedback about my programming blog : [blog.icodes.tech](https://blog.icodes.tech/)
Learn From Mistake
Tags: database, mysql, install, macos
Published: 2021-08-27 12:03:45

I started learning MYSQL recently. One big thing happen with me which really blow my mind. Its a common mistake that's why I'm sharing with you.


## Installation process of MySQL
For MacOs

Step 1. Visit the below link
https://www.mysql.com/downloads/

Step 2. Scroll down there you find 
"MySQL Community (GPL) Downloads »"
Click on That

Step 3. Click On
"MySQL Community Server"

Step 4. And here is the main Catch where i did mistake and it consumed my 1 hour to find the error...

You will find two Latest download option for MySQl Community Server
!['Alt Text'](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vmc3mpx3qtz806n3vy4f.png)

Apple have Both architecture Laptop
ARM(M1 chip) and x86(Intel chip) 

I know this still i mistakenly downloaded ARM MySql software.

So Developers do remember this while downloading any software for Apple Laptop...

###Thanks for Reading
How to build SEO friendly website using VueJS?
Tags: vue, javascript
Published: 2021-08-27 12:01:42

Following a particular study, approximately 55% of the JavaScript sites lose rankings because of inadequate JavaScript code handling and SEO resources. Therefore, it will be imperative to make your Vue.js site SEO-friendly to prevent any adversity regarding your product. To do this, you have to understand the different problems in Vue.js and how to fix these problems for obtaining a high ranking for the service or product offered by you.

 
<b>Issues related to SEO with Vue JS</b>

As stated previously, more than 50% of websites lose their rankings because of inadequate JavaScript handling or SEO. Furthermore, there happen to be several problems in terms of SEO with the Vue JS framework. React, and Angular also face identical problems right now.

Below, we have mentioned several of these issues in detail. However, before that, we will take a look at some other essential information.

 
<b>Why use Vue JS?</b>

It is a fact that Vue JS will allow you to get access to big things despite being a small package. If a framework’s size happens to be small, it will be used much more. This happens to be amongst the most notable benefits of Vue JS.

The framework’s size is only 18 KB, which is much smaller than either React or Angular, and users can download it quickly. Vue JS will be able to compete with all the significant frameworks on the market at present. It is being used by lots of well-known websites such as GitLab and Behance.

 
<b>How is it possible to make Vue JS SEO-friendly?</b>

 Make it a point to stick to these practices while making Vue JS SEO-friendly:

    Make use of the Vue Router.

    Use the “History” mode rather than the conventional “Hash” mode.

    Make use of Lazy Loading.

    Include meta tags along with the Vue-meta npm package.

    Use server-side rendering or pre-rendering.

    Enhance the speed of page loading in Vue JS.

    Mobile optimization using material design.

Check out in the detail here: https://www.rlogical.com/blog/how-to-make-a-vue-js-website-seo-friendly/
Enjoy Programming-Themed Humor? Here's today's daily developer joke!
Tags: jokes, dailydeveloperjokes
Published: 2021-08-27 12:00:01

---
title: "Enjoy Programming-Themed Humor? Here's today's daily developer joke!"
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
---

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/5e12591e45d64.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:
___Q:___ Why didn't the `<div />` get invited to the dinner party?

___A:___ Because it had no class!
 -->
GitHub/DevOps status
Tags: cloudmonitoring, devops, github
Published: 2021-08-27 11:43:08

---
title: GitHub/DevOps status
published: true
description: Useful links for checking GitHub and DevOps status
tags: 'cloudmonitoring, devops, github'
cover_image: 'https://raw.githubusercontent.com/Pwd9000-ML/blog-devto/main/posts/2021/Github-Status-Check/assets/main01.png'
canonical_url: null
id: 805154
date: '2021-08-27T11:43:08Z'
---

You can check the status of github in real-time, incl. historical data on system performance, follow incidents or scheduled maintenance by going to: [https://www.githubstatus.com/](https://www.githubstatus.com/).

![gh_status](https://raw.githubusercontent.com/Pwd9000-ML/blog-devto/main/posts/2021/Github-Status-Check/assets/gh_status.png)

Similarly to check the status of Azure DevOps you can use: [https://status.dev.azure.com/](https://status.dev.azure.com/).

![ado_status](https://raw.githubusercontent.com/Pwd9000-ML/blog-devto/main/posts/2021/Github-Status-Check/assets/ado_status.png)

Both status pages also has an RSS feed. In my next article/tutorial I will show how to create an Azure Logic App that will notify you when any of the services become degraded.

{% link <https://dev.to/pwd9000/devops-github-service-notifications-using-azure-logic-apps-124e> %}

### _Author_

Like, share, follow me on: :octopus: [GitHub](https://github.com/Pwd9000-ML) | :penguin: [Twitter](https://twitter.com/pwd9000) | :space_invader: [LinkedIn](https://www.linkedin.com/in/marcel-l-61b0a96b/)

{% user pwd9000 %}

<a href="https://www.buymeacoffee.com/pwd9000"><img src="https://img.buymeacoffee.com/button-api/?text=Buy me a coffee&emoji=&slug=pwd9000&button_colour=FFDD00&font_colour=000000&font_family=Cookie&outline_colour=000000&coffee_colour=ffffff"></a>
Howto Install Brave Browser on Ubuntu 20.04
Tags: ubuntu
Published: 2021-08-27 11:25:58

---
title: Howto Install Brave Browser on Ubuntu 20.04
published: true
description: Notes about how to install Brave Browser on Ubuntu 20.04 Linux
tags: Ubuntu 
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/go3x0afqc9auk1wwo07q.png
---

Installing Brave Browser on Ubuntu 20.04 is quite simple. Here is my steps:

Update apt (optional)
```bash
sudo apt update
```
Download Brave keyring and add to apt:
```bash
curl -fsSLO https://brave-browser-apt-release.s3.brave.com/brave-browser-archive-keyring.gpg &&
sudo mv brave-browser-archive-keyring.gpg /etc/apt/trusted.gpg.d/.
```
Check Keyring (optional):
```bash
apt-key list 2&>1 | grep brave-browser -A6
/etc/apt/trusted.gpg.d/brave-browser-archive-keyring.gpg
--------------------------------------------------------
pub   rsa4096 2018-10-15 [SC] [expires: 2025-03-17]
      D8BA D4DE 7EE1 7AF5 2A83  4B2D 0BB7 5829 C2D4 E821
uid           [ unknown] Brave Software <support@brave.com>
sub   rsa4096 2019-10-17 [S] [expires: 2023-05-06]

```
Add the Brave Browser repo:
```bash
echo "deb [arch=amd64] https://brave-browser-apt-release.s3.brave.com/ stable main" | sudo tee /etc/apt/sources.list.d/brave-browser-release.list
```
Update apt again to fetch brave-browser repo:
```bash
sudo apt update
```
Install the brave-browser:
```
sudo apt install brave-browser
```
You should be able to use your newly installed brave browser now.

That's all...
Algorithmic Trading Architecture on AWS using Zerodha kite API
Tags: aws, architecture, awscommunitybuilders, trading
Published: 2021-08-27 11:16:38

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nlkte5fist6ca4rbgggp.jpg)

Please look into this architecture diagram, I'm using to automate trading signal,

Here I'm using Zerodha's Kite web socket API to fetch tick data of more than 200 securities,
To generate intraday trades using Redis in-memory database and to generate positional trades using dynamoDB database service,

Step 1
Lambda function cron job starts EC2 instance before market opening at every market day
Step 2
Python script connects with Zerodha kite web socket and starts data feeding
Step 3
Python script starts pushing data to a Redis in-memory database
Step 4
Python script resamples and pushes data from Redis to MongoDB, as per the intraday strategies after every fixed interval
Step 5
Lambda function resamples and pushes data from MongoDB to dynamoDB, as per the positional strategies after every fixed interval
Step 6
Python script generates an intraday trading signals and places orders to Zerodha
Step 7
After getting order confirmation from Zerodha, python script pushes order details to dynamoDB
Step 8
Lambda function gets positional trading data, generates a positional trading signals and places orders to Zerodha
Step 9
After getting order confirmation from Zerodha, Lambda function pushes order details to dynamoDB.
Step 10
Python script gets intraday order details from dynamoDB and updates the orders as per the current market price if required
Step 11
Python script updates current orders or cancel and place a new orders to Zerodha
Step 12
Lambda function gets current positional data and update positional orders as per current market price if required
Step 13
Lambda function updates current orders or cancel and place new orders to Zerodha
Step 14
Lambda function square-off intraday open positions, as per individual intraday strategy rules
Step 15
Lambda function square-off all intraday open positions in case of emergency
Step 16
Lambda function cron job starts step function after market closing
Step 17
Lambda function puts all data to S3 from MongoDB and dynamoDB
Step 18
Lambda function stops EC2 instance after complete all steps

Please suggest to me how can I improve this and a new important feature I can add to this.
10 FREE Udemy courses for you to learn JavaScript
Tags: javascript, beginners, programming, codenewbie
Published: 2021-08-27 10:54:53

_If you found value in this thread you will most likely enjoy my tweets too so make sure you follow me on [Twitter](https://twitter.com/VladPasca5)  for more information about web development and how to improve as a developer. This article was first published on my [Blog](https://vladpasca.hashnode.dev/)_

1. Code Your First Game: Arcade Classic in JavaScript on Canvas

https://www.udemy.com/course/code-your-first-game/

2. Programming for Entrepreneurs - JavaScript

https://www.udemy.com/course/programming-for-entrepreneurs-javascript/

3. Start with Javascript (2021)

https://www.udemy.com/course/start-javascript/

4. Javascript Programming For Beginners (2021)

https://www.udemy.com/course/javascript-programming-for-beginners/

5. JavaScript for beginners

https://www.udemy.com/course/javascript-darwish/

6. Fundamentals of JavaScript

https://www.udemy.com/course/fundamentals-of-javascript-mask/

7. Javascript Array Methods

https://www.udemy.com/course/javascript-array-methods/

8.  Pure JavaScript Calculator Code ES6 Learn JavaScript

https://www.udemy.com/course/javascript-code-exercise/

9. JavaScript for QA Engineers and SDETs

https://www.udemy.com/course/javascript-for-qa-engineers-and-sdets/

10. Learn JavaScript, Get Hired | The Essentials

https://www.udemy.com/course/learn-javascript-get-hired-essentials/

_I hope found this useful and if you did please let me know. If you have any questions feel free to DM me on  [Twitter](https://twitter.com/VladPasca5)._
How to Create Multilingual Website in Laravel 8
Tags: laravel
Published: 2021-08-27 10:47:09

Hi Dev,

In this tutorial I will share with you how to create a multilingual website in laravel 8 application, I will show an example of laravel 8 multiple languages.

Here, I will give you a full example of how to laravel 8 multilanguage with language dropdown or laravel 8 multiple language websites as below so follow my all steps.