Skip to content

Instantly share code, notes, and snippets.

Efstathios markoutso

Block or report user

Report or block markoutso

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View GzipBinEncoder.scala
import akka.http.scaladsl.coding.Gzip
import akka.http.scaladsl.model._
object GzipBinEncoder extends Gzip(GzipBinEncoderFilter)
object GzipBinEncoderFilter extends (HttpMessage => Boolean) {
override def apply(message: HttpMessage): Boolean =
message match {
case req: HttpRequest req.entity.contentType.mediaType.isCompressible
case res@HttpResponse(status, _, _, _) =>
View keybase proof.md

Keybase proof

I hereby claim:

  • I am markoutso on github.
  • I am markoutso (https://keybase.io/markoutso) on keybase.
  • I have a public key ASAjWUDt4s-hkCJuzaCrRMIy9FIYieixWQE8B4-VMI6mJQo

To claim this, I am signing this object:

View Async.js
function Async(fn, args=[]) {
let stack = [(handler) => fn.apply(undefined, args.concat([handler]))];
let error = (e) => { throw new Error(`An error occured - ${e.message}`); }
function asyncCombine(fn, nfn, nargs) {
return handler => fn((...args) => {
let res = getOrError(args);
return nfn.apply(undefined, nargs.concat([res, handler]));
});
View BiMap.scala
// Similar to http://stackoverflow.com/questions/9850786/is-there-such-a-thing-as-bidirectional-maps-in-scala#9851520
object BiMap {
private[BiMap] trait MethodDistinctor
implicit final object MethodDistinctor extends MethodDistinctor
def apply[X, Y](tuples: (X, Y)*) = new BiMap(tuples.toMap, tuples.map(_.swap).toMap)
def apply[X, Y](m: Map[X, Y]) = new BiMap(m, m.toSeq.map(_.swap).toMap)
}
View Shadower.scala
object Shadower {
case class Term(t: String, start: Int, end: Int)
implicit object SpanTerm extends Span[Term] {
def start(t: Term) = t.start
def end(t: Term) = t.end
}
@markoutso
markoutso / AwsSigner.java
Last active Jul 12, 2017
Sign Aws requests without external dependencies
View AwsSigner.java
package com.thron.aws;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
You can’t perform that action at this time.