Skip to content

Instantly share code, notes, and snippets.

View iscott's full-sized avatar

Ira Herman iscott

View GitHub Profile
iscott /
Last active May 22, 2024 08:00
Cheat Sheet: Simple Authentication in Rails 5 with has_secure_password

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.

AUTHOR Ira Herman
LANGUAGE/STACK Ruby on Rails Version 4, 5, or 6
iscott / console.js
Created April 10, 2024 20:39 — forked from garside/console.js
Shopify Audit Permissions
* Shopify Admin Auditing
* Copyright (c) 2022 Eric Garside (
* Available under the MIT license:
// The selector for permssion checkboxes label sets on the individual user pages (if shopify changes this)
const permissionSelector = 'label.Polaris-Choice_j5gzq:not([for^="Polaris"])'
// The selector for permission text within the checkbox label
iscott /
Last active October 30, 2023 12:41
Intro to Datastructures and Algorithms Cheat Sheet
iscott /
Created April 2, 2020 00:51
Git Workflow Cheatsheet

Git Workflow CheatSheet

By Ira Herman

Use this workflow when working with teams to take advantage of Pull Requests and keep the master branch clean.

Creating and using your own branch locally:

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


Experimenting with this instead:

  • rbenv versions
  • rbenv uninstall x.y.z # uninstall all versions from the last step
  • brew uninstall rbenv
  • uninstalling homebrew
  • removing
  • reinstall homebrew - not in rosetta 2
iscott /
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 /
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:

// Connect to mongodb:
// Load up our models:
iscott /
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.

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 /
Last active April 24, 2021 20:36
How ES6+ Destructuring Works

How destructuring works:

Given the JS Object:

const user = { name: "Ira", email: "", favColor: "blue" };

making variables WITHOUT using destructuring: