import java.util.Optional
import scala.compat.java8.OptionConverters._
This file contains 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
addCommandAlias("partestDebugOn", """set javaOptions in test in IntegrationTest += "-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5008" """) | |
addCommandAlias("partestDebugOff", """set javaOptions in test in IntegrationTest -= "-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5008" """) | |
addCommandAlias("replDebugOn_212", """set javaOptions in run in replJlineEmbedded += "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5008" """) | |
addCommandAlias("replDebugOff_212", """set javaOptions in run in replJlineEmbedded -= "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5008" """) | |
addCommandAlias("replDebugOn_213", """set javaOptions in run in replFrontend += "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5008" """) | |
addCommandAlias("replDebugOff_213", """set javaOptions in run in replFrontend -= "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5008" """) |
This file contains 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 scala.language.experimental.macros | |
//WIP does not function | |
final class lookerUpper extends scala.annotation.StaticAnnotation { | |
import lookerUpper._ | |
/** | |
* @param annottees list of untyped annottees | |
* @return | |
*/ |
This file contains 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
val s = %%pbpaste | |
s.out.string.split("\n").filter(_.contains("$")).map(_.split("\\$")(1)).map(_.toFloat).sum |
This file contains 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 scala.collection.mutable | |
class TrieNode(var children: mutable.Map[Char, TrieNode] = mutable.Map()) { | |
// Inserts into current Trie | |
def insert(c: Char): TrieNode = { | |
children.get(c).getOrElse({ | |
children.put(c, new TrieNode()) | |
this | |
} | |
) |
This file contains 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
object ParEitherNonEmpty { | |
import cats.data.NonEmptyList.catsDataSemigroupForNonEmptyList | |
import cats.data.{NonEmptyList, Validated} | |
new Parallel[Either[NonEmptyList[_], ?]] { | |
override type F[v] = Validated[NonEmptyList[_], v] | |
override def applicative: Applicative[Validated[NonEmptyList[_], *]] = { | |
Validated.catsDataApplicativeErrorForValidated[NonEmptyList[_]](catsDataSemigroupForNonEmptyList) | |
} |
This file contains 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 {Firestore} from "@google-cloud/firestore" | |
import { firestore as firestoreAdmin } from 'firebase-admin' | |
import {foldMap} from 'fp-ts/lib/Array' | |
import {pipe} from 'fp-ts/lib/pipeable' | |
import {monoidSum} from 'fp-ts/lib/Monoid' | |
import {flatMap, some as exists} from 'lodash' | |
import * as io from 'io-ts' | |
import { Timestamp } from '@google-cloud/firestore' |
This file contains 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 { default as faker } from 'faker' | |
import { fold, none, Option, some } from 'fp-ts/lib/Option' | |
import { pipe } from 'fp-ts/lib/pipeable' | |
import { keys } from 'fp-ts/lib/Record' | |
import { evalState, State } from 'fp-ts/lib/State' | |
import * as t from 'io-ts' | |
import { NumberFromString } from 'io-ts-types/lib/NumberFromString' | |
import { Moment } from 'moment' | |
// TODO don't use lodash |
This file contains 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
{-# LANGUAGE DeriveDataTypeable #-} | |
import qualified Data.Data as D | |
import Data.Data (Data) | |
data Gurren = Gurren { | |
owner :: String | |
, spiralPower :: Natural | |
} deriving (Data) | |
let properties = D.constrFields . head . D.dataTypeConstrs $ D.dataTypeOf (undefined :: Gurren) |
OlderNewer