- Hubot
- HUBOT_SONOS_HOST - an export set to an IP for a single sonos speaker. If grouped, it needs to be the main speaker in the group.
- The bot has to be running somewhere where it can access your sonos speakers.
I hereby claim:
- I am mcdavis on github.
- I am mcdavis (https://keybase.io/mcdavis) on keybase.
- I have a public key whose fingerprint is C8B9 7030 CDC0 EF63 793A D267 26DA EC2A FB4A 6474
To claim this, I am signing this object:
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 max_slice(numbers) | |
best_sum = nil | |
best_slice = nil | |
numbers.each_with_index do |number, index| | |
numbers[index..numbers.size].each_with_index do |inner_number, inner_index| | |
sum_nums = numbers[index..inner_index+1] | |
unless sum_nums.empty? | |
sum = sum_nums.inject(0) { |sum, x| sum += x } |