Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am sslavic on github.
  • I am sslavic (https://keybase.io/sslavic) on keybase.
  • I have a public key ASBOhp1Py3olEWJkMf1NDRl_BGB8XedG46owiv_xEX4RxAo

To claim this, I am signing this object:

@sslavic
sslavic / components.yaml
Created May 24, 2018 08:27
HTTP WebHook Specification - OpenAPI
components:
securitySchemes:
BearerAuth:
type: http
scheme: bearer
schemas:
CloudEventType:
properties:
eventType:
type: string
@sslavic
sslavic / postmortem.md
Created September 29, 2016 20:46 — forked from mlafeldt/postmortem.md
Example Postmortem from SRE book, pp. 487-491

Shakespeare Sonnet++ Postmortem (incident #465)

Date

2015-10-21

Authors

  • jennifer
  • martym
import com.twitter.util.{Future => TwFuture}
import scala.concurrent.{Future => ScFuture, promise => ScPromise}
implicit def twFutureToScala[T](twFuture: TwFuture[T]): ScFuture[T] = {
val prom = ScPromise[T]
twFuture.onSuccess { res: T =>
prom.success(res)
}
twFuture.onFailure { t: Throwable =>
prom.failure(t)
}
@sslavic
sslavic / clk.tsv
Created July 2, 2014 16:00 — forked from ceteri/clk.tsv
2014-03-04 15dfb8e6cc4111e3a5bb600308919594 11
2014-03-06 81da510acc4111e387f3600308919594 61
// load error messages from a log into memory
// then interactively search for various patterns
// base RDD
val lines = sc.textFile("log.txt")
// transformed RDDs
val errors = lines.filter(_.startsWith("ERROR"))
val messages = errors.map(_.split("\t")).map(r => r(1))
messages.cache()
$ ./bin/spark-shell
14/04/18 15:23:49 INFO spark.HttpServer: Starting HTTP Server
14/04/18 15:23:49 INFO server.Server: jetty-7.x.y-SNAPSHOT
14/04/18 15:23:49 INFO server.AbstractConnector: Started SocketConnector@0.0.0.0:49861
Welcome to
____ __
/ __/__ ___ _____/ /__
_\ \/ _ \/ _ `/ __/ '_/
/___/ .__/\_,_/_/ /_/\_\ version 0.9.1
/_/