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 javax.crypto.spec.SecretKeySpec | |
import javax.crypto.Cipher | |
import javax.crypto.spec.IvParameterSpec | |
import java.math.BigInteger | |
import javax.crypto.SecretKeyFactory | |
import java.security.MessageDigest | |
import javax.xml.bind.DatatypeConverter._ | |
object Crypto extends App { | |
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 akka.actor.Actor | |
import akka.actor.ActorSystem | |
import akka.agent.Agent | |
import com.typesafe.config.ConfigFactory | |
import akka.event.Logging | |
import akka.actor.Props | |
import kafka.utils.Utils | |
import java.nio.ByteBuffer | |
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
<html> | |
<head> | |
<title>Mate1 Test Runner</title> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script> | |
<script type="text/javascript"> | |
// A test is the base class for all tests | |
// that will be run by the test runner. | |
Test = function() { |
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
%% | |
%% mod_log_remote is a simple Ejabberd module and gen_server that | |
%% allow for remote logging. It uses the filter_packet hook to | |
%% intercept <message> stanzas addressed to logger@vhost. These | |
%% messages are beamed off to the configured Erland node / pid in | |
%% the form: | |
%% | |
%% {Type, LogTime, Payload} | |
%% | |
%% where Type and Payload are specified by the caller and LogTime is |
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 java.util.Properties | |
import kafka.server.KafkaServer | |
import kafka.server.KafkaConfig | |
import kafka.producer.ProducerConfig | |
import kafka.producer.Producer | |
import kafka.message.Message | |
import kafka.producer.ProducerData | |
import kafka.consumer.ConsumerConfig | |
import kafka.consumer.Consumer | |
import kafka.utils.Utils |
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
%% | |
%% mod_msg_filter allows the filtering of "message" | |
%% stanzas across an HTTP service. The URL of the | |
%% service must be passed as part of the module's | |
%% configuration. Both JIDs and their resources are | |
%% passed as part of the query string and the result | |
%% is expected to be one of: | |
%% | |
%% <status value="denied"> | |
%% <stanza1><error/></stanza1> |
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 java.io.{FilterOutputStream, IOException, OutputStream} | |
class LimitedOutputStream(out: OutputStream , maxBytes: Long) extends FilterOutputStream(out) { | |
private var bytesWritten: Long = 0L | |
@throws(classOf[IOException]) | |
override def write(b: Int) { | |
ensureCapacity(1) | |
super.write(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
package redis.clients.jedis; | |
import java.util.HashSet; | |
import java.util.Set; | |
import java.util.logging.Logger; | |
public class JedisSentinelPoolRunner { | |
private static Logger log = Logger.getLogger(JedisSentinelPoolRunner.class.getName()); | |
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
object ConsistentHashRouter { | |
/** | |
* Creates a new ConsistentHashRouter, routing to the specified routees | |
*/ | |
def apply(routees: Iterable[ActorRef]): ConsistentHashRouter = | |
new ConsistentHashRouter(routees = routees map (_.path.toString)) | |
} | |
case class ConsistentHashRouter( |
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.actors.Actor | |
case class Set(value:Any) | |
case class Get() | |
case class Destroy() | |
/* | |
* An actor wrapping an object of type T providing async get/set | |
* calls without blocking (sacrificing accuracy). | |
* |
NewerOlder