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
Skull fracture. | |
Trench engulfment. | |
Worker electrocuted. | |
Worker fatally shot. | |
Worker was murdered. | |
Worker died in falll. | |
Possible heart attack. | |
Worker died in a fall. | |
Worker fell from lift. | |
Worker killed in fall. |
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
// These lines go in ~/.sbt/0.13/global.sbt | |
watchSources ++= ( | |
(baseDirectory.value * "*.sbt").get | |
++ (baseDirectory.value / "project" * "*.scala").get | |
++ (baseDirectory.value / "project" * "*.sbt").get | |
) | |
addCommandAlias("rtu", "; reload ; test:update") | |
addCommandAlias("rtc", "; reload ; test:compile") | |
addCommandAlias("ru", "; reload ; update") |
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
instance Monad f => Applicative (OptionalT f) where | |
pure = OptionalT . pure . Full | |
mf <*> ma = OptionalT $ do | |
optf <- runOptionalT mf | |
case optf of | |
Empty -> return Empty | |
Full f -> do | |
opta <- runOptionalT ma | |
return $ f <$> opta |
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
instance Monad f => Monad (OptionalT f) where | |
f =<< x = OptionalT $ runOptionalT x >>= \case | |
Empty -> return Empty | |
Full a -> runOptionalT $ f a |
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
instance Monad f => Monad (OptionalT f) where | |
f =<< x = OptionalT $ runOptionalT x >>= \case | |
Empty -> return Empty | |
Full a -> runOptionalT $ f a |
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
#!/usr/bin/env bash | |
# | |
output () { | |
pup 'tbody[id="dns-view-cache-tbody"] tr json{}' \ | |
| jq -r '.[].children[] | select(.tag == "td").text' \ | |
| ag --nocolor --literal . | |
} | |
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
% mscala -v 2.13.0-M4 | |
Welcome to Scala 2.13.0-M4 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_181). | |
Type in expressions for evaluation. Or try :help. | |
scala> val counter = { | |
| var count = 0 | |
| () => { | |
| val res = try "x" + count finally count = count + 1 | |
| try res finally println(res) | |
| } |
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
% sbtx dependencyGraph | |
... blah blah ... | |
[info] *** Welcome to the sbt build definition for Scala! *** | |
[info] Check README.md for more information. | |
[error] Not a valid command: dependencyGraph | |
[error] Not a valid project ID: dependencyGraph | |
% sbtx -Dplugins=graph dependencyGraph | |
... blah blah ... |
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 ttypes { | |
type ->[+A, +B] = (A, B) | |
type PairOf[+A] = A -> A | |
type SumOf[+A] = A \/ A | |
trait Interpret[T[_[_]]] { | |
type ^[Outer[_], Inner[_]] = Outer[T[Inner]] | |
trait Transform[F[_], G[_]] { | |
type FTF = F[T[F]] |
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
/* | |
* Copyright 2014–2016 SlamData Inc. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |