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
require 'json' | |
require 'open-uri' | |
# TODO - Let's fetch name and bio from a given GitHub username | |
url = 'https://api.github.com/users/ssaunier' |
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
# RECAP OF ARRAY CRUD | |
musicians = ["John Lennon", "Paul Mcartney", "George Harrison", "Ringo Star"] | |
# CRUD | |
# CREATE | |
musicians << "Yoko Ono" |
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
def acronymize(string) | |
# 1. split sentence | |
# words = string.split | |
# # 2. map over array | |
# letters = words.map { |word| word[0].capitalize } | |
# # 3. block should take first letter and capitalize | |
# return letters.join | |
# 4. Join final result |
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
'01': Ain | |
'02': Aisne | |
'03': Allier | |
'04': Alpes-de-Haute-Provence | |
'05': Hautes-Alpes | |
'06': Alpes-Maritimes | |
'07': Ardèche | |
'08': Ardennes | |
'09': Ariège | |
'10': Aube |
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 Appointment | |
attr_accessor :id, :doctor, :patient, :date | |
def initialize(attributes = {}) | |
@id = attributes[:id] | |
@doctor = attributes[:doctor] | |
@patient = attributes[:patient] | |
@date = attributes[:date] | |
end | |
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
class Appointment | |
attr_accessor :id, :doctor, :patient, :date | |
def initialize(attributes = {}) | |
@id = attributes[:id] | |
@doctor = attributes[:doctor] | |
@patient = attributes[:patient] | |
@date = attributes[:date] | |
end | |
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
# TODO: require relevant files to bootstrap the app. | |
# Then you can test your program with: | |
# ruby app.rb | |
require_relative "app/repositories/meal_repository" | |
require_relative "app/models/meal" | |
require_relative "app/controllers/meals_controller" | |
require_relative "router" | |
meal_repo = MealRepository.new(File.join(__dir__, 'data/meals.csv')) |
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
# TODO: require relevant files to bootstrap the app. | |
# Then you can test your program with: | |
# ruby app.rb | |
require_relative "app/repositories/meal_repository" | |
require_relative "app/models/meal" | |
require_relative "app/controllers/meals_controller" | |
require_relative "router" | |
meal_repo = MealRepository.new(File.join(__dir__, 'data/meals.csv')) |
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
# TODO: require relevant files to bootstrap the app. | |
# Then you can test your program with: | |
# ruby app.rb | |
require_relative "app/repositories/meal_repository" | |
require_relative "app/models/meal" | |
require_relative "app/controllers/meals_controller" | |
require_relative "router" | |
meal_repo = MealRepository.new(File.join(__dir__, 'data/meals.csv')) |
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> | |
<meta charset="UTF-8"> | |
<title>OMDb API</title> | |
<link rel="stylesheet" | |
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> | |
<link rel="stylesheet" href="style.css"> | |
<link rel="stylesheet" href="node_modules/select2/dist/css/select2.css"> | |
</head> |
OlderNewer