Skip to content

Instantly share code, notes, and snippets.

View theonlyrao's full-sized avatar

Ashwin Rao theonlyrao

View GitHub Profile
@theonlyrao
theonlyrao / ashwin-mock-assessment-submission.markdown
Last active August 3, 2016 20:08 — forked from rrgayhart/1602-mock-assessment-submission.markdown
ashwin-mock-assessment-submission.markdown

WebSockets Workshop (30 points)

Websockets Workshop

My Repo

I did not complete the code along. I was able to get a users previous vote to render on the page. I was also able to get the full tally of votes to be sent back to the user. However, I wasn't able to parse the returned aggregate vote information in a way that would let me render it on the page.

Since I could not get the aggregated vote information to display, I did not try to format it nicely.

Testing Homework - Rails/JS

  • Your experience implementing

I tried both unit using Jasmine-Rails and feature testing using Capybara.

  • Were you successful?

I was not successful in implementing Jasmine-Rails, but I was successful impelemting feature testing using Capybara. The feature testing is nice in that it lets me confirm what a user is setting, but it would have been good to have spies set up through Jasmine-Rails so that I can confirm that the ajax calls are actually hitting the correct route with the correct data.

  • What is ES6?

"ES6", or ECMAScript 6, is the latest version of JavaScript. It brings multiple updates to JS.

  • What is Transpilation and how does it relate to ES6?

Transpilation is a form of compliation. Compiling takes a language and turns it into another language; transpiling takes a language and turns it into a language with the same level of abstraction.

  • Looking at the ES6 Features link below, discuss one update from ES5 and if it seems useful/superfluous.
## Models, Databases, Relationships in Rails
#### What is the difference between a primary key and a foreign key? Where would we find a primary key? What would it be called by default? Where would we find a foreign key? What is the naming convention for a foreign key?
Primary key is a unique identifier in Table. It can exist as a foreign key in AnotherTable or other tables with which it has a relationship. "id" - default name. "table_id" in AnotherTable.
#### Write down one example of:
* a `one-to-one `relationship.
(in the contemporary West), one husband has one wife
@theonlyrao
theonlyrao / cfu_crud_in_sinatra.markdown
Last active March 23, 2016 04:22 — forked from rwarbelow/cfu_crud_in_sinatra.markdown
CRUD in Sinatra -- Check for Understanding

Define CRUD.

  • Create - tells the server to make a new instance
  • Read - asks the server for information
  • Update - tells the server to change something in an existing instance
  • Delete - tells the server to remove something

These four functions are necessary for a complete web application.

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.

Introduction to Sinatra

1. What is the purpose of the server file (routing)?

The server file accepts, parses, and controls the sending of the response. It will contain get or post etc. verb blocks based on the client's chosen path and then contain instructions for the rest of the web application to follow in collecting information from a database and then rendering that information in the context of the user's request.

2. How do you pass variables into the views?

  • Make the variable a local variable, var. Then pass the variable as an argument into the view as a hash.