Skip to content

Instantly share code, notes, and snippets.

View wallacepreston's full-sized avatar
🎧
Creating

Preston Wallace wallacepreston

🎧
Creating
View GitHub Profile

Reference for fetch API, using CRUD verbs

Note: Official Docs Here

CRUD:

Letter Stands For Verb Use Case
C Create POST Making new data
R Read GET Fetching pre-existing data
U Update PATCH Editing Data
D Destroy DELETE Removing Data
@wallacepreston
wallacepreston / fetch.md
Last active December 19, 2020 18:42
What would log when we run this script?

What would log when we run this script?

console.log('NUMBER 1');
fetch('someurl')
  .then(function() {
    console.log('NUMBER 2');
  });
console.log('NUMBER 3');

These are the major features we’re looking for at each code review, in addition to your other progress.

Authorization

Backend

If a route has a (*) next to it, it means that it should require a logged in user to be present, if a route has a (**) next to it, the logged in user should be the owner of the modified object. If a route has (*admin) next to it, the logged in user must be an admin user (user.isAdmin === true). Any (**) route should also be accessible by any (*admin) user.

Frontend

Using the same notation above. If a user is authorized, show the component. If the user is not authorized, either (1) display an error message or (2) redirect the user to a different route/component (any component that would be appropriate)

Tiers, in Vertical Slices

GIT & GITHUB

Git Setup

First install Git.

Then, in your terminal:

git config --global user.name "Your Name"
git config --global user.email "your_email@real_email.edu"
@wallacepreston
wallacepreston / BalancedBrackets.md
Last active September 7, 2019 04:22
balanced bracket algorithm

Prompt

Write a function that determines whether an input string has balanced brackets.

You are given an input string consisting of brackets—square [ ], round ( ), and curly { }. The input string can include other text. Write a function that returns either true if the brackets in the input string are balanced or false if they are not. Balanced means that any opening bracket of a particular type must also have a closing bracket of the same type.

An empty input string or a string without brackets can also be considered "balanced".

@wallacepreston
wallacepreston / foundations-cp-study.md
Last active April 20, 2019 18:54
Foundations Checkpoint Study Guide

Foundations Study Guide

Logistics

  • 3 hours long (plus 5 minutes… as a safety buffer)
  • Via HackerRank
    • Sample/practice test – open and run as many times as you want, for reviewing the HackerRank platform
    • Test link will be sent to you by your instructor
    • Questions will be a mix of multiple choice and coding prompts
    • Questions will have varying difficulty and point values (out of 100)
@wallacepreston
wallacepreston / index.html
Created January 18, 2019 04:23
React Facial Feature Tracking as a Component
THIS IS A CHROME EXPERIMENT
<div id="demo"></div>