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 com.googlecode.totallylazy.Function1; | |
| import java.util.Arrays; | |
| import static java.lang.String.*; | |
| public class CurryingExample { | |
| static abstract class Function1<A, B> extends com.googlecode.totallylazy.Function1<A, B> { | |
| @Override |
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
| @Test | |
| public void nTilesRequireGridToDisplay() { | |
| assertThat(tiles(1), requiresGridOf(1, 1)); | |
| assertThat(tiles(2), requiresGridOf(1, 2)); | |
| assertThat(tiles(3), requiresGridOf(2, 3)); | |
| assertThat(tiles(4), requiresGridOf(2, 4)); | |
| assertThat(tiles(5), requiresGridOf(2, 3)); | |
| assertThat(tiles(6), requiresGridOf(2, 3)); | |
| assertThat(tiles(7), requiresGridOf(3, 3)); | |
| assertThat(tiles(8), requiresGridOf(3, 3)); |
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
| git config --global http.proxy myproxy:8080 | |
| git config --global user.email me@email.com | |
| git config --global user.name me | |
| git config --global color.ui true | |
| git config --global alias.last "log -1 HEAD" | |
| git config --global alias.st "status -sb" | |
| git config --global alias.lg "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset abbrev-commit --date=relative" |
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 javax.crypto.Mac | |
| import javax.crypto.spec.SecretKeySpec | |
| import rtx.forest.web.PercentEncoder | |
| import com.googlecode.utterlyidle.{RequestBuilder, Request} | |
| object OAuth { | |
| type ApiKey = String | |
| type SharedSecret = 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
| package bad.robot; | |
| import fj.F; | |
| import java.util.function.Function; | |
| import java.util.stream.Stream; | |
| public interface Either<A, B> { | |
| static <A, B> Either<A, B> left(final A a) { |
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
| def maprec[B](f: A => B): List[B] = { | |
| def recur(head: A, tail: List[A]): List[B] = { | |
| tail match { | |
| case Nil => List(f.apply(head)) | |
| case _ => f.apply(head) +: recur(tail.head, tail.tail) | |
| } | |
| } | |
| recur(elements.head, elements.tail) |
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 bad.robot.radiate | |
| import java.util.concurrent.Callable | |
| import java.util.function.{Consumer, Supplier} | |
| object FunctionInterfaceOps { | |
| implicit def toConsumer[A](function: A => Unit): Consumer[A] = new Consumer[A]() { | |
| override def accept(arg: A): Unit = function.apply(arg) | |
| } |
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 Console._ | |
| object Text { | |
| private val colours = List(RED, YELLOW, GREEN, CYAN, BLUE, MAGENTA) | |
| def bonza(string: String): String = GREEN + string + RESET | |
| def alter(string: String): String = RED + string + RESET |
OlderNewer