Skip to content

Instantly share code, notes, and snippets.

View themonster2015's full-sized avatar
👋

Yen Vo themonster2015

👋
  • Spain
View GitHub Profile
<!DOCTYPE html>
<html lang=“en”>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!--[if lt IE 9]>
<script src="dist/html5shiv.js"></script>
<![endif]-->
<title>Jen Vo - About Me</title>
</head>
<!DOCTYPE html>
<html lang=“en”>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/about_styles.css">
<!--[if lt IE 9]>
<script src="dist/html5shiv.js"></script>
.container {
width: 80%;
margin: 0 auto;
}
.header h1 {
text-align: center;
}
.image {
display: inline-block;
float: left;
def flattify(array)
array.each_with_object([]) do |element, flattened|
flattened.push *(element.is_a?(Array) ? flattify(element) : element)
end
end
<!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">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>Kervin Vasquez!</title>
def greeting
puts "Your name:"
name = gets.chomp
puts "Hello" + " " + name
end
greeting
variable is used to store values in the memory, method is a function, argument is variable that we give a method
"2" + "2" doesn't give you 4 in Ruby because they are strings
if (5==5) && (1!=2)
puts "You are wonderful"
else
3.times do
puts "You Suck!"
end
end
class Cat
attr_reader :color, :breed
attr_accessor :name
def initialize(color, breed)
@color = color
@breed = breed
@hungry = true
end
require_relative './pet'
class Cat < Pet
def speak
puts "Meow!"
end
end
kitty = Cat.new("beige", "Persian")
def fav_foods
food_array = []
3.times do
puts "Name a favorite food."
food_array << gets.chomp
puts "Your favorite foods are #{food_array.join(", ")}."
food_array.each { |food| puts "Seriously? I really love #{food} too!"}
array.push("Mango")
array.pop
array.reverse!