This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'faker' | |
topics = [] | |
15.times do | |
topics << Topic.create( | |
name: Faker::Lorem.words(rand(1..10)).join(" "), | |
description: Faker::Lorem.paragraph(rand(1..4)) | |
) | |
rand(5..12).times do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Started GET "/users/sign_in" for 127.0.0.1 at 2014-02-24 10:09:27 -0500 | |
Processing by Devise::SessionsController#new as HTML | |
Rendered devise/shared/_links.erb (1.0ms) | |
Rendered devise/sessions/new.html.erb within layouts/application (4.7ms) | |
Completed 200 OK in 38ms (Views: 36.3ms | ActiveRecord: 0.0ms) | |
Started GET "/users/auth/facebook" for 127.0.0.1 at 2014-02-24 10:09:30 -0500 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "./todo_item" | |
class TodoList | |
attr_reader = :name, :todo_items | |
def initialize(name) | |
@name = name | |
@todo_items = [ ] | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Person | |
attr_accessor :name, :age | |
def initialize | |
@name = name | |
end | |
def get_name | |
puts "What is your name?" | |
name = gets.chomp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Person | |
attr_accessor :name, :age | |
def initialize(name = nil, age = nil) | |
@name = name | |
@age = age | |
end | |
def get_name_from_user | |
if @name.nil? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Temperature | |
attr_accessor :temperature, :scale | |
def initialize(temperature = nil, scale = nil) | |
@temperature = temperature | |
@scale = scale | |
get_temperature | |
end | |
def get_temperature |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'date' | |
class PerDiem | |
PERDIEM = 93.00 | |
attr_accessor :start_date, :end_date, | |
def initalize(start_date, end_date) | |
@start_date = start_date |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'date' | |
class PerDiem | |
attr_accessor :start_date, :end_date, | |
def initalize(start_date, end_date, per_diem) | |
@start_date = start_date |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// WISEPERSON GENERATOR | |
function wisePerson(wiseType, whatToSay) { | |
// your code here | |
var phrase = 'A wise ' + wiseType + ' once said: "' + | |
whatToSay + '".' | |
return phrase; | |
} | |
/* From here down, you are not expected to |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SQUARE AREA | |
function computeArea(width, height) { | |
// your code here | |
return width * height; | |
} | |
/* From here down, you are not expected to | |
understand.... for now :) | |
OlderNewer