View posts.js
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
var main =function() { | |
$('.btn').click(function() { | |
var post = $('status-box').val(); | |
$('<li>').text(post).prependTo('.posts'); | |
$('.status-box').val(''); | |
$('.counter').text('140'); | |
}); | |
$('.status-box').keyup(function() { | |
var postLength = $(this).val().length; | |
var charactersLeft = 140 - postLength; |
View cat.rb
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 | |
def feed(food) | |
puts "Mmmmm, " + food + "!" |
View Each.rb
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 | |
end | |
p food_array | |
puts "Your favorite foods are #{food_array.join(",")}." | |
food_array.each do |food| | |
puts "I like #{food} too!" |
View case.rb
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 choose | |
puts "Do you like programming? Yes or no please." | |
choice = gets.chomp | |
case choice.downcase | |
when "yes" | |
puts "That\'s great!" | |
when "no" | |
puts "That\'s too bad!" | |
when "maybe" | |
puts "Glad you are giving it a chance!" |
View Modal script.js
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
$(document).ready(function() { | |
$('#modal-button').click(function(){ | |
$("#modal-dialog").dialog(); | |
}); | |
}); |
View program.rb
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 #here we say def to define a method and put the name of our method | |
puts "Please enter your name:" | |
name = gets.chomp | |
puts "hello" + " " + name #here's the code inside our method | |
end #and here we end or close our method | |
greeting |
View MapBuilder 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
google.maps.event.addDomListener(window, 'load', init); | |
var map; | |
function init() { | |
var mapOptions = { | |
center: new google.maps.LatLng(MY COORDINATES), | |
zoom: 15, | |
zoomControl: true, | |
zoomControlOptions: { | |
style: google.maps.ZoomControlStyle.DEFAULT, | |
}, |
View kitties.js
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
var myKitties = [ { title: "Moderne Manila", pic: "https://www.petfinder.com/wp-content/uploads/2012/09/Blog-Kitty-Cam-solo.jpg" }, | |
{ title: "Second Project", pic: "http://www.animal-photography.com/thumbs/red_tabby_long_hair_kitten_~AP-0UJFTC-TH.jpg" }, | |
{ title: "Third Project", pic: "http://www.animal-photography.com/thumbs/silver_tabby_kittens~AP-0JO6Y9-TH.jpg" }, | |
]; | |
$(document).ready(function(){ | |
for (var i=0; i<myKitties.length; ++i) { | |
$("#" + i).css("background-image", "url(" + myKitties[i].pic + ")"); | |
}; |
View Custom Media Screen FAQ
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
.nav ul li { | |
display: inline-block; | |
padding: 20px 10px 20px; | |
} | |
.nav ul li a { | |
text-transform: uppercase; | |
letter-spacing: 0.05em; | |
font-family: 'Josefin Sans', serif; | |
color: #FAFFFF; |
NewerOlder