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
package com.example | |
import akka.NotUsed | |
import akka.actor.ActorRef | |
import akka.pattern.AskableActorRef | |
import akka.stream.scaladsl.Source | |
import akka.util.Timeout | |
import scala.reflect.ClassTag |
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 unpaginate[S, T](s: S) | |
(fetch: S => Future[(Option[S], Seq[T])]) | |
(implicit context: ExecutionContext): Source[T, NotUsed] = | |
Source.unfoldAsync(Option(s)) { | |
case None => Future.successful(None) | |
case Some(token) => fetch(token).map(Some(_)) | |
}.mapConcat(_.toList).async |
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.util.parsing.combinator._ | |
sealed trait Json | |
case object JsonNull extends Json | |
final case class JsonBoolean(b: Boolean) extends Json | |
final case class JsonString(s: String) extends Json | |
final case class JsonNumber(x: BigDecimal) extends Json | |
final case class JsonArray(elems: List[Json]) extends Json | |
final case class JsonObject(entries: List[(String, Json)]) extends Json |
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 org.reactivestreams.Publisher; | |
import org.reactivestreams.Subscriber; | |
import org.reactivestreams.Subscription; | |
import rx.Observable; | |
/** | |
* Wrapper for {@link Observable} to bridge to the Reactive Streams API. | |
*/ | |
public class ObservablePublisher<T> implements Publisher<T> { |
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
if [[ ! -f ~/.git-prompt.sh ]]; then | |
curl -o ~/.git-prompt.sh https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh | |
fi | |
. ~/.git-prompt.sh | |
function get_version_ctl_branch() { | |
local dir="$PWD" | |
local vcs | |
local nick |
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
package com.example; | |
import java.util.List; | |
import java.util.Set; | |
import java.util.concurrent.ConcurrentHashMap; | |
import java.util.function.BiFunction; | |
import java.util.function.Supplier; | |
import java.util.stream.Stream; | |
import lombok.extern.log4j.Log4j2; | |
import org.reactivestreams.Publisher; |
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
package com.example; | |
import java.util.concurrent.ConcurrentHashMap; | |
import java.util.concurrent.ConcurrentMap; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.LinkedTransferQueue; | |
import java.util.concurrent.ThreadPoolExecutor; | |
import java.util.concurrent.TimeUnit; | |
import org.springframework.security.concurrent.DelegatingSecurityContextExecutorService; | |
import org.springframework.security.core.context.SecurityContext; |
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 abstract class AbstractAppender extends AbstractFilterable implements Appender { | |
public abstract static class Builder<T extends AbstractAppender, B extends Builder<T, B> & org.apache.logging.log4j.core.util.Builder<T>> | |
extends AbstractFilterable.Builder<T, B> { | |
// ... | |
} | |
} |
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
:h hidden | |
- allows you to keep buffers open | |
:ls | |
- lists open buffers | |
:b (:buffer) | |
- edit buffer N from list (jump between buffers) | |
- can also use :Nb for buffer number N |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0" | |
xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd"> | |
<ext:property-placeholder/> | |
<bean id="hazelcastInstance" class="com.hazelcast.core.Hazelcast" factory-method="newHazelcastInstance" destroy-method="shutdown"> | |
<argument> | |
<bean class="com.hazelcast.config.FileSystemXmlConfig"> |