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
%% Map keys known at compile-time | |
%% No boilerplate code or parse transform for record -> JSON | |
%% Matching on map keys in function signatures, not possible with proplists | |
%% JSONFrags = [#{...}, #{...}, #{...}, | |
process_layers(JSONFrags) -> process_layers(JSONFrags, #{}). | |
process_layers([], Result) -> | |
jsx:encode(Result). | |
process_layers([#{<<"key">> := <<"value">>} | Rest], Result) -> |
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
-module(mailinglist). | |
-export([test/0]). | |
handle([Head | _] = _List) when is_list(Head) -> | |
list_of_lists; | |
handle(_List) -> | |
not_a_list_of_lists. | |
test() -> | |
list_of_lists = handle([[1,2,3], [a, 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
def getProtoCompanionClass(protoName: String): Option[GeneratedMessageCompanion[_]] = { | |
try { | |
val protoClassSymbol = currentMirror.staticClass(protoName) | |
val protoCompanionObjectSymbol = protoClassSymbol.companion.asModule | |
Some(currentMirror.reflectModule(protoCompanionObjectSymbol).instance.asInstanceOf[GeneratedMessageCompanion[_]]) | |
} catch { | |
case _: ScalaReflectionException => None | |
} | |
} |
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
Hello World. I hope you are okay. What in the world is going on with you? | |
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras blandit sed leo eget efficitur. Sed vitae lectus dolor. Sed eget elit in ipsum mattis posuere sed ut ex. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Sed hendrerit tortor risus, sed congue justo dapibus at. Suspendisse ullamcorper id lacus ut viverra. Quisque quis lacinia mauris, a suscipit velit. In hac habitasse platea dictumst. Vestibulum porttitor mollis lectus, non vulputate magna condimentum quis. Maecenas vitae iaculis velit, et elementum leo. | |
This is some information about Jesse: | |
Name: Jesse Cornelius James | |
Email: [email protected] | |
Phone #: 803-555-1212 | |
Phone #: (803) 555-1212 |