Skip to content

Instantly share code, notes, and snippets.

View birdayz's full-sized avatar
🔥
nerden

Johannes Brüderl birdayz

🔥
nerden
View GitHub Profile
resource "google_dns_record_set" "zone_subzone_ns" {
name = "subdomain.${google_dns_managed_zone.zone.dns_name}"
type = "NS"
ttl = 300
managed_zone = google_dns_managed_zone.zone.name
rrdatas = google_dns_managed_zone.sub_zone.name_servers
}
resource "google_dns_managed_zone" "sub_zone" {
name = "my-subdomain"
dns_name = "subdomain.my-domain.com."
}
resource "google_dns_managed_zone" "zone" {
name = "my-domain"
dns_name = "my-domain.com."
}
package com.eon.iotcore.datapoint.compute;
import com.eon.iotcore.datapoint.DatapointChangedEvent;
import java.time.Instant;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.apache.kafka.streams.processor.TimestampExtractor;
// Extracts the embedded timestamp of a record (giving you "event-time" semantics).
public class MyTimestampExtractor implements TimestampExtractor {
@birdayz
birdayz / gist:5f1a4575f037e81547e2b7c0677e8917
Created March 8, 2019 20:53
grpc-gateway example option
// option (grpc.gateway.protoc_gen_swagger.options.openapiv2_schema) = {
// example : {value : '{"parent" : "0x01", "name":"name of child", "namespace" : "abc"}'}
// };
@birdayz
birdayz / index.html
Last active January 11, 2019 20:27
Infinimesh recursive object transformation for vuetify tree
<div id="app">
<v-app id="inspire">
<v-treeview :items="items"></v-treeview>
</v-app>
</div>
m := &api.Mutation{
CommitNow: true,
Set: []*api.NQuad{
&api.NQuad{Subject: request.GetEntityUid(), Predicate: "access.to", ObjectId: request.GetResourceUid(), Facets: []*api.Facet{
&api.Facet{
Key: "permission",
Value: []byte(request.GetAction()),
ValType: api.Facet_STRING,
Tokens: []string{request.GetAction()},
},
@birdayz
birdayz / Dockerfile
Last active September 25, 2018 09:19
GraalVM Docker build
FROM birdy/graalvm:latest
WORKDIR /tmp/build
ENV GRADLE_USER_HOME /tmp/build/.gradle
ADD . /tmp/build
RUN ./gradlew build fatJar
RUN native-image -jar /tmp/build/build/libs/graal-javalin-all-1.0-SNAPSHOT.jar -H:ReflectionConfigurationFiles=reflection.json -H:+JNI \
-H:Name=graal-javalin --static --delay-class-initialization-to-runtime=io.javalin.json.JavalinJson
FROM scratch
@birdayz
birdayz / reflect.json
Created September 23, 2018 23:04
Javalin GraalVM reflection config
[
{
"name": "[Lorg.eclipse.jetty.servlet.ServletMapping;",
"allDeclaredFields": true,
"allPublicFields": true,
"allDeclaredMethods": true,
"allPublicMethods": true
},
{
"name": "org.slf4j.impl.StaticLoggerBinder",
@birdayz
birdayz / fatJar.groovy
Created September 23, 2018 22:43
Fat Jar
task fatJar(type: Jar) {
manifest {
attributes 'Implementation-Title': 'Gradle Jar File Example',
'Implementation-Version': version,
'Main-Class': 'de.nerden.samples.graal.Main'
}
baseName = project.name + '-all'
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
}