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 artist_name=(name) | |
self.artist = Artist.find_or_create_by_name(name) | |
artist.add_song(self) #why not self.add_song(self)?? | |
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 files | |
# I think I will need to create an array of file names here of the files whose data I want to import | |
@files = [] | |
Dir.entries(path).select do |file| | |
if !File.directory?(file) && file.end_with?(".mp3") | |
# why does if need to check file.directory? | |
@files << file | |
end | |
end | |
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
#why does this work? explain syntax and logic | |
def best_tipper | |
best_tipped_meal = meals.max do |meal_a, meal_b| | |
meal_a.tip <=> meal_b.tip | |
end | |
best_tipped_meal.customer | |
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
class Ingredient | |
@@all = [] | |
attr_reader :name | |
def initialize(name) | |
@name = name | |
@@all << self | |
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 pass_student(student, test) | |
found_test = BoatingTest.all.find { |bt| bt.test_name == test && bt.student == student} | |
binding.pry | |
if found_test && found_test.test_status != "pass" | |
found_test.test_status = "pass" | |
elsif !found_test | |
found_test = BoatingTest.new(student, test, "pass", self) | |
end | |
found_test | |
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
Menu.destroy_all | |
Drink.destroy_all | |
Ingredient.destroy_all | |
DrinkIngredient.destroy_all | |
Shop.destroy_all | |
# =============================Ingredient seeds============================= | |
i1 = Ingredient.create(name: "milk") |
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 React from 'react' | |
import ReactMapGL, { Marker, Popup } from 'react-map-gl'; | |
import '../App.css'; | |
const mapMarkers = (userData, setSelectedAppointments, setPopupState) => { | |
const nurses = mapNurses(userData.nurses, setSelectedAppointments, setPopupState) || []; | |
const patients = mapPatients(userData.patients, setSelectedAppointments, setPopupState) || []; | |
return nurses.concat(patients) || null; | |
} |
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
Get hype. The next 2-3 weeks of your life are all about your final project. This is the capstone project that you’ll be showing off to demonstrate all the things that you’ve learned over the last few months. This is awesome. Before we dive into what your project is going to be about, we need to establish some ground rules. | |
Behavioral Expectations | |
You will show up by 9:00 and leave no sooner than 6:00 | |
You will actively participate in stand-ups, retros, and check-ins | |
You will complete your MVP by the date it is due | |
You will adhere to the project decisions made by leads/project managers | |
You will communicate issues with your project manager | |
You will be courteous to your classmates, and work together to solve problems | |
You will have properly researched and debugged before escalating to your project leads. |
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
Get hype. The next 2-3 weeks of your life are all about your final project. This is the capstone project that you’ll be showing off to demonstrate all the things that you’ve learned over the last few months. This is awesome. Before we dive into what your project is going to be about, we need to establish some ground rules. | |
Behavioral Expectations | |
You will show up by 9:00 and leave no sooner than 6:00 | |
You will actively participate in stand-ups, retros, and check-ins | |
You will complete your MVP by the date it is due | |
You will adhere to the project decisions made by leads/project managers | |
You will communicate issues with your project manager | |
You will be courteous to your classmates, and work together to solve problems | |
You will have properly researched and debugged before escalating to your project leads. |
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
@033020 Hey everyone, here are those Flatiron Redux resources (this is going to be long :persevere:): | |
To prepare for Redux, please read the following pages in the official documentation: | |
- https://redux.js.org/introduction/motivation | |
- https://redux.js.org/faq/general#general-when-to-learn | |
- https://redux.js.org/faq/organizingstate#organizing-state-only-redux-state | |
- Just the first one about state. | |
- https://redux.js.org/faq/performance#performance-scaling | |
- Just the first one about scaling. | |
If you're really itching to get started, you can follow the tutorial series by the master himself, Dan Abramov, linked in the Learning Resources section of the docs: | |
- Getting Started with Redux - Video Series: https://egghead.io/series/getting-started-with-redux |
OlderNewer