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 | |
def feed(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
class Cat | |
attr_reader :color, :breed, :name | |
# attr_writer :name | |
attr_accessor :name | |
def initialize(color,breed) | |
@color = color | |
@breed = breed | |
@hungry = true | |
end | |
def feed(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
def fav_foods | |
food_array = Array.new | |
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
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 | |
puts "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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script> | |
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags --> | |
<title>Edward Li's Website</title> |
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; | |
/* background-color: #999; */ | |
} | |
.projectName a{ | |
color:white; | |
} | |
.container{ | |
padding-top:50px; | |
} |
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; | |
/* background-color: #999; */ | |
} | |
.projectName a{ | |
color:white; | |
} | |
.container{ | |
padding-top:50px; | |
} |
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
$(document).ready(function(){ | |
console.log("ready"); | |
//smooth scrolling | |
var $root = $('html, body'); | |
$('.navbar-nav a').click(function() { | |
var href = $.attr(this, 'href'); | |
if (href != undefined && href != '#') { | |
$root.animate({ | |
scrollTop: $(href).offset().top | |
}, 500, function () { |
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
$(document).ready(function(){ | |
var works = [ | |
{title: "Follow The Lead", url: "https://people.ucsc.edu/~edjli/art101/finalproject/edgame/midterm.html", pic: "img/followthelead.png"}, | |
{title: "#BIGMOOD", url: "https://people.ucsc.edu/~edjli/FINAL/myGame/", pic: "img/bigmood2.png"} ]; | |
for(var i = 0; i < works.length; i++){ | |
$("#work-work").append("\ | |
<div class='col-md-6 col-xs-12'>\ | |
<a href='"+ works[i].url+"' class='work-img'>\ | |
<img class='img-responsive' id ='workImg' src='" + works[i].pic + "'>\ |
NewerOlder