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
package twentyquestions | |
import scala.io.StdIn | |
sealed trait Step | |
case class Question(text: String, yes: Step, no: Step) extends Step | |
case class Guess(text: String) extends Step | |
case class AskYesNo(prompt: String, ifYes: () => Unit, ifNo: () => Unit) |
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
package twentyquestions | |
import scala.io.StdIn | |
sealed trait Step | |
case class Question(text: String, yes: Step, no: Step) extends Step | |
case class Guess(text: String) extends Step | |
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
sealed trait H { | |
def falsy: Boolean | |
} | |
case class A(b: Boolean) extends H { | |
override def falsy = !b | |
} | |
case class C(d: Byte, more: H) extends H { | |
override def falsy = d == 0 && more.falsy |
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
trait App extends EquipmentLayer with HospitalLayer { | |
def requestEditApi(user0: Option[Volunteers.KEnt]) = new RequestEditApiImpl with RequestEditApi { | |
override def user = user0 | |
} | |
object AutoWireServer extends autowire.Server[String, Reader, Writer] { | |
override def write[A: Writer](r: A): String = upickle.default.write(r) | |
override def read[A: Reader](p: String): A = upickle.default.read[A](p) |
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
const e = name => props => (...children) => React.createElement(name, props, ...children); | |
const div = e('div'), h1 = e('h1'), h2 = e('h2'), table = e('table'), tbody = e('tbody'), tr = e('tr'), td = e('td'); | |
Array.prototype.updated = function (index, value) { | |
const a2 = this.slice(); | |
a2[index] = value; | |
return a2; | |
}; | |
const Range = (a, b) => (a >= b) ? [] : [a, ...Range(a + 1, b)]; |
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
Naftoli Gugenheim 🎻 [4:58 PM] | |
Ok where to begin... how about the title | |
[4:58] | |
> You Might Not Need TypeScript (or Static Types) | |
[4:59] | |
Who is he addressing? Has anyone argued that you "need" them? |
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
/* | |
* Zmanim Java API | |
* Copyright (C) 2011 - 2014 Eliyahu Hershfeld | |
* Copyright (C) September 2002 Avrom Finkelstien | |
* | |
* This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General | |
* Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) | |
* any later version. | |
* | |
* This library is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied |
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
# Install docker-compose | |
COMPOSE_VERSION=`git ls-remote https://github.com/docker/compose | grep refs/tags | grep -oP "[0-9]+\.[0-9]+\.[0-9]+$" | tail -n 1` | |
sudo sh -c "curl -L https://github.com/docker/compose/releases/download/${COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose" | |
sudo chmod +x /usr/local/bin/docker-compose | |
sudo sh -c "curl -L https://raw.githubusercontent.com/docker/compose/${COMPOSE_VERSION}/contrib/completion/bash/docker-compose > /etc/bash_completion.d/docker-compose" |
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
package chesednow.model.common | |
import scala.concurrent.ExecutionContext | |
import slick.additions.entity._ | |
import slick.ast.BaseTypedType | |
import chesednow.shared.common.{ChildItems, GenAggregates, RootAggregates} | |
import lrbcol.model.DBComponent | |
import lrbcol.model.SlickDriver.api._ |
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 $ivy.`org.jsoup:jsoup:1.7.2`, org.jsoup._ | |
val doc = Jsoup.connect("https://www.lightbend.com/activator/templates").get() | |
import collection.JavaConverters._ | |
doc.select("#searchFilterContent h1 > a").asScala.map(_.attr("href").stripPrefix("/activator/template/")) |