sudo docker-compose rm --all &&
sudo docker-compose pull &&
sudo docker-compose build --no-cache &&
sudo docker-compose up -d --force-recreate
following scenario: log
Webpack HOT dev build for Rails
Unhandled 'error' event
rake aborted!
SignalException: SIGTERM
bundle _1.17.3_ install
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
# given an array of hashes x: | |
x = [{"a" => 10}, {"b" => 20}, {"c" => 30}] | |
# return all the keys: ["a", "b", "c"] | |
x.flat_map(&:keys) | |
# return all the values: [10, 20, 30] | |
x.flat_map(&:values) | |
# return the sum of values: 60 |
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
# 1st | |
# 48ms | |
def running_sum(nums) | |
result = [] | |
nums.inject(0) do |acc, n| | |
result << acc + n | |
acc + n | |
end | |
result | |
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
# 1st | |
# 56 ms | |
def find_numbers(nums) | |
count = 0 | |
nums.each do |n| | |
count += 1 if n.digits.size.even? | |
end | |
count | |
end |
r read-only, starts at beginning of file (default mode).
r+ read-write, starts at beginning of file.
w write-only, truncates existing file to zero length or creates a new file for writing.
w+ read-write, truncates existing file to zero length overwriting existing data or creates a new file for reading and writing.
a write-only, appends to end of file if file exists, otherwise creates a new file for writing.
a+ read-write, appends or reads from end of file if file exists, otherwise creates a new file for reading and writing.
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
=begin | |
Given a list of 24-hour clock time points in "Hour:Minutes" format, find the minimum minutes difference between any two time points in the list. | |
* | |
* Example 1: | |
* Input: ["23:59","00:00"] should return 1 | |
* Example 2: | |
* Input: ["03:12","01:00", "03:10"] should return 2 | |
=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 Matrix | |
def call(string) | |
puts "rows:" | |
puts show_rows(string) | |
puts "columns:" | |
puts show_columns(string) | |
end | |
private | |