Skip to content

Instantly share code, notes, and snippets.

View malisbad's full-sized avatar

Matt Williams malisbad

View GitHub Profile
@malisbad
malisbad / IRB w1d2
Created September 1, 2015 16:58
LHL W1D2 Exercise
2.1.3 :001 > def say_hi(name)
2.1.3 :002?> "Hi, #{name}"
2.1.3 :003?> end
=> :say_hi
2.1.3 :004 > say_hi("Matt")
=> "Hi, Matt"
2.1.3 :005 > my_array=[5,3,7,2]
=> [5, 3, 7, 2]
2.1.3 :006 > my_array.sort
=> [2, 3, 5, 7]
def square_foot_cost(length, width)
sq_ft = length * width
sq_ft_rate = 15
sq_ft_rate * sq_ft
end
def colour_cost(num_colours) #you can customize the rates here for colours
colour_rate = 10
additional_colour_rate = 15
if num_colours <= 2
#Classical inheritance exercise
module Flight
attr_accessor :airspeed_velocity
def fly(airspeed_velocity)
return "I'm a #{self.class.to_s.downcase}, I'm flying!"
end
end
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">

Keybase proof

I hereby claim:

  • I am malisbad on github.
  • I am omgwtfbbq (https://keybase.io/omgwtfbbq) on keybase.
  • I have a public key ASDi4V5tbu1Uaxp-2-k_r0UuYWUkuxkDzj8_bxKbPWzARwo

To claim this, I am signing this object: