Skip to content

Instantly share code, notes, and snippets.

View dborisenko's full-sized avatar

Denis Borisenko dborisenko

View GitHub Profile
interface User {
name: string
createdAt: Date
}
it('test case', () => {
let json = `{
"name": "Denis",
"createdAt": "2019-02-14T11:10:06.788Z"
}`;
@dborisenko
dborisenko / HealthCheck.scala
Last active April 30, 2018 15:38
Universal health-check without dependencies
package com.dbrsn.healthcheck
import cats.arrow.FunctionK
import cats.data.NonEmptyVector
import cats.effect.IO
import cats.implicits._
import cats.{ Applicative, Id, MonadError, ~> }
import com.dbrsn.healthcheck.HealthCheckStatus.{ Failure, Ok }
import io.circe.generic.JsonCodec
package com.dbrsn.sortable
import scala.collection.mutable.ListBuffer
/**
* A change in index of an item generated by dragging
*
* @param oldIndex The item's old index
* @param newIndex The item's new index
*/
import scala.scalajs.js
import js.annotation._
import js.|
package importedjs {
@js.native
@JSGlobal
class BaseListener extends js.Object {

Advanced Functional Programming with Scala - Notes

Copyright © 2017 Fantasyland Institute of Learning. All rights reserved.

1. Mastering Functions

A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.

val square : Int => Int = x => x * x
@dborisenko
dborisenko / Wrapped.scala
Last active February 2, 2016 19:30
Wrapped
package com.dbrsn.wrapped
import scala.reflect.ClassTag
trait Wrapped[T] {
def source: T
lazy val root: T = source match {