teleren/devto huggingface dataset:
Firebase Authentication – Send Reset Password Email / Forgot Password | Android
Tags: firebase, authentication, android
Published: 2021-04-23 16:22:45

https://grokonez.com/android/firebase-authentication-send-reset-password-email-forgot-password-android

Firebase Authentication – Send Reset Password Email / Forgot Password | Android

In previous <a href="https://grokonez.com/android/firebase-authentication-sign-up-sign-in-sign-out-verify-email-android">post</a>, we have known way to implement Sign up, Sign in/out, Verify Email. Today, we continue to take a look at way to send Reset Password Email in case User forgot Password.

*Note: This tutorial bases on code in related post:
<a href="https://grokonez.com/android/firebase-authentication-sign-up-sign-in-sign-out-verify-email-android">Firebase Authentication – How to Sign Up, Sign In, Sign Out, Verify Email | Android</a>

We just add an Activity to App for handling Reset Password Email and some statements to old code for logic.

<!--more-->
<h2>I. Way to do</h2>
<h3>1. Add Firebase Auth to Android App</h3>
Read <a href="https://grokonez.com/android/firebase-authentication-sign-up-sign-in-sign-out-verify-email-android">Firebase Authentication – Sign Up, Sign In, Sign Out, Verify Email</a> and follow steps to enable and implement Firebase Auth in your Android App.
<h3>2. Send a password reset email</h3>
With the <code>sendPasswordResetEmail()</code> method:
<pre><code class="language-java">
FirebaseAuth auth = FirebaseAuth.getInstance();

auth.sendPasswordResetEmail(emailAddress)
        .addOnCompleteListener(new OnCompleteListener<Void>() {
            @Override
            public void onComplete(@NonNull Task<Void> task) {
                if (task.isSuccessful()) {
                    // do something when mail was sent successfully.
                } else {
                    // ...
                }
            }
        });
</code></pre>
We can customize the email template in Firebase console:
<img src="https://grokonez.com/wp-content/uploads/2017/08/firebase-auth-email-password-mail-template-reset.png" alt="firebase-auth-email-password-mail-template-reset" width="699" height="420" class="alignnone size-full wp-image-7121" />
<h2>II. Practice</h2>
<h3>1. Goal</h3>
We will build an Android App that can:
- create Account, sign in/sign out, send email verification.
- display current status/user information with verified email status.
(all things above are from previous tutorial)
- send reset password email in case user forgot password.

<img src="https://grokonez.com/wp-content/uploads/2017/08/firebase-auth-email-password-reset-mail-demo.png" alt="firebase-auth-email-password-reset-mail-demo" width="700" height="584" class="alignnone size-full wp-image-7132" />
<h5>2. Technology</h5>
- Gradle 2.3.3
– Android Studio 2.x
– Firebase Android SDK 11.x

More at:

https://grokonez.com/android/firebase-authentication-send-reset-password-email-forgot-password-android

Firebase Authentication – Send Reset Password Email / Forgot Password | Android
NPM: How to patch a dependency 📦
Tags: javascript, tutorial, npm, node
Published: 2021-04-23 16:18:17

### Why? 
As a Javascript developer, you might have come to a situation where you found a bug in a dependency you use. 

As a good soul 😇, you have done a pull request with the fix. But what if the pull request is not yet accepted and you need this fix to deploy your project?! 🤔

### Patch-Package 🚀
[Patch-Package](https://www.npmjs.com/package/patch-package) is a tool to `patch` a dependency, it will create a `.patch` file and it will patch the package after each npm install.

### How?
* Open the file you want to edit and add your fix.
```bash
vim node_modules/package-name/file-to-edit.js
```

* Run :  
```bash
npx patch-package package-name
```
This will create a `.patch` file under a new repository `patches/`

* Commit this file to your git repository

* Finally add following script to your `package.json`. This will run after each `npm install` and will patch the package. 

```json
 "scripts": {
   "postinstall": "patch-package"
 }
```
Solve the scenario - using JObject in Dotnet
Tags: dotnet, csharp, json, jobject
Published: 2021-04-23 16:13:18

# Use Case:

We have this Object and you want to convert it into JSON.
Sounds simple. Right !!

However, the trick here is that you need to add couple of fields dynamically to the object, before converting.

Take a pause

Think about the solution

# ?

Think again

Scroll down for the solution 

...

...

...

...

...

...
                     
# Solution

Run the below code in Linqpad (https://www.linqpad.net/), to see it working.

Make sure you press F4, and add the Nuget package i.e. Newtonsoft.Json

{% gist https://gist.github.com/debashish2014/40386aecac2fcfacb6825d7d54730d16 %}

I have created this extension method **AddFieldsAndConvertToJson**. We are simply passing array of tuple's with the required field name & data to the extension.

Check the output below. The fields are getting added to the employee object dynamically, and the JSON is being outputted.

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

There might be a specific situation, where this extension might come in handy.

Hope you find it useful.

Happy Coding !!
ZypeC - A free & OpenSource collection of Compilers 
Tags: python, zype, zypec
Published: 2021-04-23 16:10:13

**ZypeC** is the set of easy-to-use Compilers based on Python. Unfortunately it only supports Markdown to HTML Compilation. But the Markdown Compiler is also very powerful.
### Examples

```markdown
# H1
## H2
### H3
#### H4
##### H5
###### H6
```

To

```html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">

  <title>ZypeC Generated HTML Pages</title>

</head>

<body>
  <h1>H1</H1>
  <h2>H2</H2>
  <h3>H3</H3>
  <h4>H4</H4>
  <h5>H5</H5>
  <h6>H6</H6>
</body>
</html>
```

How to start ?

Firstly, create a zype.config.json file with the content:

```json
{
    "compiler": "compiler.json"
}
```

And then, create a compiler file as you've mentioned in compiler with the content to compile a Markdown file named file.md to HTML:

```json
{
    "file": "file.md",
    "Content-Type": "text/markdown",
    "to": "html"
}
```

And finally, run the following command to start compilation.

```shell
zype start
```
Awesome Git Shortcuts
Tags: discuss, javascript, react, git
Published: 2021-04-23 16:00:33

---
title: Awesome Git Shortcuts
published: true
description: Git is probably the most used tool in my toolbox. Here are some shortcuts (aliases) I created to move faster.
tags: discuss, javascript, react, git
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8ztwbpeg5vig5069mbth.png
---

Besides VSCode, git is probably the most used tool in my toolbox. Over the years I've learned that there are a few common git commands that I always repeat, so I created some sensible aliases to help me move faster. I wanted to share these aliases with any folks here that might find them helpful.

**Git Status**

By far the most frequently used alias is my alias to `git status`. I aliased `git status` to `gst`.

**Git Add**

The normal command for staging files for a commit is `git add -A` or `git add .` or `git add some/file/name.ts`. I created an alias for it simply to `ga`

**Git Commit**

Simmilarly to git add, I also created an alias for git commit. The typical command is `git commit` or `git commit -m <COMMIT_MSG>`, I aliased `git commit` to `gc` and `git commit -m` to `gcm`. Now you can type out a commit message like `gcm "some cool messsage"`

**Git Diff**

For git diff I added two aliases. First is `gd` which is an alias to `git diff`. However I also have `gdc` which is aliased to `git diff --cached`, for viewing diffs after you have staged your files.

**Git Push**

I also aliased `git push` to `gp`. Not much more to say here.


**Git Checkout**

For quickly checking out branches I aliased `git checkout` to `gco`. For new branches I also created a `gcob` alias that does `git checkout -b`.


**Git Branch**

For quickly listing branches I aliased `git branch` to `gb`.

**Benefits**

Besides being much faster to type out, another benefit of these aliases is that you can still use flags like normally. Say you want to push a new branch to a remote. Without aliases it would look like this: `git push -u origin my_branch`. But with aliases I can simply type `gp -u origin my_branch`, not a significant savings but when you type the command out thousands of times, it starts to make a difference.

## Try them out yourself

While there are many ways you can create a git alias, I did it in the most simple way by just adding an alias to my `.bashrc`. Here are all the aliases I mentioned in this post

```bash

alias gst='git status'
alias ga='git add -A'
alias gc='git commit'
alias gcm='git commit -m'
alias gd='git diff'
alias gdc='git diff --cached'
alias gp='git push'
alias gco='git checkout'
alias gcob='git checkout -b'
alias gb='git branch'

```

If you want to give these a test drive, paste this code block directly into your terminal and it will enable these aliases for the current session. If you like them you can then add it to your `.bashrc` / `.zshrc` / etc.

---

If you liked this post check out some of my other writing [here](https://sunnygolovine.com/blog)
Developing an SPA frontend and a universal backend for an online cinema
Tags: webdev, programming, writing, codenewbie
Published: 2021-04-23 15:49:57

ShowJet is an online cinema with series. The Evrone team developed its first version — a web interface and a core that controlled the cinema and video streams.

The ShowJet team had contracts with different studios, as well as their own voice acting studio, so they could release content with Russian dubbing almost immediately after the episodes aired abroad. These advantages allowed the OTT-TV service to attract many users, and, due to the fact that some TV shows run for years, get good product metrics in areas like lifetime value (LTV).
Flutter SQLite example – CRUD operations with sqflite plugin
Tags: flutter, sqlite, sqflite
Published: 2021-04-23 15:48:54

https://grokonez.com/flutter/flutter-sqlite-example-crud-sqflite-example

Flutter SQLite example – CRUD operations with sqflite plugin

In this tutorial, we're gonna look at how to make SQLite CRUD Operations in a Flutter App using sqflite plugin.

More Practice:
- <a href="https://grokonez.com/android/flutter-sqlite-example-listview-crud-operations-sqflite-plugin">Flutter SQLite example – CRUD Operations with ListView & sqflite plugin</a>

With Firebase:
- <a href="https://grokonez.com/android/flutter-firebase-database-example-firebase-database-crud-listview">Flutter Firebase Database example – Firebase Database CRUD with ListView</a>
- <a href="https://grokonez.com/android/flutter-firestore-example-firebase-firestore-crud-operations-with-listview">Flutter Firestore example – Firebase Firestore CRUD with ListView</a>

More:
- <a href="https://grokonez.com/reactjs-jwt-springboot-token-authentication-example">Reactjs Jwt SpringBoot Token Authentication Example</a>
- <a href="https://grokonez.com/react-node-jwt-authentication-without-redux">React Node Jwt Authentication without Redux – using LocalStorage and Axios</a>
- <a href="https://grokonez.com/angular-11-elasticsearch-example-start-guide">Angular 11 ElasticSearch Example – Start Guide</a>
- <a href="https://grokonez.com/django-angular-10-crud-example">Django Angular 10 CRUD Example</a>
- <a href="https://grokonez.com/reactjs-crud-firebase-realtime-database-example">Reactjs CRUD Firebase Realtime Database Example</a>

<!--more-->

<iframe width="560" height="315" src="https://www.youtube.com/embed/7ZfInOvFsz0" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<h2>Flutter SQLite CRUD with sqflite</h2>
<h3>Import sqflite</h3>
Add <a href="https://github.com/tekartik/sqflite" target="_blank" rel="nofollow noopener noreferrer">sqflite plugin</a> to the dependencies section of our <em><strong>pubspec.yaml</strong></em>:
<pre><code class="language-java">
dependencies:
  sqflite: <latest_version>
</code></pre>
<h3>Open a Database</h3>
First, we find a location path for the database using <code>getDatabasesPath()</code> function. Then we call <code>openDatabase()</code> with <code>onCreate()</code> callback method where we populate data.

More at:

Flutter SQLite example – CRUD operations with sqflite plugin

https://grokonez.com/flutter/flutter-sqlite-example-crud-sqflite-example
Developing affiliate marketing software for the Quints platform
Tags: ruby, webdev, programming, writing
Published: 2021-04-23 15:48:36

Quints’ owners approached Evrone with an already developed, two-year old product for affiliate reporting and customer management. The application had quite a lot of legacy, and about 70–80% of the functionality already existed. However, during our joint work on the project, much of it has been finalized and improved. Now, our team is working on optimization and implementation of new features, to turn the project into something brilliant.
Question: How many of you google basic things for your language after several years of experience?
Tags: development, people, discuss
Published: 2021-04-23 15:46:58

---
title: Question: How many of you google basic things for your language after several years of experience?
published: true
tags: #development #people #discuss
---

What I mean is, say you're a Javascript, or Python, or C programmer. How many of you google how to write a for loop in your language regularly, despite having used it for several years? Or a while loop, or a subscription operator, or something basic like that.

The reason I'm asking is just to understand the general trend.
Flutter Read/Write File Example – with path_provider and dart:io
Tags: flutter, dart
Published: 2021-04-23 15:34:02

https://grokonez.com/flutter/flutter-read-write-file-example-path-provider-dartio-example

Flutter Read/Write File Example – with path_provider and dart:io


In this tutorial, we're gonna build a Flutter App that can read file and write data to file for later use. To do this, we need to combine <a href="https://pub.dartlang.org/packages/path_provider" target="_blank" rel="nofollow">path_provider plugin</a> with <a href="https://docs.flutter.io/flutter/dart-io/dart-io-library.html" target="_blank" rel="nofollow">dart:io</a> library.

<!--more-->
<h2>Flutter App Overview</h2>
Our Flutter App has a Text field, when we click on <strong>Write to File</strong> button, the String in Text field will be written to <strong>text.txt</strong> file (appending text) and display on Screen.

<img src="https://grokonez.com/wp-content/uploads/2018/07/flutter-read-write-file-example-overview.png" alt="flutter-read-write-file-example-overview" width="237" height="418" class="alignnone size-full wp-image-13697" />

Everytime we launch the App, it read <strong>text.txt</strong> file and show contents inside.
We can also clear content of the file by <strong>Clear Contents</strong> button.
<h2>Read/Write Files</h2>
<h3>Find Local Path</h3>
We need a place to write data on disk and read it again when the app loads.
>> So we use <a href="https://pub.dartlang.org/packages/path_provider" target="_blank" rel="nofollow">path_provider plugin</a> to access <em><strong>Documents directory</strong></em> (on iOS, this corresponds to <code>NSDocumentDirectory</code>, on Android, this is the <code>AppData</code> directory).
<pre><code class="language-java">
Future<String> get _localPath async {
  final directory = await getApplicationDocumentsDirectory();
  return directory.path;
}
</code></pre>
<h3>Reference to File</h3>
To create a reference to the File full location (in our case, the <strong>text.txt</strong> file), we use <a href="https://docs.flutter.io/flutter/dart-io/File-class.html" target="_blank" rel="nofollow">File</a> class from the <a href="https://docs.flutter.io/flutter/dart-io/dart-io-library.html" target="_blank" rel="nofollow">dart:io</a> library.
<pre><code class="language-java">
Future<File> get _localFile async {
  final path = await _localPath;
  return File('$path/text.txt');
}
</code></pre>
<h3>Write data to File</h3>
We will write a string to a file using File <code>writeAsString()</code> method. It returns a <code>Future&#60;File&#62;</code> that completes with this <code>File</code> object once the entire operation has completed.

More at:

Flutter Read/Write File Example – with path_provider and dart:io

https://grokonez.com/flutter/flutter-read-write-file-example-path-provider-dartio-example
Embedding Code Editor In Your React App
Tags: react, components, reactace
Published: 2021-04-23 15:32:17

# Welcome
Ever wanted to insert a beautiful code editor in your react app? Answer is probably **yes**. So, let's get started.

## Step 1 - Installing dependencies
`npm i react-ace`
or if you are using yarn
`yarn add react-ace`

## Step 2 - Creating a Component
Now, we should create a react component that renders the code editor. Here, I am going to use Functional Components (**recommended**)
```js
import AceEditor from 'react-ace'

function App() {
	return <AceEditor />
}

export default App
```
And there you get a basic editor![1_v9QrT22deOepiZrTRSueKw](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pbmot9v9g4dvei7h3rzy.gif)

## Step 3 - Styling And Configuring it.
For now I am assuming you need this editor for editing JavaScript code.
```js
import {useState} from 'react'
import AceEditor from 'react-ace'

// import mode-<language> , this imports the style and colors for the selected language.
import 'ace-builds/src-noconflict/mode-javascript'
// there are many themes to import, I liked monokai.
import 'ace-builds/src-noconflict/theme-monokai'
// this is an optional import just improved the interaction.
import 'ace-builds/src-noconflict/ext-language_tools'
import 'ace-builds/src-noconflict/ext-beautify'

function App() {
	const [code, setCode] = useState(`function hello() {
  console.log("Hello World!");
}`)

	return (
		<AceEditor
			style={{
				height: '100vh',
				width: '100%',
			}}
			placeholder='Start Coding'
			mode='javascript'
			theme='monokai'
			name='basic-code-editor'
			onChange={currentCode => setCode(currentCode)}
			fontSize={18}
			showPrintMargin={true}
			showGutter={true}
			highlightActiveLine={true}
			value={code}
			setOptions={{
				enableBasicAutocompletion: true,
				enableLiveAutocompletion: true,
				enableSnippets: true,
				showLineNumbers: true,
				tabSize: 4,
			}}
		/>
	)
}

export default App
```
You can explore further here -> [React Ace Docs](https://github.com/securingsincity/react-ace/tree/master#react-ace)

## Conclusion
This is a basic setup, for further modifications you can check the above provided link, you can generate the code interactively [here](https://securingsincity.github.io/react-ace/)

Peace ✌
Built-in Node Functions Can Be Overridden Between Lambda Runs
Tags: serverless, node, javascript
Published: 2021-04-23 15:31:43

A couple days ago I wrote up a post on [Why We Moved From Lambda to ECS](https://dev.to/prismatic/why-we-moved-from-lambda-to-ecs-4m96). One thing I was startled by was how a "warm" Lambda can behave between invocations. I thought I'd expand on that issue briefly with a simple example:

## How I Thought Lambda Worked

My (incorrect) understanding of Lambda was that each invocation of a Lambda was isolated. I figured, besides the startup code that runs once when a "cold" Lambda gets warmed, that Lambda executions were stateless and wouldn't affect one another.

## How It Actually Works

In reality, two Lambdas that run in parallel are perfectly isolated. However, if a Lambda has run and is sitting around "warm", subsequent executions using that Lambda might be affected by a previous execution.

### Example Overriding console.log()

Suppose, for example, you have a simple Lambda with this code in `index.js`:

```javascript
exports.handler = async (event) => {
  console.log("Hello, world!");
  
  global.console.log = (msg) => {
    console.error("Your message has been hijacked");
  };
};
```

The first time this Lambda is invoked, you see a happy "Hello, World!" logged out.

![hello-world](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9ybsvisps97fmhbvlgv0.png)
 
If you test the Lambda again while the Lambda is still warm, though, the first invocation overrode the `console.log()` function, so you end up seeing an error, "Your message has been hijacked".

![message-jijacked](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tj529aa8q7jlxtfml5e3.png)

You can imagine how someone might exploit this issue if they can invoke their own code in a Lambda that others then use.
Signals - .NET 5 based framework for developing enterprise and SaaS applications.
Tags: dotnet, csharp
Published: 2021-04-23 15:23:44

[Signals](https://github.com/EmitKnowledge/signals) is a .NET5 based framework which focuses on increasing the quality and productivity within development teams by providing them with tools, aspects and processes.

Kick start via Signals Boilerplate on https://github.com/EmitKnowledge/Signals-Boilerplate

--

Starting a new project is always exciting. Everything starts with an idea of a certain product that needs to bring some value. The idea is developed and documented by the product owner and then communicated with the development team that needs to build it.

The development team will go through the docs and there will be some communication going back and forth to understand the details and to align over the deliverable. The project methodology is irrelevant in the sense that all involved parties are speaking a different language which eventually makes it harder to align and understand each other.

I remember during high school, together with my friend, we've started developing a tool for managing salaries for one accountant and he wanted to be able to change the system time. Thinking about it and discussing it with the accountant it turned out that he wanted to be able to add a record in the past. This discrepancy in communication, speaking different languages, having a different communication language can impact the decisions that we are making when developing an application.

This brings us to the point, how hard will be to find a common language across different roles? This is where Signals come into play as a concept. Signals align all involved parties by asking the right questions:

- Who should be able to execute this process?
- Is this particular person granted to execute the process?
- What are the preconditions that need to be fulfilled before we execute the process?
- What are the steps of the process itself?

Once the documentation is delivered to the development team they will be able to map it outright and avoid missing out on the details.

When starting the project, in development terms, we tend to reinvent the wheel, and yet it ends being an ellipse. Every project starts with creating a blank solution, setting up the project hierarchy and boundaries, bringing some code base from previous projects, and trying to glue it out. This means that there isn’t any standardization on how we can effectively run, extend and maintain projects in the longer run. Not to mention when a person needs to join the team or to assist with some other active project in the organization. Fear of the unknown is the boss.

Signals' purpose is to fill the gap in this problem. When starting a project, you will have everything set up for you so you as a developer can focus on the business logic. For both beginners or senior software developers, Signals offers you development practices that will make your professional life easier and more creative.