Article topics:
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
data Coord = One | Two | Three deriving (Enum, Eq) | |
data Symb = O | X | Nada deriving (Show, Eq) | |
type TicTacToe = Coord -> Coord -> Symb | |
showBoard :: TicTacToe -> String | |
showBoard b = unlines $ map showLine [One .. Three] | |
where | |
showLine c = unwords $ map (showHouse $ b c) [One .. Three] | |
showHouse b' c = show $ b' c |
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 arrow.core.Option | |
class NonZeroInt private constructor(val value: Int) { | |
companion object { | |
operator fun invoke(x: Int): Option<NonZeroInt> = | |
if (x == 0) Option.empty() else Option.just(NonZeroInt(x)) | |
fun get(x: NonZeroInt): Int = x.value | |
} | |
} |
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 me.jorgecastillo.polymorphicapps.polymorphic | |
import arrow.Kind | |
import arrow.core.Option | |
import arrow.core.left | |
import arrow.core.right | |
import arrow.effects.IO | |
import arrow.effects.async | |
import arrow.effects.fix | |
import arrow.effects.typeclasses.Async |
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
minikube stop; minikube delete && | |
docker stop $(docker ps -aq) && | |
rm -rf ~/.kube ~/.minikube && | |
sudo rm -rf /usr/local/bin/localkube /usr/local/bin/minikube && | |
launchctl stop '*kubelet*.mount' && | |
launchctl stop localkube.service && | |
launchctl disable localkube.service && | |
sudo rm -rf /etc/kubernetes/ && | |
docker system prune -af --volumes |
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 kotlinx.coroutines.experimental.channels.BroadcastChannel | |
import kotlinx.coroutines.experimental.channels.ConflatedBroadcastChannel | |
import kotlinx.coroutines.experimental.channels.ReceiveChannel | |
import kotlinx.coroutines.experimental.channels.filter | |
import kotlinx.coroutines.experimental.channels.map | |
import kotlinx.coroutines.experimental.launch | |
import javax.inject.Inject | |
import javax.inject.Singleton |
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 java.lang.ProcessBuilder.Redirect | |
import java.util.concurrent.TimeUnit | |
fun String.runCommand(workingDir: File? = null) { | |
val process = ProcessBuilder(*split(" ").toTypedArray()) | |
.directory(workingDir) | |
.redirectOutput(Redirect.INHERIT) | |
.redirectError(Redirect.INHERIT) | |
.start() | |
if (!process.waitFor(10, TimeUnit.SECONDS)) { |
This is a curated list of iOS (Swift & ObjC) frameworks which are inspired by React and Elm.
- ReactSwift by @ColinEberhardt
- https://github.com/ColinEberhardt/ReactSwift
Assuming that the following environment variables are set:
KAFKA_HOME
where Kafka is installed on local machine (e.g./opt/kafka
)ZK_HOSTS
identifies running zookeeper ensemble, e.g.ZK_HOSTS=192.168.0.99:2181
KAFKA_BROKERS
identifies running Kafka brokers, e.g.KAFKA_BROKERS=192.168.0.99:9092
Start Zookepper and Kafka servers
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 stack | |
> -- stack --resolver lts-6 --install-ghc runghc --package classy-prelude --package lens --package wreq | |
Blah Blah words about this single file executable README goes here. | |
> {-# LANGUAGE DeriveAnyClass #-} | |
> {-# LANGUAGE DeriveGeneric #-} | |
> {-# LANGUAGE NoImplicitPrelude #-} | |
> {-# LANGUAGE OverloadedStrings #-} |