start new:
tmux
start new with session name:
tmux new -s myname
Our guidelines for building new applications and managing legacy systems.
For us doesn't not matter the language you choose to develop the application. It's importat to follow some rules when you decide to implement a different language that we are describing in other section of this document.
The main objective of this section is to make sure we follow the rules below independent of the language we choose. We like Sandi Metzs Rules for OOP. These rules have helped us to keep our code simpler to understand and easier to change.
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 |