Skip to content

Instantly share code, notes, and snippets.

View EmilDafinov's full-sized avatar

Emil Dafinov EmilDafinov

View GitHub Profile
@EmilDafinov
EmilDafinov / bintray_settings.xml
Created May 17, 2017 19:56
A maven settings.xml file configured for bintray deployment
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<pluginGroups>
</pluginGroups>
<proxies>
</proxies>
@EmilDafinov
EmilDafinov / Future-retry.scala
Last active April 18, 2017 16:00 — forked from viktorklang/Future-retry.scala
Asynchronous retry for Future in Scala
import akka.actor.Scheduler
import akka.pattern.after
import scala.concurrent.{ExecutionContext, Future}
import scala.concurrent.duration._
/**
* Given an operation that produces a T, returns a Future containing the result of T, unless an exception is thrown,
* in which case the operation will be retried after _delay_ time, if there are more possible retries, which is configured through
* the _retries_ parameter. If the operation does not succeed and there is no retries left, the resulting Future will contain the last failure.
@EmilDafinov
EmilDafinov / travis_bintray_credentials.sh
Last active July 8, 2017 04:02
Creates the credentials file for sbt-bintray
#!/bin/bash
echo "Creating credentials directory"
mkdir ~/.bintray/
BINTRAY_FILE=$HOME/.bintray/.credentials
ARTIFACTORY_FILE=$HOME/.bintray/.artifactory
echo "Writing Bintray credentials file at $BINTRAY_FILE"
cat <<EOF >$BINTRAY_FILE
realm = Bintray API Realm
host = api.bintray.com