This PR aims to do something (detailed description).
- Bug fix
- New feature
- Breaking change
- This change requires a documentation update
def distance_between_locations(locations) | |
def distance(location_one, location_two) | |
rad_per_deg = Math::PI/180 | |
radius_in_meters = 6371 * 1000 | |
dlat_rad = (location_two[0]-location_one[0]) * rad_per_deg | |
dlon_rad = (location_two[1]-location_one[1]) * rad_per_deg |
puts "Type the cooking time: " | |
cooking_time = gets.chomp.to_i | |
puts "Type the first hourglass time: " | |
hour_glass_one = gets.chomp.to_i | |
puts "Type the second hourglass time: " | |
hour_glass_two = gets.chomp.to_i | |
def calculate_minimum_time(cooking_time, hour_glass_one, hour_glass_two) | |
minimum_time = 0 |
=begin | |
Write some code, that will flatten an array of arbitrarily | |
nested arrays of integers into a flat array of integers. | |
e.g. [[1,2,[3]],4] -> [1,2,3,4]. | |
Your solution should be a link to a gist on gist.github.com | |
with your implementation. | |
When writing this code, you can use any language you're | |
comfortable with. The code must be well tested and documented. |
default: &default | |
adapter: postgresql | |
encoding: unicode | |
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> | |
development: | |
<<: *default | |
database: your_database_development | |
host: localhost | |
username: postgres |
# Each | |
arr = ["Luke", "Leia", "Vader"] | |
arr.each do |name| | |
p name | |
end | |
# Times |
name = "Mary" | |
3.times do | |
prefix = "My name is" | |
name = "John" | |
p "#{prefix} #{name}" | |
end |
name = "Mary" | |
3.times do | |
prefix = "My name is" | |
p "#{prefix} #{name}" | |
end |
git init | |
git add . | |
git commit -m "First commit" |
class Subscription | |
def initialize(user) | |
@user = user | |
end | |
def call | |
create_payment! | |
create_invoice! | |
rescue StandardError => e | |
puts e.message |