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
array1 = %w{ a b c} | |
array2 = %w{ b c d} | |
puts array1.select {|num| array2.include? num } |
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 | |
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 #shovel operator - takes the user inputs with gets.chomp and makes them elements of the array food_array# | |
end | |
puts "Your favorite foods are #{food_array.join(",")}" | |
food_array.each do |food| | |
puts "I like #{food} too!" | |
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
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
//*My first Code starts Here*// | |
var myProjects = [ { title: "First Project", pic: "img/Innenansichten.JPG" }, | |
{ title: "Second Project", pic: "img/aruroralia.jpg" }, | |
{ title: "Third Project", pic: "img/orfanelle.jpg" } ]; | |
/* Hidden Navbar */ | |
$(document).ready(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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta name="viewport" content="width=device-width, initial-scale=0.8"> | |
<!--SCRIPTS--> | |
<!-- Adobe Fonts Script --> | |
<script src="http://use.edgefonts.net/cabin:n4,i4,n7,i7,n5,i5,n6,i6:all.js"></script> | |
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 name="viewport" content="width=device-width, initial-scale=0.8"> | |
<!--SCRIPTS--> | |
<!-- Adobe Fonts Script --> | |
<script src="http://use.edgefonts.net/cabin:n4,i4,n7,i7,n5,i5,n6,i6:all.js"></script> | |
<!-- Twitter Button Script --> | |
<script> | |
!function(d,s,id) |
NewerOlder