Skip to content

Instantly share code, notes, and snippets.

View GSmes's full-sized avatar

Garrett Smestad GSmes

View GitHub Profile

##Hello World

Garrett's Code

  • Responder #1 - This responder took largely the same approach as me but used the "if/return true" approach rather than the single line return method. In this case I feel the one-line method is sufficiently clear and therefore would probably be preferred over using if/return.

  • Responder #2 - This user employed an even more broken-out approach than the first responder, creating a three part "if - else if - else" conditional. For the same reason as #1 I feel that the one-line approach would be preferred in this case.

  • Responder #3 - This user decided to build the logic out with a nested conditional, nesting the %100 and %400 checks within the %4 conditional. It appears cleaner at first glance and the nested structure does mirror the logic of the problem, though I know in a more complex situation a nested conditional could prove to be a real can of worms.

Goal: Eliminate all targets in the level in as few shots as possible.

  • Player selects "Start Game" button to begin Level 1
  • Player shoots from a fixed position on canvas
  • Player aims by moving the mouse
  • Player shoots by clicking mouse where they want bullet to go
  • Bullet moves at a fixed speed
  • Bullet ricochets maximum 7 times & then disappears (turn is over)
  • For each level, the player is only allowed a certain number of bullets
  • Player receives 1 point for each unused bullet

Amplify

Pitch

A web app that automatically generates a Spotify playlist based on a band or artist's previous show(s).

Problem

Every band/artist plays different songs at every concert, ranging from the well-known hits to the lesser-known deep cuts. Sometimes you're not sure what the song was that you liked so much at the concert, but you want to listen to it again. Other times you may have enjoyed the entire show so much that you want to re-live it by listening to every song they played again. But remembering every song they played is nearly impossible, and if you manage to find the set list for the show, searching for each song can be frustrating and tedious.

1. Search alternative fuel stations by zip code

We will be using the NREL API. Sign up for a key here: https://developer.nrel.gov/signup/

As a user
When I visit "/"
And I fill in the search form with 80203
And I click "Locate"
Then I should be on page "/search" with parameters visible in the url

Business Intelligence Endpoints

Person A

  • GET /api/v1/items/:id/best_day
  • returns the date with the most sales for the given item using the invoice date. If there are multiple days with equal number of sales, return the most recent day.
  • GET /api/v1/items/most_revenue?quantity=x
  • returns the top x items ranked by total revenue generated.
  • GET /api/v1/items/most_items?quantity=x
  • returns the top x item instances ranked by total number sold.
  • GET /api/v1/customers/:id/favorite_merchant
  • returns a merchant where the customer has conducted the most successful transactions.
  1. Define CRUD.

  2. There are seven verb + path combinations that are necessary in a basic Sinatra app in order to provide full CRUD functionality. List each of the seven combinations, and explain what each is for.

  3. Why do we use set method_override: true?

  4. Explain the difference between value and name in this line: <input type='text' name='task[title]' value="<%= @task.title %>"/>.

  5. What are params? Where do they come from?

@GSmes
GSmes / week_3.markdown
Last active May 26, 2016 18:53 — forked from worace/week_3.markdown
Module 1 Week 3 Diagnostic

Module 1 Week 3 Diagnostic

This exercise is intended to help you assess your progress with the concepts and techniques we've covered during the week.

For these questions, write a short snippet of code that meets the requirement. In cases where the question mentions a "given" data value, use the variable given to refer to it (instead of re-writing the information).

@GSmes
GSmes / gs-prework.md
Last active May 6, 2016 03:21 — forked from mbburch/prework.md
An example template for your Turing pre-work Gist

Turing School Prework- Garrett S.

Task A- Practice Typing:

  • Screenshots of scores will be posted in comments

Task B- Algorithmic Thinking & Logic:

  • Screenshots of completed sections will be posted in comments

Task C- Create your Gist: