Skip to content

Instantly share code, notes, and snippets.

View Phoenix23A's full-sized avatar

Phoenix23A

  • Switzerland
View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<title>Nameofapp</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<!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">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="styles.css">
<link rel="stylesheet" href="css/styles.css">
<!DOCTYPE html>
<html>
<head>
<title>Nameofapp</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<!DOCTYPE html>
<html>
<head>
<title>MyNewApp</title>
<%= stylesheet_link_tag "application", media: "all". "data-turbolinks-track" => true %>
<%= javascript_include_tag "application", "data-turbolinks-track" => true %>
<%= csrf_meta_tags %>
</head>
<body>
<h1>Welcome to Bike Berlin</h1>
class Dog < Pet
def speak
puts "Woof!"
end
end
puppy = Dog.new("black", "Staffordshire Terrier")
puppy.speak
puts puppy.breed
class Cat
attr_reader :color, :breed
attr_accessor :name
def initialize(color, breed)
@color = color
@breed = breed
@hungry = true
end
def fav_foods
food_array = [] # instead of the brackets, you can also use Array.new to make a new empty array
end
3.times do
puts "Name a favorite food."
food_array << gets.chomp
puts "Your favorite foods are #{food_array.join("fav_foods")}."
#Method fav_foods#
end
number = 0
#while#
(0..10).each do |n|# 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 # don’t forget your 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 true
puts "this is true"
else
puts "this is false"
end
if (5+5==10)
puts "this is true"
else
puts "this is false"