Skip to content

Instantly share code, notes, and snippets.

Avatar

Ira Herman iscott

View GitHub Profile
@iscott
iscott / simple_authentication_rails_5_bcrypt_and_has_secure_password.md
Last active May 12, 2021
Cheat Sheet: Simple Authentication in Rails 5 with has_secure_password
View simple_authentication_rails_5_bcrypt_and_has_secure_password.md

Cheat Sheet: Simple Authentication in Rails 6 with has_secure_password

The goal of this cheatsheet is to make it easy to add hand-rolled authentication to any rails app in a series of layers.

First the simplest/core layers, then optional layers depending on which features/functionality you want.

Specs
AUTHOR Ira Herman
LANGUAGE/STACK Ruby on Rails Version 4, 5, or 6
@iscott
iscott / ds_and_algos.md
Last active May 11, 2021
Intro to Datastructures and Algorithms Cheat Sheet
View ds_and_algos.md
@iscott
iscott / 01-useState.md
Created Mar 24, 2020
useState hook in React
View 01-useState.md

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 / how_destructuring_works.md
Last active Apr 24, 2021
How ES6+ Destructuring Works
View how_destructuring_works.md

How destructuring works:

Given the JS Object:

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

making variables WITHOUT using destructuring:

@iscott
iscott / git_branches_and_merging.md
Last active Apr 17, 2021
Git branches and merging
View git_branches_and_merging.md

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.

View rest_crud_chart.md

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 / 4_ways_jsx_arrow_functions.md
Last active Apr 5, 2021
4 Different Ways To Write An Arrow Function With JSX
View 4_ways_jsx_arrow_functions.md

4 different ways to write an arrow function with JSX

const SettingsPage = (props) => {
    return (
        <>
            <h1>SettingsPage</h1>
            <Link to="/">Home</Link>
        </>
    );
View python_django_command_lines.md

Run Server:

python3 manage.py runserver

Create DB:

createdb

Make migrations:

python3 manage.py makemigrations

Migrate DB:

View react_router.md

React Router

By Alex Merced Updates by Ira Herman

React Router Logo

Learning Objectives

  • Use React Router's BrowserRouter, Link, Route, Redirect, and Switch
@iscott
iscott / movies_app_react_coding_challenge.md
Last active Dec 6, 2020
"Take-Home" Coding Challenge: Movies App
View movies_app_react_coding_challenge.md

"Take-Home" Coding Challenge: Movies App

By Ira Herman


This code challange prompt is modeled after real-world take-home code challenges/prompts many companies use as part of their technical interview process.

This will help you practice/prepare to build a mini-project off of specs, and give you practice/reinforcement using ReactJS with an API back end.