Skip to content

Instantly share code, notes, and snippets.

View shannonjen's full-sized avatar

Jen Shannon shannonjen

View GitHub Profile
@shannonjen
shannonjen / g79q3project.md
Last active May 15, 2022 17:28
g79 Q3 Project Draft

Frontend Framework Project

After each section of our course, we will ask you to come up with a project to build that demonstrates what you've learned this far in the course. This is your chance to choose something you are excited about to spend time on!

Requirements

This project will incorporate a backend API and a frontend built with a frontend framework.

The frontend requirements are as follows:

@shannonjen
shannonjen / todo.md
Last active December 3, 2020 14:14
g72 Warm Up!

React ToDo

From the command line, create a react app with create-react-app and then do the following:

Base goal: Create two new components, one called TodoInput and another called TodoList. Wire up TodoInput to add todos to the todo list.

Stretch goal 1: Modify the app to where it is unable to submit a new todo if the input field is blank.

Stretch goal 2: Allow users to remove todos from the list using a "remove" button next to each todo.

@shannonjen
shannonjen / g65warmupjan18.js
Created January 18, 2018 11:08
g65 Warm Up, 1/18
// Create a function that receives a (square) matrix and calculates the sum of both diagonals (main and secondary)
// Matrix = array of n length whose elements are n length arrays of integers.
// 3x3 example:
// diagonals( [
// [ 1, 2, 3 ],
// [ 4, 5, 6 ],
// [ 7, 8, 9 ]
// ] );
@shannonjen
shannonjen / g65warmupjan17.md
Created January 17, 2018 11:49
g65 Warm Up, Wed Jan 17

User Registration

Create an Express HTTP server that contains middleware to handle POST /users requests with username and password key-value pairs in the request body. Ensure the middleware takes the following steps.

  1. Generate a hashed_password using the bcrypt cryptographic hash function.
  2. Insert the username and hashed_password into a users table.
  3. Respond with just a 200 status code on successful insertion into the table.

Be sure to pass along any errors to the error handling middleware in the stack. For good measure, include a 404 catch-all middleware in the stack as well.

@shannonjen
shannonjen / warmupjan10.md
Last active January 10, 2018 13:09
g65 Warm Up Jan 10

g65 Warm Up Jan 10

Write a function that takes two numbers. For each number, you'll increase each digit by 1. Then you'll add the two numbers together.

For example:

 oddAdd(13, 50) >> 24 + 61 >> 85
 oddAdd(49, 16) >> 50 + 27 >> 77
 
// Define a function named createList that takes one argument.
// sites (object)
//
// The object has the following structure:
// {
// 'TITLE': 'URL',
// 'TITLE': 'URL',
// 'TITLE': 'URL',
// ...
// }
// Description:
// Welcome. In this warmup you are required to, given a
// string, replace every letter with its position
// in the alphabet. If anything in the text isn't a letter,
// ignore it and don't return it. a being 1, b being 2,
// etc. As an example:
// alphabet_position("The sunset sets at twelve o' clock.")
// Should return "20 8 5 19 21 14 19 5 20 19 5 20 19 1 20 20

HTML Introduction Exercise

  1. Fork this repo and clone it to your computer. You can verify this by seeing your GitHub username in the URL and not gschool.

  2. Create a new file named cities.html. Make sure it includes an html, head, and body. (then, commit your changes!)

  3. Make an unordered list all of the cities you've lived in. (then, commit your changes!)

  4. Make an ordered list of the top three cities you would like to visit. (then, commit your changes!)

lodash

In this assignment, we want you to re-implement some of the most popular methods found in [lodash][lodash]. This task will provide you two incredible learning opportunities: first, you'll have the opportunity to apply your knowledge of JavaScript; second, you'll learn through this experience that lodash, similar to all JavaScript libraries, are written with the same JavaScript you've been learning!

If you're unfamiliar with lodash, it's [a popular utility library][popular-utility-library] written in JavaScript. Inside of it, you'll find a collection of methods, such as [forEach()][for-each], which replaces the boilerplate code that developers often find themselves writing--e.g., code that iterates on every item of a collection.

Here's an example:

// Without lodash, you have to create your own implementation of forEach.
function forEach(arr, callback) {

Control Flow

Related Standard: W0099 - Use conditionals and loops to control the flow of a program

Objectives

By the end of this lesson you will:

  • Use if/if else/else statements to conditionally execute code
  • Use while loops to conditionally repeat statements