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 scala.concurrent.duration._ | |
object AppThatUsesRetry extends App { | |
Retry(backoff = 30 seconds) { | |
throw new Exception("fail every 30 seconds") | |
} | |
} |
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
desc "Build jekyll locally" | |
task :build do | |
sh "bundle exec jekyll build" | |
end | |
desc "Deploy _site" | |
task :deploy => :build do | |
user = 'user' | |
host = 'example.com' | |
release_dir = Time.new.strftime('%Y%m%d%H%M%S') |
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
public boolean willPositiveIntegerAdditionOverflow(int a, int b) { | |
if (a < 0 || b < 0) { | |
throw new IllegalArgumentException("this only works with two positive integers"); | |
} | |
return (a > (Integer.MAX_VALUE - b)); | |
} |