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 org.scalatest._ | |
import org.scalatest.matchers.ShouldMatchers | |
class SomeNull extends FlatSpec with ShouldMatchers { | |
val o:Option[String] = Some(null) | |
"The option" should "not match Some(a)" in { | |
o match { | |
case Some(s) => s should not be (null) | |
case _ => |
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
object FileReaders { | |
object file { | |
def ->(contents: Seq[String]) = contents | |
} | |
object lines { | |
def apply(path:String) = scala.io.Source.fromFile(path).getLines().toSeq | |
} | |
} |
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
object IfBrowserIs { | |
def ie9 = if(S.request.map(_.isIE9).openOr(false)) PassThru else ClearNodes | |
} |
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 code.snippet | |
object Script { | |
def render(xhtml:NodeSeq):NodeSeq = attr("name").map { name => | |
import config.BuildInfo.version | |
<script id={name+"_js"} src={s"/js/$name-$version.js"} type="text/javascript"></script> | |
} openOr xhtml | |
} | |
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
object Style { | |
def render(xhtml:NodeSeq):NodeSeq = attr("name").map { name => | |
import config.BuildInfo.version | |
<link id={name+"_css"} href={s"/css/$name-$version.css"} rel="stylesheet"></link> | |
} openOr xhtml | |
} |
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 com.joescii | |
import org.scalatest.{ShouldMatchers, FlatSpecLike} | |
/** | |
* Created by jbarnes on 10/23/2014. | |
*/ | |
class ImplicitSpecs extends FlatSpecLike with ShouldMatchers { | |
"Scala implicits" should "act like their java counterparts" in { | |
val java = new MyJavaClass |
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 Base | |
trait Child1 extends Base { | |
def method1:String = "method1" | |
} | |
trait Child2 extends Base { | |
def method2:String = "method2" | |
} | |
def coinFlip:Boolean = ??? | |
val thing:String with Base = if(coinFlip) new String("str") with Child1 |
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
module Fun where | |
import Data.Array (map, filter, (..)) | |
-- Given an argument `a` applies the function `f` | |
(>>) :: forall a b. a -> (a -> b) -> b | |
(>>) a f = f a | |
infix 1 >> | |
-- Given functions `f` and `g`, composes to yield `g` of `f` |
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
#!/bin/bash -eux | |
sudo mv /tmp/symg /opt/symg | |
sudo echo "java -Dsymbol.generator.localhost=false -jar /opt/symg/symbol-generator.jar" >> /etc/rc.d/rc.local |
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
bower check-new Checking for new versions of the project dependencies.. | |
starter-kit C:\Users\jbarnes\code\intro-ps | |
├─┬ purescript-arrays#0.3.7 (latest is 0.4.0) | |
│ ├── purescript-control#0.2.6 (latest is 0.3.0) | |
│ └─┬ purescript-maybe#0.2.2 (latest is 0.3.1) | |
│ └── purescript-control#0.2.6 | |
├─┬ purescript-bifunctors#0.4.0 extraneous | |
│ └── purescript-control#0.2.6 incompatible with ^0.3.0 (0.3.0 available) | |
├─┬ purescript-console#0.1.0 extraneous | |
│ └─┬ purescript-eff#0.1.0 extraneous |
OlderNewer