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 / warmup_how_the_web_works.markdown
Created February 2, 2016 15:59
Warmup: How the Web Works
@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?
var person = {
firstName: 'Steve',
lastName: 'Kinney',
updateName: function () {
$.getJson('/api/vi/person', function () {
this.firstName = 'Wes'
}.bind(this));
}
};
@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.

@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 / setting_up_styling_in_sinatra.markdown
Created October 12, 2015 22:04
Setting up styling in Sinatra
  • Create a public folder within app. This is where you will store your css, javascripts, and images
  • Create a file application.css within app/public. This is where you will put your custom CSS.
  • Inside app/views, create a file layout.erb. This will automatically render around any other .erb file that you specify to render in your route block. Add the following code to the layout.erb file:
<!DOCTYPE html>
<html lang="en">
<head>
  <link rel="stylesheet" href="/application.css">
 My Sinatra Application

Part I: User Creation

  1. add route for new_user_path
  2. create a UsersController with new action
  3. create new.html.erb
  4. generate user model with password_digest string field
  5. uncomment gem 'bcrypt' in Gemfile and add has_secure_password in User model
  6. add create action in UsersController
  7. implement logic for creating a user
  8. set session[:user_id] in create action
@rwarbelow
rwarbelow / gist:121a502596b5d9bc9e04
Last active August 29, 2015 14:25
Testing Validations in Rails

Model Testing Validations in Rails (60 min)

Key Topics

During our session, we'll learn how to test model validations.

Warmup

Clone this app: git clone -b model-testing git@github.com:turingschool-examples/belibery.git.

@rwarbelow
rwarbelow / gist:f41878ff2c6a1649ec95
Last active August 29, 2015 14:24
Student-Led Session Ideas
  • Whiteboarding
  • Refactoring techniques
  • Small JavaScript projects
  • Front-end design
  • Advanced Command Line
  • Sonic Pi
  • iOS development
  • Building a gem
  • Data Structure and Algorithms
  • Technical Interview Prep
  1. Write a program that can convert Arabic numbers 1-3000 to Roman numerals. For example:
converter = RomanConverter.new
converter.to_roman(6)
=> "VI"

converter.to_roman(14)
=> "XIV"