View gist:02cad9dda62e2dee4808bcc3d5670a18
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
final ObjectMapper mapper = new ObjectMapper(); | |
final StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment(); | |
env.setParallelism(1); | |
Properties props = new Properties(); | |
props.setProperty(TwitterSource.CONSUMER_KEY, "******************"); | |
props.setProperty(TwitterSource.CONSUMER_SECRET, "*********************"); | |
props.setProperty(TwitterSource.TOKEN, "*******************"); | |
props.setProperty(TwitterSource.TOKEN_SECRET, "*****************"); |
View mn-graphql-bean
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
@Bean | |
@Singleton | |
public GraphQL graphQL( | |
final ResourceResolver resourceResolver, | |
final DataFetcherProvider dataFetcherProvider) { | |
val schemaParser = new SchemaParser(); | |
val schemaGenerator = new SchemaGenerator(); | |
// Parse the schema. |
View mn-graphql-deps
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
compile 'io.micronaut.graphql:micronaut-graphql:1.1.0' |
View schema.graphqls
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
type Link { | |
url: String! | |
description: String! | |
} | |
type Query { | |
# a type of query which returns all links | |
allLinks: [Link!]! | |
} |
View medium-blog-entry-27c14590dc1b-gist
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
native-image \ | |
-H:ReflectionConfigurationFiles=reflection-config.json \ | |
-H:ResourceConfigurationFiles=resources-config.json \ | |
-jar build/libs/bootstrap.jar \ | |
--no-server \ | |
--enable-http --enable-https --enable-url-protocols=http,https \ | |
-Djava.net.preferIPv4Stack=true |
View sample.ts
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
console.log ( | |
(function(n: number): number { | |
if (n < 5) { | |
return // returns undefined which is not desired. Desired is n*2. | |
// Can "no statement after return" be checked by TS compiler ? | |
n * 2; | |
} | |
return n; | |
})(3) | |
); |