CREATE TABLE recipes (
id serial PRIMARY KEY,
name varchar(255) NOT NULL,
servings integer,
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
############################## | |
# METHODS | |
############################## | |
# prompts user to enter a sale price and gets the sale price | |
def get_sale_price | |
puts "What is the sale price?" | |
gets.chomp | |
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
############################## | |
# METHODS | |
############################## | |
# Insert methods here | |
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
artist | album | song | position | |
---|---|---|---|---|
John Legend | All Of Me | All Of Me | 1 | |
Pharrell | Happy | Happy | 2 | |
Iggy Azalea | Fancy | 3 | ||
Ariana Grande | Problem | 4 | ||
Katy Perry | Prism | Dark Horse | 5 |
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
############################ | |
# Array & hash drills | |
############################ | |
first_names = ["Richard", "Adam", "Sam", "Helen", "Eric"] | |
# Print each name in the array | |
# Downcase each name in the array | |
# Print the third name in the array | |
full_names = [ |
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
# RUBY FUNDAMENTALS III: NON-CORE RETURN VALUE DRILLS | |
# ---------------------------- | |
def is_a_fixnum?(some_input) | |
some_input.class == Fixnum | |
end | |
is_a_fixnum?(10) | |
is_a_fixnum?("10") |
For the first several challenges, you'll do all your work in a local git repo and submit a Gist to your solution in Apollo. Here's a breakdown of the workflow:
- Create a directory for the challenge and cd into it.
- Run
git init
to create your local git repo. - Write your code, periodically running
git add
andgit commit
to save your progress. - When finished, create a gist and supply a link to the gist in the Apollo assignment.
To create a gist, navigate to gist.github.com, where you should see a form to create a gist. Copy and paste the code for your solution into the in-browser editor. Give your gist a name ending in .rb
(which will provide the appropriate syntax highlighting), and an optional description. Click 'Create Public Gist' and supply a link to that gist in Apollo.
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
# Acceptance Criteria: | |
# Wins and losses are tallied up for each team | |
# The team with the highest quantity of wins is shown first and is sorted accordingly | |
# If two teams have the same number of wins, check to see if one team has beaten the other. If they have, they should be listed first. | |
# *** League Standings *** | |
# 1 Good Will Bunting: 2W, 0L | |
# 2 Sick Kicks: 1W, 1L | |
# 3 Angels in the Outfield: 0W, 2L |
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
{ | |
total: 20, | |
movies: [ | |
{ | |
id: "771311994", | |
title: "Need For Speed", | |
year: 2014, | |
mpaa_rating: "PG-13", | |
runtime: 130, | |
release_dates: { |
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
# RUBY FUNDAMENTALS III: NON-CORE RETURN VALUE DRILLS | |
# ---------------------------- | |
def is_a_number?(some_string) | |
if some_string =~ /\A\d*[.]{0,1}\d*\z/ | |
true | |
else | |
false | |
end |