Skip to content

Instantly share code, notes, and snippets.

View RobertoUa's full-sized avatar
🎯
Focusing

Volodymyr Barna RobertoUa

🎯
Focusing
  • Ukraine, Ternopil
View GitHub Profile
@RobertoUa
RobertoUa / TestContextShiftTest.scala
Created April 30, 2020 02:20 — forked from Daenyth/IOAssertions.scala
TestContext + scalatest usage
import cats.effect.laws.util.TestContext
import cats.effect.{ContextShift, IO, Timer}
import org.scalactic.source.Position
import org.scalatest.{Assertion, AsyncFunSpec, AsyncTestSuite, Matchers}
import org.scalatest.exceptions.TestFailedException
import scala.concurrent.duration._
import scala.concurrent.{ExecutionContext, Future}
import scala.reflect.ClassTag
@RobertoUa
RobertoUa / README.md
Created December 26, 2018 17:33 — forked from pathikrit/README.md
My highly opinionated list of things needed to build an app in Scala
with table_stats as (
select psut.relname,
psut.n_live_tup,
1.0 * psut.idx_scan / greatest(1, psut.seq_scan + psut.idx_scan) as index_use_ratio
from pg_stat_user_tables psut
order by psut.n_live_tup desc
),
table_io as (
select psiut.relname,
sum(psiut.heap_blks_read) as table_page_read,
class A
class A2 extends A
class B
trait M[X]
//
// Upper Type Bound
//
def upperTypeBound[AA <: A](x: AA): A = x
@RobertoUa
RobertoUa / BaseN.scala
Created November 1, 2012 20:04 — forked from marklister/BaseN.scala
Scala Hex / Decimal / Binary calculator / DSL
/**
* Scala hex / decimal binary calculator
* (c) Mark Lister 2012
* Licence Apache 2.
*/
class BaseN(b: BigInt, val baseN: Int) extends BigInt(b.underlying) {
def n(x: Int) = new BaseN(b, x)
/**