Skip to content

Instantly share code, notes, and snippets.

View featherart's full-sized avatar
🎯
Focusing

Feather featherart

🎯
Focusing
View GitHub Profile
@featherart
featherart / euler.rb
Created April 4, 2013 19:25
Solutions to project Euler problems
# 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
@featherart
featherart / gist:6678157
Last active December 23, 2015 18:49
conditionals lab
# in irb, evaluate the following:
4 < 5
4 == 5 # note the == is different from =
4 != 5
1 <= 2
0 > 1
1 > 1
1 >= 1
@featherart
featherart / gist:6734826
Last active January 9, 2019 16:56
Week one: !Quiz This isn't a chance to "fail a test", it's a way of letting us all (including you) know what you know.
# ,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'
@featherart
featherart / gist:6736829
Created September 27, 2013 23:55
Solution to week one !Quiz
# ,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'
@featherart
featherart / gist:6745715
Last active December 24, 2015 04:39
Some more practice with Arrays
# 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
# 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
<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">
@featherart
featherart / gist:6802564
Created October 3, 2013 00:13
ATM stub file
// 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
@featherart
featherart / gist:6802588
Created October 3, 2013 00:15
ATM homework HTML document
<!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">
@featherart
featherart / gist:6802627
Created October 3, 2013 00:20
ATM Homework CSS
@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 {