Skip to content

Instantly share code, notes, and snippets.

@cheljoh
cheljoh / require-1511.markdown
Last active May 20, 2016 15:29 — forked from rrgayhart/require-1511.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?
  • It's a building block that maps to a file. Load it by using 'require,' export it by using module.exports.

Step One: Watch Sorting Algorithms in JavaScript

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?"

  • The .sort() is lexographical, so 10 comes before 7.
  • Three important characteristics:
  • stability- maintain relative order
  • runtime anaylsis
@cheljoh
cheljoh / cfu_crud_in_sinatra.markdown
Created February 2, 2016 20:15 — forked from rwarbelow/cfu_crud_in_sinatra.markdown
CRUD in Sinatra -- Check for Understanding
  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?