implicit class TryWithForNot[T](t: Try[T]) {
def fornot[A](f: Throwable => A): Unit = ???
}
implicit class SuccessWithForNot[T](success: Success[T]) {
def fornot[A](f: Throwable => A): Unit = ()
}
implicit class FailureWithForNot[T](failure: Failure[T]) {
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 class Bag<out THING> { | |
object Empty: Bag<Nothing>() | |
data class NonEmpty<out THING>(val thing: THING): Bag<THING>() | |
// Make a Bag with a THUNG in it | |
companion object { | |
fun <THUNG> make(thung: THUNG): Bag<THUNG> = NonEmpty(thung) | |
} | |
// Do stuff to the THING in the Bag by providing a thingToBagOfThang |
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
apiVersion: build.knative.dev/v1alpha1 | |
kind: Build | |
metadata: | |
name: hello-springboot-mvn-build | |
spec: | |
source: | |
git: | |
url: https://github.com/jamesward/hello-springboot-mvn.git | |
revision: master | |
template: |
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
IMAGE=gcr.io/multiregion-atamel/where-am-i | |
wget https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 | |
chmod +x jq-linux64 | |
sudo mount -o remount,exec /home | |
CID=$(docker ps | grep $IMAGE | awk '{ print $1 }') | |
TOKEN=$(curl "http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/token" -H "Metadata-Flavor: Google" | ./jq-linux64 -r ".access_token") | |
docker login -u oauth2accesstoken -p "$TOKEN" https://gcr.io | |
docker pull $IMAGE |
There comes a point in every Functional Programmer's life where they feel the curse of the Monad has lifted and they must now explain Monads to their friends who just don't get it. What follows is probably wrong and confusing, cause there is no escaping the curse. But here goes...
Suppose you have a system property that contains the name of another system property, like:
KEYNAME=FOO
And you want the value of FOO
, like:
FOO=BAR
Dreamhouse Einstein Vision Workshop
Create a Heroku Account:
https://signup.heroku.com
Using Heroku Button, deploy the Dreamhouse Einstein Vision:
https://github.com/dreamhouseapp/dreamhouse-pvs-scala
Create a dataset from this URL:
http://www.dreamhouseapp.io/Dreamhouse.zip
I hereby claim:
- I am jamesward on github.
- I am jamesward (https://keybase.io/jamesward) on keybase.
- I have a public key whose fingerprint is 341C 2AE4 7D5F F3A7 EDFB 5989 E57A 697A 70CF E5F9
To claim this, I am signing this object:
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 controllers; | |
import play.*; | |
import play.mvc.*; | |
import views.html.*; | |
public class Application extends Controller { | |
public static Result index() { |
- Install Eclipse 3.7 or newer
- Signup for a Heroku account
- Install the Heroku Eclipse Plugin (Complete the steps up to "Create app from template")