Homework for 15B

Review

Topics Covered: Social Integration; Using the omniauth-facebook gem


Exercises

E1: To meow or not to meow, that is the question.

All social-media sites were not created equal (Meowbook is obviously superior). However, we can't ignore the user base of the big FB. Integrating the two, and allowing users to sign into Meowbook with their FB account, is a nice additional feature for our fantastical feline site.

At this stage of the game, we aren't going to actively enforce doing the exercises anymore. The lecture content is now moving into the range of "nice to know". If you would like to use Omniauth in your projects, we recommend you try it out on Meowbook first, otherwise, you can continue working on your projects.

E2: README!

  1. Use the Sublime Package Manager. Do it. Installing Emmet, ERB Snippets, HTML Beautify and ColorPicker or any additional packages that intrigue you will change your life. And more importantly, it'll make people think that you're a 1337 C0D3R.
  2. Set up opening sublime from the command line. The serenity of a clean working flow is just a google search away, so take some time now to set up this awesome feature.
  3. Be cautious about using better_errors. As some of you may have noticed, while sometimes this gem gives you great information about where and what your error is, sometimes it tells you absolutely nothing. In fact, sometimes, it points you in the wrong direction. If you're stuck on an error for a while, try tackling it without better_errors
  4. Don't include gems if you don't know what they do. Everytime a guide tells you to add a gem to your gemfile, do some research and try to find out what the gem is and why you need it for your project. If you end up not finding a good reason, don't include the gem. For example, the bootstrap-sass gem tells you to install autoprefixer-rails, but this isn't needed and can cause crazy errors.
  5. Know your syntax across different files and environments. From Rails files to your Bash files to YAML files, each type has its own requirements that must be respected. For example, we learned yesterday that YAML files don't like tabs, and some of us learned the hard way that Bash doesn't like spaces unless absolutely required. That is,
    export PASSWORD = "oncerocks" is invalid, and should be export PASSWORD="oncerocks"
  6. Play around with alias. This is for Mac-like terminals only. alias is a really cool way to rename terminal commands to whatever you want. For example, I have an alias gac that I can type instead of git add . && git commit -m. Here's a great resource for doing this.
  7. Know your parameter options. Many of you are having trouble passing information from page to page. The bottom line is that each page is a blank slate without any knowledge of information on prior pages unless you give it more information with params. This can be done through hidden inputs in forms, putting params right in the URL like "/users/1", or using the query string like "/reviews?restaurant_id=3".