Skip to content

Instantly share code, notes, and snippets.

View iscott's full-sized avatar

Ira Herman iscott

View GitHub Profile
@iscott
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 (http://sakaralife.com)
* Available under the MIT license: https://opensource.org/licenses/MIT
*/
// 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
iscott / simple_authentication_rails_5_bcrypt_and_has_secure_password.md
Last active March 15, 2024 03:23
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.

Specs
AUTHOR Ira Herman
LANGUAGE/STACK Ruby on Rails Version 4, 5, or 6
@iscott
iscott / ds_and_algos.md
Last active October 30, 2023 12:41
Intro to Datastructures and Algorithms Cheat Sheet
@iscott
iscott / git_workflow_cheatsheet.md
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
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
@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 / 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 / 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.

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 / 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: