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.

  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: