Skip to content

Instantly share code, notes, and snippets.

View Socratic1's full-sized avatar

Samuel (Sam) Phillips Socratic1

View GitHub Profile
class Pet
attr_reader :color, :breed
attr_accessor :name
def initialize(color, breed)
@color = color
@breed = breed
@hungry = true
end
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|
# #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
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
if (5+5==10)
puts "this is true"
else
puts "this is false"
end
def greeting
puts "Please enter your name:"
name = gets.chomp
p "Hello" + " " + name
end
greeting
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");
body {
position: relative;
height: 100%;
}
/* navbar */
.projectName > a {
padding-left: 1.8em;
<!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" />
/* 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;