Skip to content

Instantly share code, notes, and snippets.

View jdliss's full-sized avatar

Jonathan Liss jdliss

  • Denver, CO
View GitHub Profile

Introduction to Sinatra

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

  • The server file contains the routing information for what to do and what to display when different requests are recieved.

2. How do you pass variables into the views?

  • Throw your stuff into an instance variable, or pass it in using hash syntax, "new var name (for use in view)" => "what you want to pass to the view"

3. How can we interpolate ruby into a view (html)?

Models, Databases, Relationships in Rails

What is the difference between a primary key and a foreign key?

  • a primary key is the id of the current table, a foreign key is the id of a different table

Where would we find a primary key?

  • in the id field of the table

Having fun or crying with C/C++

compiled vs dynamic languages

  • how the ruby interpreter works
  • how compiling works

memory allocation and data types

  • arrays/vectors
  • c-strings vs strings

git stash

  • Use when you want to store your local changes, but revert back to the current state of the HEAD commit

git stash apply

  • use this when you want to reapply the most recent stash you made. git stash apply stash@{2} will apply the second most recent, etc.

git shortlog