This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import shapeless._ | |
| import shapeless.labelled.{FieldType, KeyTag} | |
| import syntax.singleton._ | |
| sealed trait JSON | |
| case object JsNull extends JSON | |
| case class JsNumber(v:Double) extends JSON | |
| case class JsString(s:String) extends JSON | |
| case class JsBool(b:Boolean) extends JSON | |
| case class JsArray(values:Vector[JSON]) extends JSON |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class m190912_125724_introduce_external_payment_orders extends EDbMigration | |
| { | |
| public function safeUp() | |
| { | |
| $this->executeMulti([ | |
| 'ALTER TABLE tbl_payment_order ADD COLUMN BIGINT owner_customer_id', | |
| 'ALTER TABLE tbl_payment_order ADD CONSTRAINT fk_payment_order_owner_customer_id FOREIGN KEY(owner_customer_id) REFERENCES tbl_customer(id) ON UPDATE CASCADE ON DELETE RESTRICT', | |
| 'ALTER TABLE tbl_bank_client_import DROP CONSTRAINT fk_bank_client_import_sbd_id', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sealed trait Method | |
| case object GET extends Method | |
| case object POST extends Method | |
| case class Request(method:Method, uri:String) | |
| class Response(code:Int, headers:Map[String,String], body:String) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class PimPayApi_JsonRpcClient { | |
| protected $_privateKeyContents = null; | |
| protected $_digestAlgo = null; | |
| public function __construct($privateKeyContents, $digestAlgo) | |
| { | |
| $this->_privateKey = $privateKeyContents; | |
| $this->_digestAlgo = $digestAlgo; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sealed trait Stream[+A] { | |
| def headOption:Option[A] = this match { | |
| case SCons(h, _) => Some(h()) | |
| case _ => None | |
| } | |
| def toList:List[A] = this match { | |
| case SCons(h, t) => h() +: t().toList | |
| case _ => Nil |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - List(1,2,3,4).map(_ + 10).filter(_ % 2 == 0).map(_ * 3) | |
| - List(1,2,3,4).map(_ + 10).filter(_ % 2 == 0).map(_ * 3) | |
| List(11,12,13,14).filter(_ % 2 == 0).map(_ * 3) | |
| - def square(x: Double): Double = x * x | |
| false && { println("!!"); true } | |
| true || { println("!!"); false } | |
| - def if2[A](cond: Boolean, onTrue: () => A, onFalse: () => A): A = if (cond) onTrue() else onFalse() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| WITH | |
| -- выборка пар клиент-площадка | |
| pairs AS ( | |
| SELECT customer_id, platform FROM tbl_customer_platform_connector | |
| ---CUSTOMER_FILTER--- WHERE customer_id = :customer_id | |
| GROUP BY customer_id, platform | |
| ) | |
| -- выборка параметров площадок из перекрываемого справочника по всем парам клиент-площадка |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import my._ | |
| import scala.language.experimental.macros | |
| object MetricType { | |
| trait PV | |
| trait S | |
| } | |
| trait MetricQueryParamTypeClass[A, M] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package my { | |
| import scala.reflect.macros.whitebox.Context | |
| import scala.language.experimental.macros | |
| import scala.annotation.StaticAnnotation | |
| import scala.annotation.compileTimeOnly | |
| object Impl { | |
| def implPV(c:Context)(annottees: c.Expr[Any]*): c.Expr[Any] = impl(Seq("PV"))(c)(annottees:_*) | |
| def implS(c:Context)(annottees: c.Expr[Any]*): c.Expr[Any] = impl(Seq("S"))(c)(annottees:_*) | |
| def implPVS(c:Context)(annottees: c.Expr[Any]*): c.Expr[Any] = impl(Seq("PV", "S"))(c)(annottees:_*) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| trait Nat | |
| case object Z extends Nat | |
| case class S[N <: Nat](n: N) extends Nat | |
| type One = S[Z.type] | |
| type Two = S[One] | |
| type Three = S[Two] | |
| type Four = S[Three] | |
| type Five = S[Four] | |
| type Six = S[Five] |
NewerOlder