๐ฝ
This file contains hidden or 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
# Exercise 1 : Your output should look like this: "Your total with tax is $4455.54." | |
shopping_cart = [ | |
{:name => "iPad 2", :price => 499, :quantity => 2}, | |
{:name => "iMac 27", :price => 1699, :quantity => 1}, | |
{:name => "MacBook Air 13", :price => 1299, :quantity => 1} | |
] | |
This file contains hidden or 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
# The prime factors of 13195 are 5, 7, 13 and 29. | |
# What is the largest prime factor of the number 600851475143 ? | |
number = 24 | |
array = [] | |
# how do I iterate a number? Is that a loop? | |
array.each do |num| | |
if num % 1 == 0 | |
array << 1 |
This file contains hidden or 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 Animal | |
def name=(nick_name) | |
@name = nick_name | |
end | |
def name | |
return @name | |
end |
This file contains hidden or 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
# Make the code below work by creating two classes: Item and Cart. | |
# HINT: It may help to use arrays and hashes inside your Cart class. | |
# Don't worry about sales tax for now. | |
class Item | |
def initialize(name, price) | |
@name = name | |
@price = price | |
end | |
This file contains hidden or 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
puts "How many shirts?" | |
quantity = gets.chomp.to_i | |
puts "how many colors?" | |
colors = gets.chomp.to_i | |
pricelist = [ | |
[1.30,1.85,2.50], # 1 - 35 pieces | |
[0.95, 1.30, 1.70,2.20,2.5 ], # 36 - 71 pieces |
This file contains hidden or 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
$("#task-row").each(function(){ | |
if $('#task-row').value('@'){ | |
this.addClass("highlight"); | |
} | |
}); |
This file contains hidden or 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> | |
<head> | |
<title>Count Down</title> | |
<style type="text/css"> .styles {font: bold 24pt sans; padding: 10px; border: 2px solid black; border-radius: 2px; } </style> | |
</head> | |
<body> | |
<h1>Countdown</h1> | |
<span class="styles" id="countdown"></span> <!-- The time gets inserted here --> | |
<script> |
This file contains hidden or 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
body { | |
font-family: courier; | |
width: 60%; | |
margin: 0 auto; | |
font-size: 100%; | |
} | |
form{ | |
overflow: auto; | |
} |
This file contains hidden or 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
coffee_talk (master) $ be middleman build | |
/Users/dave/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:216: warning: Insecure world writable dir /Users/dave/Dropbox/300_code/303_sandbox in PATH, mode 040777 | |
Loaded Bourbon Neat | |
/Users/dave/Dropbox/300_code/303_sandbox/316_middleman/coffee_talk/source/stylesheets/base/base.scss:4: Undefined variable: "$tan". (Sass::SyntaxError) | |
(in /Users/dave/Dropbox/300_code/303_sandbox/316_middleman/coffee_talk/source/stylesheets/base/base.scss:4) | |
from /Users/dave/Dropbox/300_code/303_sandbox/316_middleman/coffee_talk/vendor/bundle/gems/sass-3.2.12/lib/sass/script/variable.rb:49:in `_perform' | |
from /Users/dave/Dropbox/300_code/303_sandbox/316_middleman/coffee_talk/vendor/bundle/gems/sass-3.2.12/lib/sass/script/node.rb:40:in `perform' | |
from /Users/dave/Dropbox/300_code/303_sandbox/316_middleman/coffee_talk/vendor/bundle/gems/sass-3.2.12/lib/sass/tree/visitors/perform.rb:298:in `visit_prop' | |
from /Users/dave/Dropbox/300_code/303_sand |
This file contains hidden or 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
Add after rails gem... | |
------------- | |
gem 'neat' | |
gem 'pg' | |
gem "haml-rails" | |
gem 'meta-tags', :require => 'meta_tags' | |
gem 'thin' | |
gem 'redcarpet', '1.17.2' | |
gem 'omniauth-facebook' | |
gem 'jquery-ui-rails' |
OlderNewer