Skip to content

Instantly share code, notes, and snippets.

@caravl
caravl / nestjsauth0_2.md
Last active May 17, 2020 23:17
NestJS <> Auth0 Part 2

Authentication

References

Authorization - determine what users can and cannot access with each request. Authentication - first, determine who that user is

Process

  1. User provides a set of credentials to log in through a client application, like a ReactJS interface.
  2. The client application sends the credentials to an authentication server that validates them.

React-Redux Cheatsheet

What is React-Redux?

A small library that binds Redux to React components.

Methods

  1. <Provider> component - provides Redux store to all child components so we don't need to pass it explicitly to all components

  2. mapStateToProps(state) - connects the store to React Props and passes state that's needed in a particular component

Redux Cheatsheet

What is Redux?

  • Redux is predictable state container for JS apps and used for the entire app's state management

3 Principles of Redux

  1. Single Source of Truth - state of entire app is stored in an object/state tree within a single store; makes it easy to keep track of changes over time and debug; all components' state is stored in store and receive updates from the store itself
  2. State is Read-Only - the only way to change state is trigger an action (a plain object describing the change);
  3. Changes are made with Pure Functions - to specify how state tree is transformed by actions, redux uses pure functions (whose return value depends solely on the values of their arguments)

Linked Lists

What is a Linked List?

A data structure comprised of nodes which contain a data element and a pointer to the next node. Lists can be singly-linked or doublely-linked (nodes have previous and next pointers).

Time Complexity

  • Insertion - O(1)
  • Search - O(n)

Example Code

@caravl
caravl / README-Template.md
Created January 10, 2018 21:28 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites