Skip to content

Instantly share code, notes, and snippets.

View savulchik's full-sized avatar

Stanislav Savulchik savulchik

  • Novosibirsk, Russia
View GitHub Profile
@savulchik
savulchik / logstash_log.json
Created April 16, 2021 06:27
Logstash Json Format For Lnav
{
"logstash_log" : {
"title" : "Logstash Log Format",
"description" : "Logstash Log Format",
"json": true,
"timestamp-field": "@timestamp",
"level-field" : "level",
"body-field" : "message",
"module-field": "logger_name",
"level" : {
@savulchik
savulchik / folds.scala
Last active August 29, 2015 14:16
Folds
import scala.annotation.tailrec
@tailrec
def foldLeft[A, B](l: List[A], z: B)(f: (B, A) => B): B = l match {
case Nil => z
case a :: as => foldLeft(as, f(z, a))(f)
}
// (((0 + 1) + 2) + 3)
@savulchik
savulchik / route.rb
Created October 12, 2012 06:00
Ruby Pitfalls #1
class Route
delegate :count, :empty?, to: '@segments'
def initialize
@segments = []
end
class IllegalSegmentError < Exception; end
def <<(flight)
@savulchik
savulchik / LinkedList.java
Created August 21, 2012 01:45
java.util.LinkedList
/*
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*