Skip to content

Instantly share code, notes, and snippets.


Sergey Shishkin shishkin

View GitHub Profile
shishkin / Dockerfile
Last active Dec 12, 2016
Docker args expansion
View Dockerfile
FROM busybox
ENTRYPOINT ["sh", "-c", "echo $0 $@", "hello"]
CMD ["world"]
shishkin / package.scala
Created Dec 1, 2016
Sangria scalar type derived from Circe encoder and decoder
View package.scala
package org.shishkin.sangria
import cats.syntax.either._
import io.circe._
import sangria.execution.Resolver
import sangria.marshalling.circe._
import sangria.schema._
import sangria.validation.Violation
import scala.language.implicitConversions

Keybase proof

I hereby claim:

  • I am shishkin on github.
  • I am sshishkin ( on keybase.
  • I have a public key whose fingerprint is E619 D103 BAB7 F1CF 5CD5 B7BA B9C1 5954 C4E8 AF2A

To claim this, I am signing this object:

shishkin / Meetup.scala
Created Oct 6, 2015
Example code for the Singapore scala meetup
View Meetup.scala
import scala.annotation.tailrec
def sum(nums: Seq[Int]) = fold(0)(nums, _ + _)
def filterEven(nums: Seq[Int]): Seq[Int] = filter(nums, _ % 2 == 0)
def filter(nums: Seq[Int], predicate: Int => Boolean): Seq[Int] =
fold(List[Int]())(nums, (l, i) => if (predicate(i)) l :+ i else l)
def square(nums: Seq[Int]): Seq[Int] = map(nums, i => i * i)
shishkin / XmlTest.scala
Created Mar 30, 2015
Combinatorial XML Transformations in Scala
View XmlTest.scala
import org.scalatest.{Matchers, Spec}
import scala.xml._
class XmlTest extends Spec with Matchers {
def `Set text inside XML element`() = {
val doc =
shishkin / pom.xml
Created Mar 22, 2015
Maven template for Scala+ScalaTest+ScalaCheck
View pom.xml
<project xmlns=""
shishkin / SpringContextTests.scala
Created Nov 27, 2014
Spring annotation-based configuration with ScalaTest
View SpringContextTests.scala
package samples
import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner
import org.scalatest._
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.context.annotation._
import org.springframework.stereotype.Service
import org.springframework.test.context.{ActiveProfiles, ContextConfiguration, TestContextManager}
shishkin / async.clj
Created Oct 22, 2014
Clojure core.async configurable polling for a change of a non-reactive function
View async.clj
;### Tested with clojure "1.6.0" and core.async "0.1.346.0-17112a-alpha" ###
(use 'clojure.core.async)
;### Lib functions ###
(defn take-until
"Creates a channel that replicates values from the in channel until the
control channel either emits a value or closes."
[control in]
(let [out (chan)]
View ScalaDsl.scala
package demo
object ScalaDsl {
* Defining a simplistic model for the web app DSL
case class HttpRequest(path: String, headers: Map[String, String], body: Option[String])
shishkin / semver.fs
Created Aug 30, 2014
Making incorrect version specifications impossible with F# typesystem
View semver.fs
type VersionNumber =
| Major of major: int
| Minor of major: int * minor: int
| Patch of major: int * minor: int * patch: int
type Version =
| Release of VersionNumber
| PreRelease of VersionNumber * string
static member create (x) = Release (Major x)