Skip to content

Instantly share code, notes, and snippets.

1. Describe the request-response cycle (start with the client making a request).
* The client sends a request to the server with a verb (GET) and a path (/tasks) that it wants to ineract with.
* The server/router accepts that request and sends it to the controller.
* The controller routes the request to the proper location with the proper action (get, post, etc.)
* If the request requires pulling informaiton out of the database then the controller passes the request to the models, which then fetches from the database and hands it back to the controller.
* The controller then passes the available information over to the views, and the views build a page with the requested info.
* The views send the page back to the controller, where it renders HTML that gets sent back to the server.
* The server then sends a response to the client with information about whether the request was successful or not -- and if so, it passes the html in though the response body.
  1. What is the purpose of the router in a Rails project?

It's the doorman to your app a.k.a. --> it handles all incoming requests and routes them to the correct place, controller, etc.

  1. What routes would be provided to you with the line resources :items?

get "/items" => "items#index"

get "/items/:id" => "items#show"

Setting Group Expectations

Group Member Names: Edgar, Matt R., Matt S.

  1. When are group members available to work together? What hours can each group member work individually? Are there any personal time commitments that need to be discussed? We'll shoot to work after school most days, trying to accomodate little schedule differences as they come. Flexible on weekends.

  2. How will group members communicate? How often will communication happen, and how will open lines of communication be maintained? Started a slack chaneel #Mattgar + texting. Anytime we separate to work on home, we'll plan on checking it at the end of each day to realign/help each other with problems they're having. We'll likely be pairing together most of the time, with the exception of smaller/repetitive tasks. Shoot to set mini-milestones/goals and chip away at those instead of falling behind or getting overwhelmed with the scope of the entire project.

Array Prototype Methods

I understand that functions in JavaScript can take any number of arguments.
Yes.

I can describe the similarity between blocks in Ruby and anonymous functions in JavaScript.
Yes.

Where are the methods available to all arrays (e.g. forEach, map, etc.) defined?
Array.prototype

JavaScript Functions

I can explain the difference between function declarations and function expressions.
Yes.

I can explain what the value of this is in a normal function.
Yes.

I can explain what the value of this is when called from the context of an object.
Maybe.

@matt-stj
matt-stj / es6.markdown
Last active February 9, 2016 17:33 — forked from rrgayhart/es6.markdown
ES6 Homework

Throughout the module (and your journey to Google enlightenment while working on IdeaBox2.0) you may notice a few different ways that JavaScript code is being written.

That might have something to do with something called ES6 and ES5

Fork this gist and answer the following questions:

  • What is ES6?
  • It's the newest standard for EMCAscript - an update from ES5, which is ~5 years old.
  • What is Transpilation and how does it relate to ES6?
  • Transpilation is the process of taking one version of a language and making it compatible with other versions of that langues. With ES6, for instance, developers who want to start writing in ES6 before major browsers adopt it, can do so by transpiling their code from ES6 -> ES5. It's my understanding that Babel is used specifically for transpilation tasks like this.
  • Looking at the ES6 Features link below, discuss one update from ES5 and if it seems useful/superfluous,
@matt-stj
matt-stj / require.markdown
Last active February 9, 2016 07:14 — forked from rrgayhart/require.markdown
The Concept of Require

When you start working with WebPack for GameTime, you'll notice that you can't just define a variable in one file and find it in another as easily as you can in Rails.

Read Node.js, Require and Exports and Organize Your Code with RequireJS

Fork this gist and answer the following questions:

  • In the context of Node, what is a module?
**Step One**: Watch [Sorting Algorithms in JavaScript](https://www.youtube.com/watch?v=uRyqlhjXYQI)
**Step Two**: Fork this gist.
**Step Three**: Respond to this question in your fork: "What are some of the balances and trade offs between different sorting algoritms?"
Speed, resources required to perform, stability, and size of incoming dataset are all things that must be taken into consideration when using sorting algorithms. There's no single perfect solution -- the best algorithm depends on what data you have coming in, but insertion or merge sort offer the best performance + reliabililty. Bubble sort === the worst.

Step One: Watch Writing Testable JavaScript - Rebecca Murphey from Full Frontal 2012 (award for worst conference name ever?)

Step Two: Fork this gist.

Step Three: Consider the four responsibilities that Rebecca lists for client side code (hint: they're color coded).

  • Did any of the responsibilities that she lists surprise you?
  • All of the responsibilities that Rebecca lists make sense now, but I hadn't thought to break up my Javascript that way before. In the past, I wrote code based on convenience instead of splitting them up into clearly-defined pieces. I really like the data/communication/server interactions piece, as I wasn't breaking up my code that way before.
  • Do you feel like you mentally split your client side code in IdeaBox and other past projects into these responsibilities?

Step One: Watch Mary Rose Cook Live Codes Space Invaders from Front-Trends. (The second worst conference name ever?)

Step Two: Fork this gist.

Step Three: Respond to this question in your fork: What is one approach you can take from this Mary's code and implement in your project?
I really liked her use of a game constructor that oversaw the main functions of how the game would be played. Makes her code very clear and easy to understand. Her use of a keyboarder object and way to implement collision detection were also cleaner than what I currently have in my game, and I'll look to model mine after hers.

Step Four: Totally Optional: take a look at some of the other forks and comment if the spirit moves you.