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
/* Akka Http Routes | |
* ---------------- | |
* Use of `concat` here: | |
* Tries the supplied routes in sequence, returning the result of the first route that doesn't reject the request. | |
* | |
* Eg. | |
* In the case of: | |
* GET /orders - `get(complete(StatusCodes.OK, s"GET All Orders request."))` will be executed. | |
* | |
* GET /orders/<some uuid> - `get(complete(StatusCodes.OK, s"GET request for id: $id"))` will be executed. |
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 akka.http.scaladsl.marshalling.{Marshaller, ToEntityMarshaller} | |
import akka.http.scaladsl.model.MediaTypes.`application/json` | |
import akka.http.scaladsl.model.{ContentType, ContentTypeRange, HttpEntity, MediaType} | |
import akka.http.scaladsl.unmarshalling.{FromEntityUnmarshaller, Unmarshaller} | |
import akka.util.ByteString | |
import io.circe._ | |
/** | |
* https://doc.akka.io/docs/akka-http/current/common/marshalling.html | |
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 os | |
import sys | |
print(sys.version) | |
print("\n \n") | |
print(sys.path) | |
sys.path.append('/usr/local/lib/python3.7/site-packages') | |
import json | |
import requests | |
import pandas as pd |
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
/* | |
Promise Flow in JS - https://mdn.mozillademos.org/files/15911/promises.png | |
1. Creating a Promise by passing an executor | |
2. Using Promise prototype methods | |
2a. then handler | |
2b. catch handler | |
2c. finally handler | |
3. Using Promise static methods | |
3a. Promise.resolve |
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 learning.gists | |
/** | |
* GIST shows - | |
* Ways we can use `outcomeOf` method at usage place from trait `OutcomeOf`. | |
* 1. We can mixin the trait. | |
* 2. We can import trait's comp object. | |
*/ | |
//Outcome ADT |