Skip to content

Instantly share code, notes, and snippets.

View iscott's full-sized avatar

Ira Herman iscott

View GitHub Profile

React Router

By Alex Merced Updates by Ira Herman

React Router Logo

Learning Objectives

  • Use React Router's BrowserRouter, Link, Route, Redirect, and Switch

Run Server:

python3 manage.py runserver

Create DB:

createdb

Make migrations:

python3 manage.py makemigrations

Migrate DB:

@iscott
iscott / 4_ways_jsx_arrow_functions.md
Last active April 5, 2021 16:01
4 Different Ways To Write An Arrow Function With JSX

4 different ways to write an arrow function with JSX

const SettingsPage = (props) => {
    return (
        <>
            <h1>SettingsPage</h1>
            <Link to="/">Home</Link>
        </>
 );
@iscott
iscott / git_branches_and_merging.md
Last active April 17, 2021 15:49
Git branches and merging

Basic workflow for git branching:

Create a branch called "my_feature_branch" and change your git to working on that branch:

git checkout -b my_feature_branch

The branch is an exact clone of what master was when you ran the command.

@iscott
iscott / how_destructuring_works.md
Last active April 24, 2021 20:36
How ES6+ Destructuring Works

How destructuring works:

Given the JS Object:

const user = { name: "Ira", email: "ira@example.com", favColor: "blue" };

making variables WITHOUT using destructuring:

RESTful Routes to CRUD Mapping

Example resource: fruits

In I.N.D.U.C.E.S. route order:

URL HTTP Verb Action Notes
/fruits/ GET index INDEX when a user types localhost:3000/fruits in browser this route shows a list or index of all fruits
/fruits/new GET new NEW when a user types localhost:3000/fruits/new in browser this route shows the user a form to create a NEW fruit
@iscott
iscott / intro_to_react_native.md
Created July 23, 2021 16:38
Cheatsheet: Intro to React Native

Intro to react-native cheatsheet

By Ira Herman

Notes to help you get started in react-native.

Cheatsheet Objectives

  • Explain how react-native apps work, native UI with JS for logic.
  • Explain what Expo does.
@iscott
iscott / node_console_repl_shell_for_mongoose.md
Created August 10, 2020 21:35
How to access your MongoDB in a command-line node shell using mongoose

How to access your MongoDB in a command-line node shell using mongoose

To load up a node console where you can access the database:

in terminal, run node then paste in these lines:

require("dotenv").config();
// Connect to mongodb:
require("./config/database");
// Load up our models:
@iscott
iscott / 01-useState.md
Created March 24, 2020 17:03
useState hook in React

Hooks: useState

Learning Objectives:

  • Explain what hooks do and how they let us use function components instead of class components.
  • Work with tuples.
  • Practice converting stateful class components to functional components with the useState hook.

🔗Codesandbox Demo

@iscott
iscott / rails_m1_mac_installation.md
Last active August 23, 2023 14:06
How to get rails to work on an M1 Mac

UPDATE IN PROGRESS:

Experimenting with this instead:

  • rbenv versions
  • rbenv uninstall x.y.z # uninstall all versions from the last step
  • brew uninstall rbenv
  • uninstalling homebrew
  • removing postgres.app
  • reinstall homebrew - not in rosetta 2