Skip to content

Instantly share code, notes, and snippets.

View gist:02cad9dda62e2dee4808bcc3d5670a18
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
@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
compile 'io.micronaut.graphql:micronaut-graphql:1.1.0'
View schema.graphqls
type Link {
url: String!
description: String!
}
type Query {
# a type of query which returns all links
allLinks: [Link!]!
}
View medium-blog-entry-27c14590dc1b-gist
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
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)
);