Skip to content

Instantly share code, notes, and snippets.

View drew-t's full-sized avatar

Drew Thompson drew-t

View GitHub Profile

Introduction to Sinatra

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

The server file takes in the requests from clients and calls on the appropriate logic/views to send back a response to the client.

2. How do you pass variables into the views?

You can pass instance variables, or you can pass a local variable by passing it via :locals in erb.

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

@drew-t
drew-t / cfu_crud_in_sinatra.markdown
Last active March 23, 2016 04:26 — forked from rwarbelow/cfu_crud_in_sinatra.markdown
CRUD in Sinatra -- Check for Understanding
  1. Define CRUD. CRUD stands for Create, Read, Update, and Delete. These are the main functions that we can do to data.
  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. get + /tasks: Read all tasks get + /tasks/:id: Read specific task get + /tasks/new: get form to fill out new task post + /tasks: Create a new task get + /tasks/:id/edit: See form to edit task info put + /tasks/:id: change task delete + /tasks/:id: delete a task
## 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 can only appear once in a table, foreign key points to an object with a primary key in another table. Primary key is normally called id in postgres.
We would find a foreign key when we reference an object from another table. naming convention: table_id
#### Write down one example of:
* a `one-to-one `relationship.
@drew-t
drew-t / commit_messages.md
Created April 14, 2016 15:43
Best Practices for Git Commits
  • Separate subject from body with a blank line
  • Limit the subject line to 50 characters
  • Capitalize the subject line
  • Do not end the subject line with a period
  • Use the imperative mood in the subject line
    • If applied, this commit will your subject line here
  • Wrap the body at 72 characters
  • Use the body to explain what and why vs. how
    • Why is the change necessary?
  • High level how?

Setting Group Expectations

Group Member Names:

  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?

Everyone is generally available to work at any time. Drew would prefer to leave earlier when possible. Ali needs to run home and let dog out occasionally after school.

  1. How will group members communicate? How often will communication happen, and how will open lines of communication be maintained?
1. Combine the files. Having fewer files saves space and takes less time to load.
2. Precompile means that those files are changed into basic css or javascript before they are run.
3. minify means to strip them of whitespace, http://cdn.speedrak.com/images/blog-images/seoblogger-after-minify-css.PNG
4. the file in the browser is showing all js from the entire site vs solely what we have in that file(concatenated)
5. instructions that tell Sprockets which files to require in order to build a single CSS or JavaScript,
application.js, application.css
6. *= require_***** application.css.scss
7. provides an easy way to tell whether two versions of a file are identical, allows for caching: check to see if name has changed
if not, don't pull down file
##Leap
My code: [here](http://exercism.io/submissions/8c56e59a0a2b47189f3d771527b60d0e)
* Responder #1 ([here](http://exercism.io/submissions/2aaa103d3df4428485950574c056d645))
- uses a single line && || operation. very nice versus my if else
* Responder #2 ([here](http://exercism.io/submissions/3641b7941aa9403c8633e8d420bbc317))
- very similar to mine. if, else if, else for every possibility
* Responder #3 ([here](http://exercism.io/submissions/f3609179f03649d9bfcba070b24277ba))
- again, similar to mine

Keybase proof

I hereby claim:

  • I am drew-t on github.
  • I am drewt (https://keybase.io/drewt) on keybase.
  • I have a public key whose fingerprint is 326D 1822 5F33 0958 F0C0 A2A2 AE79 E4F0 E718 6405

To claim this, I am signing this object:

Parkifi:
What they do: Provide spot-by-spot information to parking lots and garages whether spots are in use or not.
What we did:
Shadow Jessica(Turing Alum):
Jessica was pairing with another developer to learn Java and implement a new feature.
Shadow Matt:
Matt was testing a new simulation system that they had written in Elixir.
They built it to test different algoritms to detect the presence of vehicles.
Attend Retro:
They hadn't been having retro and this was their first one (at least in a while from my understanding).