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 Pet | |
attr_reader :color, :breed | |
attr_accessor :name | |
def initialize(color, breed) | |
@color = color | |
@breed = breed | |
@hungry = true | |
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
def fav_foods | |
food_array = [] | |
3.times do | |
puts "Name a favorite food." | |
food_array << gets.chomp | |
end | |
p food_array | |
puts "Your favorite foods are #{food_array.join(", ")}." | |
food_array.each do |food| |
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
# #3.times do | |
# # puts "Hello!" | |
# #end | |
# number = 0 | |
# while (number <= 10) do # while this condition is true, do... | |
# p "the number is now #{number}" # whatever is in this code block | |
# number += 1 # short for number = number + 1 | |
# 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
def choose | |
puts "Do you like programming? Yes or no please." | |
choice = gets.chomp | |
if (choice.downcase == "yes") | |
puts "That\'s great!" | |
elsif (choice.downcase == "no") | |
puts "That\'s too bad!" | |
else | |
puts "That wasn't a yes or no." | |
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
if (5+5==10) | |
puts "this is true" | |
else | |
puts "this is false" | |
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
def greeting | |
puts "Please enter your name:" | |
name = gets.chomp | |
p "Hello" + " " + name | |
end | |
greeting |
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
var myWorks = [ { title: "Work in Progress 1", pic: "img/work-in-progress.png"}, | |
{ title: "Work in Progress 2", pic: "img/work-in-progress.png"}, | |
{ title: "Work in Progress 3", pic: "img/work-in-progress.png"}, | |
{ title: "Work in Progress 4", pic: "img/work-in-progress.png"} | |
]; | |
$(document).ready(function() { | |
$(".message-box").css("background-color", "pink"); |
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
body { | |
position: relative; | |
height: 100%; | |
} | |
/* navbar */ | |
.projectName > a { | |
padding-left: 1.8em; |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Sam Phillips. Web Developer</title> | |
<meta property="og:url" content="http://purchasing-officer-coders-58830.bitballoon.com/" /> | |
<meta property="og:type" content="website" /> | |
<meta property="og:title" content="Your Website Title" /> | |
<meta property="og:description" content="Your description" /> |
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
/* navigation */ | |
.nav { | |
background: -webkit-linear-gradient(left, rgba(0, 0, 0, .90) , rgba(90, 50, 0, .90)); /* For Safari 5.1 to 6.0 */ | |
background: -o-linear-gradient(right, rgba(0, 0, 0, .90) , rgba(90, 50, 0, .90)); /* For Opera 11.1 to 12.0 */ | |
background: -moz-linear-gradient(right, rgba(0, 0, 0, .90) , rgba(90, 50, 0, .90)); /* For Firefox 3.6 to 15 */ | |
background: linear-gradient(to right, rgba(0, 0, 0, .90) , rgba(90, 50, 0, .90)); /* Standard syntax */ | |
position: fixed; | |
width: 100%; | |
top: 0; |
NewerOlder