Skip to content

Instantly share code, notes, and snippets.

View tchestnut85's full-sized avatar

Tom Chestnut tchestnut85

View GitHub Profile
@tchestnut85
tchestnut85 / react-context.md
Last active June 29, 2021 00:19
React Context Cheatsheet

React Context State Management Cheatsheet

Based off of how I typically use React Context, this specific example from my React Weather App.
Any comments, suggestions, or constructive criticism, let me know: [email protected]

Description

This is a cheatsheet for using React's Context API for client side state management, useful for smaller scale applications as an alternative to Redux or similar state management libraries. The directory structure would typically be:

  • yourApp/client/src/utils/context/{context files or sub-directories here}.
  • If you want to use multiple contexts, create a sub-directory for each context and actions/reducer/state files for each context.

MongoDB Cheat Sheet

Show All Databases

show dbs

Show Current Database

@tchestnut85
tchestnut85 / regex-tutorial.md
Last active December 6, 2020 17:15
RegEx Email Validation Tutorial

Email Validation RegEx

This is a tutorial for a regular expression that matches valid email addresses.

Summary

Email RegEx

/^([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})$/gim