Skip to content

Instantly share code, notes, and snippets.

View rwarbelow's full-sized avatar
💭
hungry

Rachel W rwarbelow

💭
hungry
View GitHub Profile
@rwarbelow
rwarbelow / setting_expectations.markdown
Last active July 22, 2019 21:10
Setting Expectations

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?

  2. How will group members communicate? How often will communication happen, and how will open lines of communication be maintained?

  3. Which feature(s) does each group member want to work on? Which feature(s) does each group member not want to work on?

@rwarbelow
rwarbelow / running_app_in_production_locally.markdown
Created November 11, 2015 18:26
How to Run a Rails App in Production Locally
  1. Add gem 'rails_12factor' to your Gemfile. This will add error logging and the ability for your app to serve static assets.
  2. bundle
  3. Run RAILS_ENV=production rake db:create db:migrate db:seed
  4. Run rake secret and copy the output
  5. From the command line: export SECRET_KEY_BASE=output-of-rake-secret
  6. To precompile your assets, run rake assets:precompile. This will create a folder public/assets that contains all of your assets.
  7. Run RAILS_ENV=production rails s and you should see your app.

Remember to clobber your assets (rake assets:clobber) and re-precompile (rake assets:precompile) if you make changes.

var person = {
firstName: 'Steve',
lastName: 'Kinney',
updateName: function () {
$.getJson('/api/vi/person', function () {
this.firstName = 'Wes'
}.bind(this));
}
};
@rwarbelow
rwarbelow / cfu_crud_in_sinatra.markdown
Created December 1, 2015 18:00
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?
@rwarbelow
rwarbelow / warmup_how_the_web_works.markdown
Created February 2, 2016 15:59
Warmup: How the Web Works
@rwarbelow
rwarbelow / adding_categories_to_taskmanager.markdown
Last active February 5, 2016 07:31
Adding Categories to Task Manager

Adding Categories to Task Manager

First, delete both task_manager_development.sqlite3 and task_manager_test.sqlite3. Then make sure you have the following code in your migration file (001_create_tasks.rb):

require 'sequel'

environments = ["test", "development"]

environments.each do |env| 
@rwarbelow
rwarbelow / saving_energy_at_turing.md
Last active February 15, 2016 22:48
Saving Energy at Turing

Energy-Saving MacBook Tips

Customize Energy Saver Settings

  • Open System Preferences
  • Select "Energy Saver"
  • Move the "Turn display off after" slider to 10 min on both the Battery tab and the Power Adapter tab
  • Check "Put hard disks to sleep when possible" on both the Battery tab and the Power Adapter tab
  • Check "Slightly dim the display while on battery power"
@rwarbelow
rwarbelow / sessions_cookies_flashes_homework.markdown
Last active August 25, 2016 15:07
Sessions, Cookies, and Flashes Homework

Homework

  1. Using a Flash

Implement a flash[:notice] in the ToolsController #create action for when you successfully create a tool. Extension: Modify your #create action to conditionally create a tool depending on whether or not a name is provided. Then create a flash[:error] that holds @tool.errors.full_messages.join(", "). Use a dynamic content generator to display the flash notice. Take a look at 20:33 in the Sessions, Cookies, and Flashes video for a refresher on how to do this.

  1. Storing Most Recent Tool in the Session
  • Store the id of the last tool added to ToolChest in the session with a key of :most_recent_tool_id.
  • Add a method to your ApplicationController called most_recent_tool that loads the most recent tool using :most_recent_tool_id stored in the session. (Hint: use Tool.find... and make sure it doesn't break if there are no tools in the database!)

Use a Schema Designer to create schemas for the following problems:

  1. City Library System
  • a user can check out books
  • books have one or more authors
  • books belong to a library branch
  • a book can be reserved by a user
  1. Movie Showtimes
  • a movie has many showtimes at various theaters
This file has been truncated, but you can view the full file.