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
tmp$ git clone git@github.com:d6y/aws-gateway-mapping-playground.git | |
Cloning into 'aws-gateway-mapping-playground'... | |
remote: Counting objects: 22, done. | |
remote: Total 22 (delta 0), reused 0 (delta 0), pack-reused 22 | |
Receiving objects: 100% (22/22), 8.71 KiB | 4.36 MiB/s, done. | |
Resolving deltas: 100% (1/1), done. | |
tmp$ cd aws-gateway-mapping-playground/ | |
aws-gateway-mapping-playground (master)$ sbt | |
[info] Updated file /Users/richard/Developer/tmp/aws-gateway-mapping-playground/project/build.properties: set sbt.version to 1.1.6 | |
[info] Loading settings from idea.sbt,sbt-updates.sbt,sonatype.sbt ... |
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
-------- QUERY 2 (WRONG): | |
DEBUG slick.compiler.QueryCompiler - Source: | |
| Bind | |
| from s2: Filter s3 | |
| from s3: TableExpansion | |
| table s4: Table a | |
| columns: TypeMapping | |
| 0: ProductNode | |
| 1: Path s4.id : Int' |
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
-------- QUERY 1 (CORRECT): | |
DEBUG slick.compiler.QueryCompiler - Source: | |
| Apply Function count(*) | |
| 0: Filter s2 | |
| from s2: TableExpansion | |
| table s3: Table a | |
| columns: TypeMapping | |
| 0: ProductNode | |
| 1: Path s3.id : Int' |
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
'use strict'; | |
const admin = require('firebase-admin'); | |
admin.initializeApp(); | |
const functions = require('firebase-functions'); // Cloud Functions for Firebase library | |
const DialogflowApp = require('actions-on-google').DialogflowApp; // Google Assistant helper library | |
exports.dialogflowFirebaseFulfillment = functions.https.onRequest((request, response) => { | |
console.log('Dialogflow Request headers: ' + JSON.stringify(request.headers)); | |
console.log('Dialogflow Request body: ' + JSON.stringify(request.body)); | |
if (request.body.queryResult) { |
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 example | |
import scala.language.higherKinds | |
import cats.MonadError | |
import cats.syntax.functor._ | |
// Both Try and Future are backed by Exceptions | |
// We can trade Future for Try in tests to avoid concurrency and execution context etc |
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
/* | |
By default, there are equality tests in Scala that return false which you'd really like | |
to be a compile-time error. | |
For example: | |
scala> "Hello" == 42 | |
res0: Boolean = false | |
scala> Some(1) == 1 |
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 Data.Monoid | |
import Data.Ratio | |
import Control.Monad.Writer | |
import Control.Monad.Reader | |
import Control.Monad.State | |
-- Maybe is for values with an added context of failure | |
fruit :: Maybe String | |
fruit = Just "Apple" |
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
-- | |
-- Functional Brighton, LYAHFGG Monoids | |
-- https://www.meetup.com/Functional-Brighton/events/239127334/ | |
-- | |
{- | |
About Monoids: | |
Needs a binary function: |
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
~$ cd tmp/ | |
tmp$ git clone https://github.com/underscoreio/shapeless-guide-code | |
Cloning into 'shapeless-guide-code'... | |
remote: Counting objects: 280, done. | |
remote: Total 280 (delta 0), reused 0 (delta 0), pack-reused 280 | |
Receiving objects: 100% (280/280), 1.02 MiB | 918.00 KiB/s, done. | |
Resolving deltas: 100% (60/60), done. | |
tmp$ cd shapeless-guide-code/ | |
shapeless-guide-code (exercises)$ ls | |
LICENSE build.sbt csv json migrations project representations sbt.bat schedule.md |
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
protocol (master *)$ git diff | |
diff --git a/http/src/test/scala/spinoco/protocol/http/codec/HeaderCodecSpec.scala b/http/src/test/scala/spinoco/protocol/http/codec/HeaderCodecSpec.scala | |
index e181170..41015af 100644 | |
--- a/http/src/test/scala/spinoco/protocol/http/codec/HeaderCodecSpec.scala | |
+++ b/http/src/test/scala/spinoco/protocol/http/codec/HeaderCodecSpec.scala | |
@@ -292,6 +292,9 @@ property("Accept-Ranges Header") = secure { | |
, ("Cookie: SESSID=298zf09hf012fh2; httponly" | |
, Cookie(HttpCookie("SESSID", "298zf09hf012fh2", None, None, None, None, false, httpOnly = true, Map.empty)) | |
, "Cookie: SESSID=298zf09hf012fh2; httponly") | |
+ , ("Cookie: __utmz=118721.140907.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); Currency=%22usd%22" |