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 SomeClass { | |
private def get(url: String): Future[Option[String]] = | |
for { | |
serviceResponse <- sendGetRequest(url) | |
} yield maybeBody(url, serviceResponse) | |
private def maybeBody(url: String, response: HttpResponse[String]): String = | |
if (response.is2xx) Some(response.body) | |
else None |
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
# Install docker-compose | |
COMPOSE_VERSION=`git ls-remote https://github.com/docker/compose | grep refs/tags | grep -oP "[0-9]+\.[0-9]+\.[0-9]+$" | tail -n 1` | |
sudo sh -c "curl -L https://github.com/docker/compose/releases/download/${COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose" | |
sudo chmod +x /usr/local/bin/docker-compose | |
sudo sh -c "curl -L https://raw.githubusercontent.com/docker/compose/${COMPOSE_VERSION}/contrib/completion/bash/docker-compose > /etc/bash_completion.d/docker-compose" |
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 class Thing : IThing | |
{ | |
public Thing(IDependency dependency) { } | |
public void Do(string arg) { } | |
} |
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
<!DOCTYPE html> | |
<html><body> | |
<h1>Show Mint transactions within date range</h1> | |
<form action="https://wwws.mint.com/transaction.event" target="_blank" method="get"> | |
<input type="date" id="s" onchange="document.getElementById('sd').value=this.value.replace(/(\d+)-(\d+)-(\d+)/,'$2/$3/$1')"/> | |
to | |
<input type="date" id="e" onchange="document.getElementById('ed').value=this.value.replace(/(\d+)-(\d+)-(\d+)/,'$2/$3/$1')"/> | |
<input type="hidden" name="startDate" id="sd"/><input type="hidden" name="endDate" id="ed"/> | |
<input type="submit"/> | |
</form> |
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 Config | |
abstract class Foo(implicit val config: Config) | |
class Bar(config: Config) extends Foo()(config) { | |
def doxxx = Obj.doStuff(1) | |
} | |
object Obj { | |
def doStuff(i: Int)(implicit config: Config) {} |
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
abstract class Foo(config: Config) { | |
} | |
class Bar(config: Config) extends Foo(config) { | |
def doStuff = { | |
Obj.doStuff(1) | |
} | |
} | |
object Obj { |