Skip to content

Instantly share code, notes, and snippets.

View darinthompson's full-sized avatar

Darin Thompson darinthompson

  • Coeur d'Alene, Idaho
View GitHub Profile
@darinthompson
darinthompson / per_diem.rb
Last active January 25, 2016 00:50
Calculates amount of money made between two dates.
require 'date'
class PerDiem
PERDIEM = 93.00
attr_accessor :start_date, :end_date,
def initalize(start_date, end_date)
@start_date = start_date
@darinthompson
darinthompson / temp.rb
Last active January 5, 2016 22:22
temp converter
class Temperature
attr_accessor :temperature, :scale
def initialize(temperature = nil, scale = nil)
@temperature = temperature
@scale = scale
get_temperature
end
def get_temperature
@darinthompson
darinthompson / gist:47ceb7a4fa6f574fff87
Created December 28, 2015 23:22
updated from other gist
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?
@darinthompson
darinthompson / gist:de1ad7f1c901c978019c
Created December 28, 2015 19:36
Greeting not working. I don't understand what's happening.
class Person
attr_accessor :name, :age
def initialize
@name = name
end
def get_name
puts "What is your name?"
name = gets.chomp
@darinthompson
darinthompson / gist:b6ce19072ea7cdcd99d8
Created December 11, 2015 16:17
Random simply bit of text. Cant seem to figure out the difference
require "./todo_item"
class TodoList
attr_reader = :name, :todo_items
def initialize(name)
@name = name
@todo_items = [ ]
end
@darinthompson
darinthompson / requestLog
Created February 24, 2014 15:10
Request log- a couple tries
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
@darinthompson
darinthompson / seeds.rb
Created February 2, 2014 20:50
My seeds.rb file...
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