teleren/devto huggingface dataset:
MojoAuth - Passwordless Authentication Solution
Tags: mojoauth, passwordless, authentication, login
Published: 2022-11-01 06:37:21

---
title: MojoAuth - Passwordless Authentication Solution
published: true
date: 2021-08-25 09:11:23 UTC
tags: MojoAuth, passwordless, authentication, login
canonical_url: https://mojoauth.com/blog/mojoauth-passwordless-authentication/
---

Today, we’re excited to launch MojoAuth — a passwordless login system to authenticate users successfully. Imagine remembering hundreds of passwords you’ve created for different platforms and exactly which accounts they all belong to; we know it’s hard to remember all of them. Sometimes, you recycle an old password and make it less secure, or create a new one and end up forgetting it, then re-generate the password each time. So what’s the solution?

[Read On](https://mojoauth.com/blog/mojoauth-passwordless-authentication/)
How to unstage staged files in git
Published: 2021-08-25 09:07:27

Sometimes we need to remove a file that we added by mistake from git staging. How to achieve this? Bellow are three life saving commands!

```
git reset <file>
```
This command will unstage a single file

```
git reset <folder name>
```
This command will unstage a single folder and its contents

```
git reset
```
This will unstage all due change

You can visit my blog for similar posts <a href="https://kapadev.com/category/git/">blog</a>
4 Useful Django Packages
Tags: django, webdev, python, programming
Published: 2021-08-25 09:00:45

[Django](https://www.djangoproject.com/) is the most popular Python framework, which you can build a robust web application. Django gives more features out of the box other than there are more 3rd party packages which are helpful to make Django application more efficient. So, here is the list of packages I came across and used.

1. [Django REST Framework](https://www.django-rest-framework.org/)

    If you are looking for developing a REST API using Django, then definitely **DRF** is the best and most powerful toolkit for building Web API.
    A small amount of code is enough to transform the existing Django project into a **REST API**.


2. [Djoser](https://djoser.readthedocs.io/en/latest/index.html) 

    Recently, I work on REST API and thought of re-creating **USER MODEL** function  like login, logout, reset-password and other stuffs for every project  is tedious process.  So, I searched for some alternatives and then came across with Djoser package. The Djoser package is an REST implementation of Django authentication system. It provides set of Django REST Framework that handles a basic actions like **login, logout, reset-password, account activation**.

    Djoser allows you to create an user account with CUSTOM_USER_MODEL and social accounts like Google, Facebook. Authentication process is done by using token based authentication and JSON Web Token Authentication.  

3. [python-decouple](https://pypi.org/project/python-decouple/)

    Confidential information should be placed in Environment variables, not in source code. Python Decouple helps you to organize your settings confidential information. It helps us to access that info in environment variables.

4. [django-cloudinary-storage](https://github.com/klis87/django-cloudinary-storage)

    Django Cloudinary storage provides Cloudinary storage for media and static files. A quick and small amount of line of configuration you can start using Cloudinary, so you can serve your static and media files of Django by Cloudinary
ReactNative 
Published: 2021-08-25 08:44:17

Mobile software biggest battle! ⚠

Cross-Platform vs Native.

I spend 3/4 of my day talking with mobile devs, Cross-Platform, Hybrid & Native. Each either loving or hating cross-platform development.

QUESTION
What does the future hold for mobile technologies with software like React Native becoming more popular, what will happen with Native applications??

#tech #mobiledeveloper #crossplatformappdevelopment #nativeappdevelopment #stockholm #sweden
5 Free Developer Resources
Tags: tips, codenewbie, 100daysofcode
Published: 2021-08-25 08:18:28

## 1. FreeCodeCamp

[freeCodeCamp.org](https://www.freecodecamp.org/)

FreeCodeCamp is one of the strong community out there. It has tons of tutorials about frontend and backend. 

You can also **earn certificates** once you finished the course's projects

![Pair Programming](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2rl70bpkl1ztruz1lhbm.png)

## 2. Mozilla Developer Network (MDN)

MDN Web Docs, previously Mozilla Developer Network and formerly Mozilla Developer Center, is a documentation repository and learning resource for web developers used by Mozilla, Microsoft, Google, and Samsung. 

MDN will be **your ansyclopedia** if you are working on web development.

![Bookshelves](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n87n4tb35pgmwwapzkwl.png)

## 3. Dev.to

[DEV Community](https://dev.to/)

[Dev.to](http://dev.to) is a website which developer community can create and share articles with each other. As the name suggests most of the contents are related with development but it can be about motivation, life goals, etc.

![Articles](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wiiwh87ised3df6n5sxg.png)

## 4. StackOverflow

[Stack Overflow - Where Developers Learn, Share, & Build Careers](https://stackoverflow.com/)

We always have some problems when developing an application. Stackoverflow is a place where you find solutions of your problems. You can also provide some answers to those who are experiencing an issue and get rewarded by points which are called **reputation**.

![Study](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w5v8ijfvrgu7yieudjke.png)

## 5. Github

You are developed some projects and looking for a place to save them. Or you want to contribute with the project you love which you know it is open-source. In that case github is a place for you.

Github is your ID when it comes to development. It will show anyone what you built, what are your insterest and what are you working on.
 
![ID Card](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tf44rnavjrkb29agfup3.png)
SQL Lock to give you shock
Tags: sql, mysql, database
Published: 2021-08-25 08:10:00

#Row Lock

A row lock is the lowest level of granularity of locking possible in SQL Server. This means one or more specific rows will be locked, and the adjacent rows are still available for locking by concurrent queries.

#Page Lock

A page lock in SQL Server will lock 8K worth of data even when your query only needs 10 bytes from the page. So your query will lock additional data which you do not request in your query.

#Hobt Lock

When a table is partitioned with "SQL Server Table partitioning" it is possible a Single partition will be locked (Hobt stands for Heap or B-Tree)

**Note**: Lock escalation to HOBT locks is disabled by default. run ALTER TABLE MyTable SET (LOCK_ESCALATION = AUTO) to enable HOBT lock escalation.

#Table Lock

A table lock will lock the complete table.

#What are Data Pages

Microsoft SQL Server organizes all it's data in "Data Pages" which can hold 8K worth of data. This means that for any data access in SQL Server 8K information will be read.

Data pages can only contain information from one table and the layout of a page is well documented on MSDN

The fact that SQL Server will always read a complete data page also gives you an idea why it prefers to use page level locks. The implication of page level locks are that you might lock a lot more data than you think.

For example, assume we have a table with a total record size of 1024 bytes with a clustered index on the field ID. When we run the following query: SELECT * from MyTable (xlock) where ID = 123 not only that record will be locked, but (depending on the page fill) maximum 3 additional records will be locked as well.

##When are these locks acquired

A query will be parsed by the query governor and the required locks will be determined and requested from the lock manager. SQL Server will try to make a balance between performance and contention to determine the locking strategy.

SQL Server also follows a "lock escalation" system which will reduce the granularity of locking when more than 5000 locks of a certain type are being acquired. See this article on lock escalation for more information.

This behavior can be tweaked using locking hints with stress on hints, in a query you can specify per table what kind of locks you would prefer. SQL Server will try to honor your request, but it will still apply lock escalation.
Something about Typescript feels...off
Tags: webdev, typescript
Published: 2021-08-25 07:59:33

**Non-technical post**

I noticed something strange about 2 years ago. *Medium.com* was exploding - bursting at the seams with praises of *typescript*. Just so we are clear, I'm 29 years old and by no means a greybeard meandering the world of software, decrying the good ol' days. It's just that TS was everywhere, all of a sudden. It didn't get the same treatment as other beloved pieces of open source software - it just appeared and filled every nook and cranny of every platform I use for web related consumption. Be it HN, Youtube, Medium, reddit, forums, newspapers...

Perhaps I might be a little bias about Microsoft spearheading anything web related. You could call me a tinfoil skeptic - but these big companies seem to pumping out tools which were normally the domain of the *crazy internet genius dude who works for some backwater agency in the Ukraine*. Come to think of it, *React.js* had a similar trajectory. What is this nagging feeling?

### growth hacking developers

Yep. This might be it.

This is my best hypothesis. We're part of a growth hack. Microsoft, Amazon, Apple, Google and Facebook barely pay taxes, let alone feed the homeless 300m outside their *campuses*, why would those same folks wax lyrical about a *free* web? Google, Facebook, Amazon, Apple and Microsoft basically own web development. React app, written in Typescript on VSCode on a Macbook hosted on EC2/Lightsail instance("free tier")...does that sound too familiar?

We are being vendor locked. This time not with the stick Apple and Microsoft used back in the day, but with a carrot. The web is becoming, quite literally 4 or 5 websites and *other stuff*. Like cattle, we probably won't realize it until it's too late. Let me continue the cattle analogy: Imagine we are cattle in a farm out in the grasslands. We eat juicy grass from damp fields with fresh mountain water in spring. Life is good. The human's dog keeps the foxes and coyotes away, we get injections to keep fleas away and we live in giant enclosures when it's cold. At what point do you realize that the Trader Joe's truck that comes through once in a while is in fact carrying your childhood friend in cold storage? They about to be Ashley's top sirloin and Melissa's Rib-eye.

***

My beloved language Python, it's creator works for Microsoft now. That's the end game. If an eccentric like Guido could not resist the sirenic appeal of cold, hard American cash - what hope do the rest of us have? 

I know some folks are like, "Why you must crazy see? There's so much choice out there it's unbelievable see?" - to them I say - is there?
Cloud Development Services
Published: 2021-08-25 07:47:30

Schedule a Consultation Today with Our Experts & Get Started. Read Vendor Assessment. Accelerate Innovation at Lower Costs, Achieve Faster Time to Market & Drive Revenue Growth. Cloud Managed Services. Multicloud Management. Hybrid Cloud Services.
Visit -: http://elgoss.com
Call -: +91(756)-862-6804
Email -: admin@elgoss.com
What is Bootstrap, Why do we use it?
Published: 2021-08-25 07:46:13

Bootstrap is one of the famous front-end frameworks which is created by former Twitter employees Jacob Thornton and Mark Otto. Bootstrap is free, open source and one of the most famous HTML, CSS, and JavaScript framework for developing the mobile-first and responsive website. You can create the rich-featured responsive site with just basic knowledge of HTML and CSS. Bootstrap provides the wide range of premade template including forms, tables, buttons, typography, navigation, modals, Dropdowns, Alerts, Tabs, Accordion, Carousel and JavaScript plugins.

With Bootstrap, you can create a responsive site easily without wasting a lot of time.

Bootstrap required three main files:

CSS – it is a Bootstrap framework for CSS.
js – it is a Bootstrap framework for JavaScript/jQuery.
glyphicons – it provides the wide range of icon fonts.
You can use jQuery with Bootstrap to add additional features. It is very popular among developers and widely used JavaScript library.

 Originally published at https://www.geeksread.com
Comment About a topic you don't understand
Tags: programming, datascience, algorithms, codenewbie
Published: 2021-08-25 07:40:31

I want you to comment about a topic you don't understand and I will try come with a video offering explanation under 10 minutes.


Topics related to which you can ask question.
1) Web Development
2) Data Structure and Algorithm
3) Basic Programming
4) Data Science
5) Linux
How to use basic translation features in i18next
Tags: i18n, javascript
Published: 2021-08-25 07:17:16

I'll show you how to use basic translation features in [i18next](https://www.i18next.com):
* nested keys
* substitution

# Starting point
We start with the code in the [previous step](https://how-to.dev/how-to-add-simple-internationalization-with-i18next-for-a-browser-application). It's already set up for the node & browser use.

# Code
The complete code to be placed in in `src/index.js`:
```JS
import i18next from "i18next";

const en = {
  translation: {
    hello_world: "hello world",
    nested: {
      key: "This key is was read from nested object",
    },
    great: "Hello {{name}}",
  },
};

i18next
  .init({
    lng: "en", // if you're using a language detector, do not define the lng option
    resources: {
      en,
    },
  })
  .then((t) => {
    console.log(t("hello_world"));
    console.log(t("nested.key"));
    console.log(t("great", { name: "Marcin" }));
  });
```
## Nested keys
It allows us to organize our keys in some logical structure. For example, we could have something like:
```JSON
{
  "dialogBox": {
    "close": "Close"
    "ok": "OK"
  },
  "error": {
     "notEnoughSpace": "Not enough space"
  }
}
```

## Variable interpolation
The basic feature of any i18n library. It allows us to put placeholders in the translation & set the value in the runtime.

# Working application
The code in action:
```shell
$ node src/index.js 
hello world
This key is was read from nested object
Hello Marcin
```

# Links
* [repository](https://github.com/how-to-js/i18next-vanilla)
* [branch]()
* [sign up to be notified about video course](https://landing.mailerlite.com/webforms/landing/z5p5m8)

# Summary
In this article, we have seen how to use basic translation features from i18next.
Speed up migrations when running Laravel tests
Tags: laravel, testing
Published: 2021-08-25 07:15:46

I'm currently doing maintenance on a two year old application. Not that old, right? Eh, sort of.

It was created using Laravel 7. I was able to upgrade to Laravel 8 _and_ PHP 8.0, so that's great! The thing is, I'm now going test-by-test and optimizing and house cleaning. I'm also mad at Past Grant for being lazy.

The application is... big. One of my biggest I've ever built. Like 126-migration-files big. When I went to my first test, I noticed that it took **forever** for it to actually run the test (it failed if you were wondering). When I mean forever, I mean over 11 seconds, which might has well been 11 minutes when I'm staring at the console waiting for it to start.

I remembered when watching the keynote on Laravel 8, Taylor introduced the new feature of [squashing migrations](https://laravel.com/docs/8.x/migrations#squashing-migrations). Let's see what impact it had on my tests.

```bash
php artisan schema:dump --prune
```

This command generates a file in `database/schema` and deletes all my migration files. Before squashing the migrations, it was taking 11.031 seconds according to well placed [Ray](https://myray.app/) call in the `RefreshDatabase` trait:

```php
protected function refreshTestDatabase()
{
    ray()->measure('migrating');
    if (! RefreshDatabaseState::$migrated) {
        $this->artisan('migrate:fresh', $this->migrateFreshUsing());

        $this->app[Kernel::class]->setArtisan(null);

        RefreshDatabaseState::$migrated = true;
    }
    ray()->measure('migrating');

    $this->beginDatabaseTransaction();
}
```

After squashing, it took only 1.396 seconds. That's almost a 90% decrease in time! Now I can spend the next several days fixing all my terrible tests, but they'll at least run faster.
How to use SSH key authentication in Github
Tags: github, git
Published: 2021-08-25 07:10:27

SSH (Secure Shell) is used for more secure access between two parties. ssh is a password-less  communication.There are two keys generated, private key & public key. The public key can be shared to other parties. Though the private key should be kept secret. If you know about cryptography then it would be easy to understand the concept fully. You can watch  [nasser hussian’s](https://www.youtube.com/watch?v=RfolgB-rVe8&feature=youtu.be) video to get some understanding. Though it's not required to fully understand the concept.

(Step confirmed working on Linux)

Open the terminal in root directory
Type  
``` python
ls .ssh
``` 
in your terminal to check if there are any ssh present.

To create one type
``` python
ssh-keygen -t rsa -b 2048 -C ''Youremail@address''
```
It will prompt you to provide the location where the ssh file is to be created press enter to keep default location.
You can add a password for your file, to skip just press enter.

Now again if you again type command

``` python
ls .ssh
```
You may get something like this 
``` python
id_rsa  id_rsa.pub
```
The id_rsa.pub is the public key

``` python
cd .ssh && cat id_rsa.pub 
```
to see the public key

Now copy the key and paste it into [https://github.com/settings/ssh/new](https://github.com/settings/ssh/new)

Now select any repository that you want to clone locally.

You will find an option to select the ssh link for the repo

***git@github.com:organization-name/respo-name.git***

The next steps are 

``` python
git clone git@github.com:organization-name/respo-name.git
```
(be sure to use the device from which the ssh keys was generated)

Now you have successfully set up ssh.

What if you already have repository in your local using http

First open the terminal from the root directory of your repository.
You could check your remote git url using 

``` python
 git remote -v
```
Now to set the ssh url can do

``` python
git remote set-url origin git@github.com:organization-name/respo-name.git
```
Now after this you could do all push pull normally as you would do.
My secret to nail data science interview after 25 failures
Tags: datascience, career, job, interview
Published: 2021-08-25 06:55:17

It was hard and every interview was like an eye opener. You can say, I was the one who was learning from failure. But was it enough to get one success.

I was not sure, because learning was coming in pieces and I was not sure whether my answers are correct or in the right direction. Many times, I lose the point of the questions. It was more like a stressful journey.

Later, my friend suggested me to get help from an experienced data-scientist. Being an experienced data scientist, he/she would know the drill and can certainly become a deal breaker for me.

I started looking for a Data Scientist who is generous enough to help me. After approaching more than 50 people, I was surprised not receiving even one reply. I was shattered.
One day, completely despair I saw one post on the Instagram. A data scientist was helping people like me to prepare for interview not like providing the cheat sheet or question answers, but 1:1. I checked the details and talked to him. He understood my situation and suggested me mock interviews to stimulate the real interview environment and help me where I am wrong or potentially missing the point.

We had 4 mock interviews. Every interview was more like a progressive discussion than a stressful, drilling interview. It helped me understand the interviewer perspective, fine tune my approach and understand the technical depth and even understand the hidden agenda of the questions.

My friend was right. It became a deal breaker for me. I went for my next interview very positively. It was a long interview for 2 hours. Next morning I saw an email from recruiter congratulating me for interview success and asking for availability for final HR round.

The same mentor is extending his help to more people. In case you would like know more about him, click the below link.

https://www.mentorif.com/event/58396148744?utm_source=Dev&utm_medium=blog&utm_campaign=dev-ds-pradip&utm_id=dev-ds-pradip
Migration to Python 3 is still very slow
Tags: python
Published: 2021-08-25 06:53:52

I was just going through Stack Overflow and I realized that people are still asking questions about Python 2.7. Surely, a lot of them are about ways to migrate to Python 3, but still, there were a lot of questions being asked on functionality.

That got me curious and I started researching PyPI package downloads for Python 2.7. I came across [this page](https://packaging.python.org/guides/analyzing-pypi-package-downloads/) and saw how one can look into the number of installations of various libraries for various Python versions.

I specifically used this query to find the number of library downloads per Python version.

```sql
SELECT
  REGEXP_EXTRACT(details.python, r"[0-9]+\.[0-9]+") AS python_version,
  COUNT(*) AS num_downloads,
FROM `bigquery-public-data.pypi.file_downloads`
WHERE
  -- Only query the last 6 months of history
  DATE(timestamp)
    BETWEEN DATE_TRUNC(DATE_SUB(CURRENT_DATE(), INTERVAL 6 MONTH), MONTH)
    AND CURRENT_DATE()
GROUP BY `python_version`
ORDER BY `num_downloads` DESC
```

The results have totally surprised me. There have been more than **5.5 billion package downloads for Python 2.7 just in the last 6 months** and it is **more than the number of installations for Python 3.9!**

![Number of package installations categorized by Python versions](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/utl2qn02mvcgcizgmfva.PNG)
 
This shows that people are not really migrating to Python 3, even with all the support down for Python 2!!

I mean, it both surprises me and confuses me! If anyone reading this is also one of the above, I highly recommend you moving to Python 3 as soon as possible. You are missing out on a lot of advantages. 

Just for you, I wrote this [blog](https://www.pylenin.com/blogs/10-benefits-of-switching-to-python-3/) **to showcase the advantages of Python 3 over Python 2**. If you are interested, please take a look. And if it helps you to move on to Python 3, I would be very happy!
Tabnine officially supports Jupyter Lab  
Tags: jupyter, datascience, python, productivity
Published: 2021-08-25 06:52:25

Hey Jupyter devs, are you tired of typing?

Type less and code more with Tabnine’s all-language AI-powered code completion!

Tabnine officially supports #JupyterLab
https://www.tabnine.com/install/jupyterlab