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
puts "Enter a starting year in the format YYYY" | |
starting = gets.chomp!.to_i | |
puts "Enter an ending year in the format YYYY" | |
ending = gets.chomp!.to_i | |
puts "LEAP YEARS between #{starting} and #{ending}" | |
starting.upto(ending) do |year| | |
divisible_by_4 = (year % 4) == 0 | |
not_divisible_by_100 = (year % 100) != 0 | |
divisible_by_400 = (year % 400) == 0 |
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
num_bottles = 99 | |
while num_bottles > 0 | |
puts "#{num_bottles} bottles of beer on the wall, | |
#{num_bottles} bottles of beer, take one down, pass it | |
around, #{num_bottles - 1} bottles of beer on the wall!" | |
num_bottles = num_bottles - 1 | |
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
def englishNumber number | |
if number < 0 # No negative numbers. | |
return 'Please enter a number that isn\'t negative.' | |
end | |
if number == 0 | |
return 'zero' | |
end | |
# No more special cases! No more returns! |
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
require_relative 'english_number.rb' #https://gist.github.com/kylekeesling/4b73a984421f120312de | |
num_bottles = 999 | |
while num_bottles > 0 | |
puts "#{englishNumber(num_bottles)} bottles of beer on the wall, | |
#{englishNumber(num_bottles)} bottles of beer, take one down, pass it | |
around, #{englishNumber(num_bottles - 1)} bottles of beer on the wall!" | |
num_bottles = num_bottles - 1 | |
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
def weddingNumber number | |
if number < 0 # No negative numbers. | |
return 'Please enter a number that isn\'t negative.' | |
end | |
if number == 0 | |
return 'zero' | |
end | |
# No more special cases! No more returns! |
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>Example</title> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script> | |
<!-- Available here: https://github.com/carhartl/jquery-cookie --> | |
<script src="jquery.cookie.js"></script> | |
</head> | |
<body> | |
<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
start_working() { cd ~/sites/$1; git pull; bundle install; rake db:migrate; subl .; } |
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
{% if paginator.previous_page %} | |
{% if paginator.previous_page == 1 %} | |
{% capture previous_page %}/{% endcapture %} | |
{% else %} | |
{% capture previous_page %}/page{{ paginator.previous_page }}{% endcapture %} | |
{% endif %} | |
<a href="{{ previous_page }}" class="previous">← Newer Posts</a> | |
{% endif %} | |
{% if paginator.next_page %} |
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
puts "What year where you born? (Enter a 4 digit year, ie 1984)" | |
birth_year = gets.chomp | |
puts "What month where you born? (Enter the month number, ie June would be 6)" | |
birth_month = gets.chomp | |
puts "What day of the month where you born?" | |
birth_day = gets.chomp |