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
# Euler problem #1: If we list all the natural numbers below 10 that are multiples of 3 or 5, | |
# we get 3, 5, 6 and 9. The sum of these multiples is 23. | |
# Find the sum of all the multiples of 3 or 5 below 1000. | |
def find_multiples num | |
multiples = Array.new | |
(1...num).each do |i| | |
if( (i % 3 == 0) || (i % 5 == 0) ) | |
multiples << i | |
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
# in irb, evaluate the following: | |
4 < 5 | |
4 == 5 # note the == is different from = | |
4 != 5 | |
1 <= 2 | |
0 > 1 | |
1 > 1 | |
1 >= 1 |
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
# ,o888888o. 8 8888 88 8 8888 8888888888',8888' | |
# . 8888 `88. 8 8888 88 8 8888 ,8',8888' | |
# ,8 8888 `8b 8 8888 88 8 8888 ,8',8888' | |
# 88 8888 `8b 8 8888 88 8 8888 ,8',8888' | |
# 88 8888 88 8 8888 88 8 8888 ,8',8888' | |
# 88 8888 `8. 88 8 8888 88 8 8888 ,8',8888' | |
# 88 8888 `8,8P 8 8888 88 8 8888 ,8',8888' | |
# `8 8888 ;8P ` 8888 ,8P 8 8888 ,8',8888' | |
# ` 8888 ,88'8. 8888 ,d8P 8 8888 ,8',8888' |
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
# ,o888888o. 8 8888 88 8 8888 8888888888',8888' | |
# . 8888 `88. 8 8888 88 8 8888 ,8',8888' | |
# ,8 8888 `8b 8 8888 88 8 8888 ,8',8888' | |
# 88 8888 `8b 8 8888 88 8 8888 ,8',8888' | |
# 88 8888 88 8 8888 88 8 8888 ,8',8888' | |
# 88 8888 `8. 88 8 8888 88 8 8888 ,8',8888' | |
# 88 8888 `8,8P 8 8888 88 8 8888 ,8',8888' | |
# `8 8888 ;8P ` 8888 ,8P 8 8888 ,8',8888' | |
# ` 8888 ,88'8. 8888 ,d8P 8 8888 ,8',8888' |
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
# create an Array of 4 shoes | |
# iterate through your Array using each and {}'s | |
# and show a list of your shoes | |
# create an Array of 4 outfits using Array.new |
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
# create an Array of 4 shoes | |
shoes = ["flip flops", "cowboy boots", "galoshes", "clogs" ] | |
# iterate through your Array using each and {}'s | |
# and show a list of your shoes | |
shoes.each { |s| puts s } | |
# create an Array of 4 outfits using Array.new |
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
<html> | |
<head> | |
<title>Supersize Me Cookie</title> | |
</head> | |
<body> | |
<button href="#" onclick="myStopFunction();">stop the cookie!</button> | |
<br> | |
<img name="fred" id="freddie" src="cookie.jpg" width="100" height="auto"> |
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
// https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers.onload | |
// The load event fires at the end of the document loading process. | |
// At this point, all of the objects in the document are in the DOM, | |
// and all the images and sub-frames have finished loading. | |
window.onload = function(){ | |
// https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers.onclick | |
// The click event is raised when the user clicks on an element. | |
document.getElementById("checkingDeposit").onclick = function(event){ | |
// Any code you put in here will be run when the checkingDeposit button is clicked |
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> | |
<head> | |
<title>ATM</title> | |
<meta charset="utf-8"> | |
<link rel="stylesheet" href="atm.css"> | |
<script src="atm.js"></script> | |
</head> | |
<body> | |
<div id="content"> |
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
@import url(http://fonts.googleapis.com/css?family=Oleo+Script); | |
@import url(http://fonts.googleapis.com/css?family=Ruluko); | |
#content { | |
margin: 0 auto; | |
text-align: center; | |
width: 700px; | |
} | |
#nav { |
OlderNewer