Skip to content

Instantly share code, notes, and snippets.

def greeting
puts "Please enter your name:"
name = gets.chomp
puts "Hello" + " " + name
end
greeting
@steamgeek7
steamgeek7 / cat.rb
Last active January 28, 2019 23:13
Cat .rb
class Pet
attr_reader :color, :breed
attr_accessor :name
def initialize(color, breed)
@color = color
@breed = breed
@hungry = true
end
@steamgeek7
steamgeek7 / fav_foods.rb
Created January 23, 2019 00:27
Fav_Foods.rb
def fav_foods
food_array=[]
3.times do
puts "Name your favorite food."
food_array << gets.chomp
end
p food_array
food_array.each { |food| puts "I like #{food} too!" }
puts "Your favorite foods are #{food_array.join(", ")}."
end
@steamgeek7
steamgeek7 / index.html
Last active January 11, 2019 21:11
jQuery
<!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>Hello World!</title>
<!-- Bootstrap core CSS -->
@steamgeek7
steamgeek7 / scripts.js
Last active January 6, 2019 02:49
jQuery Erro
// Twitter
!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');
$(document).ready(function(){
// Smooth scrolling
var $root = $('html, body');
$('.navbar-nav a').click(function() {
var href = $.attr(this, 'href');
$root.animate({
scrollTop: $(href).offset().top
@steamgeek7
steamgeek7 / index.html
Last active December 20, 2018 22:04
About Page
<!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>Hello World!</title>
<!-- Bootstrap core CSS -->
selector{
position:relative;
}
body{
position: relative;
background-color: #fffeea;
color: #34495e;
}