Skip to content

Instantly share code, notes, and snippets.

View rwarbelow's full-sized avatar
💭
hungry

Rachel Warbelow rwarbelow

💭
hungry
  • Guild Education
  • Denver, CO
View GitHub Profile
@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 / 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
@rwarbelow
rwarbelow / tidy-up.markdown
Last active November 2, 2015 23:43
Posse Tidy-Up Duties

Tasks

Classrooms

  • wipe down tables
  • remove cups and other kitchenware
  • wipe surfaces of public screens (TVs, pairing monitors)
  • tidy up cords at the front of each classroom
  • water plants according to schedule

Pairing Stations and Group Setups

var person = {
firstName: 'Steve',
lastName: 'Kinney',
updateName: function () {
$.getJson('/api/vi/person', function () {
this.firstName = 'Wes'
}.bind(this));
}
};
@rwarbelow
rwarbelow / gist:5622468
Created May 21, 2013 19:23
Fibonacci Numbers
def is_fibonacci?(i)
tester1 = Math.sqrt((5*(i*i)) + 4)
tester2 = Math.sqrt((5*(i*i)) - 4)
if (tester1 - tester1.to_i) == 0 or (tester2 - tester2.to_i) == 0
return true
else
return false
end
end
### PART 1 (write tests)
class Car
@@WHEELS = 4
def initialize(args)
@color = args[:color]
@wheels = @@WHEELS
end
def drive
@status = :driving
@rwarbelow
rwarbelow / index.html
Last active December 20, 2015 03:59 — forked from dbc-challenges/index.html
DBC Phase 2 Practice Assessment Part 3
<!doctype html>
<html>
<head>
<link rel="stylesheet" href="http://cdn.jsdelivr.net/normalize/2.1.0/normalize.css">
<link rel="stylesheet" href="main.css">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Lato:100,900">
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/font-awesome/3.0.2/css/font-awesome.min.css">
</head>
def find_submissions(course)
@course_category_submissions = Hash.new([])
self.submissions.each do |submission|
cat = "#{submission.assignment.assignment_category.name}"
weight = submission.assignment.assignment_category.weight
@course_category_submissions[[cat, weight]] = []
end
self.submissions.each do |submission|
cat = "#{submission.assignment.assignment_category.name}"
weight = submission.assignment.assignment_category.weight
@rwarbelow
rwarbelow / gist:6665955
Created September 23, 2013 02:44
Admin trying to edit a student's information. A student has an "Identity" attached to it which contains a first name, last name, username, and password.
Started PUT "/admin/student_profiles/155" for 127.0.0.1 at 2013-09-22 19:35:39 -0700
Processing by Admin::StudentProfilesController#update as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"Ms4TZwzD3X2729++CmQSRompltCRrTDQS96/NYn0HAw=", "student"=>{"birthday"=>"1985-05-05", "gender"=>"male", "grade_level"=>"7", "ccsd_id"=>"3333488", "email"=>"gudhsgiuh@gnodjsgh.com"}, "identity"=>{"username"=>"gracealtenwerth", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"}, "commit"=>"Update", "id"=>"155"}
Identity Load (0.3ms) SELECT "identities".* FROM "identities" WHERE "identities"."id" = 402 LIMIT 1
Admin Load (0.3ms) SELECT "admins".* FROM "admins" WHERE "admins"."id" = 1 LIMIT 1
Student Load (0.2ms) SELECT "students".* FROM "students" WHERE "students"."id" = $1 LIMIT 1 [["id", "155"]]
Identity Load (0.4ms) SELECT "identities".* FROM "identities" WHERE "identities"."student_id" = 155 LIMIT 1
(0.1ms) BEGIN
Identity Exists (0.3ms) SELECT 1 AS one FROM "identities" WHERE ("ide
@rwarbelow
rwarbelow / warmup_how_the_web_works.markdown
Created February 2, 2016 15:59
Warmup: How the Web Works