Skip to content

Instantly share code, notes, and snippets.

View ademsas's full-sized avatar

Tish Demsas ademsas

View GitHub Profile
@ademsas
ademsas / cat.rb
Created April 6, 2016 04:24
Ruby CF 3.5
class Pet
attr_reader :color, :breed
attr_accessor :name
def initialize(color, breed)
@color = color
@breed = breed
@hungry = true
end
def feed(food)
puts "Mmmm, " + food + "!"
@ademsas
ademsas / cat.rb
Created April 5, 2016 03:45
Ruby CF 3.4
class Cat
attr_reader :color, :breed
attr_accessor :name
def initialize(color, breed)
@color = color
@breed = breed
@hungry = true
end
def feed(food)
puts "Mmmm, " + food + "!"
@ademsas
ademsas / fav_foods.rb
Created April 4, 2016 20:16
Ruby CF 3.3
def fav_foods
food_array = []
3.times do
puts "Name a favotite food."
food_array << gets.chomp
end
puts "Your favorite foods are #{food_array.join(", ")}."
p food_array
food_array.each do |food|
puts "I like #{food} too!"
@ademsas
ademsas / program2.rb
Last active April 4, 2016 18:13
Ruby CF 3.2
if (5+5==10) || (6+4=10)
puts "this is true"
else
puts "this is false"
end
@ademsas
ademsas / program.rb
Created March 24, 2016 03:26
Ruby CF 3.1
my_name = "Tishy"
def greeting
puts "Please enter your name:"
name = gets.chomp
puts "Hello" + " " + name
end
greeting
@ademsas
ademsas / index.html
Created March 15, 2016 03:37
Google Maps JS
<!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>Tish Demsas</title>
@ademsas
ademsas / script.js
Created March 12, 2016 16:29
Works w/ Object Literal
// Facebook
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.5";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
// Twitter
@ademsas
ademsas / index.html
Last active March 8, 2016 05:31
Works w/ For-Loop
<!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>Tish Demsas</title>
@ademsas
ademsas / index.html
Created February 29, 2016 04:45
My Page w/ JS 2.7
<!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>Tish Demsas</title>
@ademsas
ademsas / index.html
Created February 29, 2016 03:18
My Page w/ JS 2.6
<!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>Tish Demsas</title>