Skip to content

Instantly share code, notes, and snippets.

💭
hungry

Rachel Warbelow rwarbelow

💭
hungry
Block or report user

Report or block rwarbelow

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@rwarbelow
rwarbelow / gist:5622468
Created May 21, 2013
Fibonacci Numbers
View gist:5622468
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
View P5: OO Inheritance.rb
### 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 Dec 20, 2015 — forked from dbc-challenges/index.html
DBC Phase 2 Practice Assessment Part 3
View index.html
<!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>
View gist:6478919
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 Sep 23, 2013
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.
View gist:6665955
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 / encryptor.rb
Created Mar 11, 2014
We created a class called SecretCode that takes a word or sentence and encodes it. It also has a method that decodes the secret message.
View encryptor.rb
ENCODE = { "a" => "j", "b" => "3", "c" => "l", "d" => "m", "e" => ".",
"f" => "o", "g" => "p", "h" => "4", "i" => "r", "j" => "&", "k" => "t",
"l" => "u", "m" => "v", "n" => "#", "o" => "x", "p" => "y", "q" => "9",
"r" => "a", "s" => "$", "t" => "c", "u" => "[", "v" => "e", "w" => "f",
"x" => "g", "y" => "8", "z" => "i", " " => " " }
DECODE = { "j" => "a", "3" => "b", "l" => "c", "m" => "d", "." => "e",
"o" => "f", "p" => "g", "4" => "h", "r" => "i", "&" => "j", "t" => "k",
"u" => "l", "v" => "m", "#" => "n", "x" => "o", "y" => "p", "9" => "q",
"r" => "a", "s" => "$", "t" => "c", "u" => "[", "v" => "e", "w" => "f",
@rwarbelow
rwarbelow / event_attendees.csv
Last active Aug 29, 2015
We took zip codes from a CSV file. We checked to see if the zip code was nil or less than five digits. If so, we fixed the zip code by adding 0s or putting "no zip code."
View event_attendees.csv
We can make this file beautiful and searchable if this error is corrected: It looks like row 10 should actually have 10 columns, instead of 7. in line 9.
,RegDate,first_Name,last_Name,Email_Address,HomePhone,Street,City,State,Zipcode
1,11/12/08 10:47,Allison,Nguyen,arannon@jumpstartlab.com,6154385000,3155 19th St NW,Washington,DC,20010
2,11/12/08 13:23,SArah,Hankins,pinalevitsky@jumpstartlab.com,414-520-5000,2022 15th Street NW,Washington,DC,20009
3,11/12/08 13:30,Sarah,Xx,lqrm4462@jumpstartlab.com,(941)979-2000,4175 3rd Street North,Saint Petersburg,FL,33703
4,11/25/08 19:21,David,Thomas,gdlia.lepping@jumpstartlab.com,650-799-0000,9 garrison ave,Jersey City,NJ,7306
5,2/2/09 11:29,Chris,Sackett,fpmorgan07@jumpstartlab.com,613 565-4000,173 Daly Ave,Ottawa,ON,
6,11/12/08 15:00,Aya,Fuller,jtex@jumpstartlab.com,778.232.7000,2-1325 Barclay Street,Vancouver,BC,90210
7,11/12/08 16:05,Mary Kate,Curry,wmppydaymaker@jumpstartlab.com,(202) 328 1000,1509 Jackson Street,Baltimore,MD,21230
8,11/12/08 17:18,Audrey,Hasegan,ffbbieucf@jumpstartlab.com,530-919-3000,1570 Old Ranch Rd.,Placerville,CA,95667
9,11/13/08 1:32,Shiyu,Armideo,odfarg06@jumpstartlab.com,8084974000,644 Ike
You can’t perform that action at this time.