This file contains hidden or 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
public class Handler extends SpringBootApiGatewayRequestHandler { | |
} |
This file contains hidden or 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
public interface ClimateReadingRepository extends CrudRepository<ClimateReading, String> { | |
} |
This file contains hidden or 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
... | |
function.name=saveReadings | |
... |
This file contains hidden or 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
@SpringBootApplication | |
public class Application { | |
@Autowired | |
ClimateReadingRepository climateReadingRepository; | |
@Bean(name = "saveReadings") | |
public Function<ClimateReading, ClimateReading> saveReadings() { | |
return (reading) -> climateReadingRepository.save(reading); | |
} |
This file contains hidden or 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
buildscript { | |
ext { | |
springBootVersion = '1.5.11.RELEASE' | |
wrapperVersion = '1.0.9.RELEASE' | |
shadowVersion = '2.0.1' | |
} | |
repositories { | |
jcenter() | |
mavenLocal() | |
mavenCentral() |
This file contains hidden or 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
#!/usr/bin/python | |
import sys | |
import Adafruit_DHT | |
import json | |
import urllib2 | |
import time | |
humidity, temperature = Adafruit_DHT.read_retry(Adafruit_DHT.AM2302, 2) |
This file contains hidden or 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
/** | |
* tske a {@link FilePart}, transfer it to disk using {@link AsynchronousFileChannel}s and return a {@link Mono} representing the result | |
* | |
* @param filePart - the request part containing the file to be saved | |
* @return a {@link Mono} representing the result of the operation | |
*/ | |
private Mono<String> saveFile(FilePart filePart) { | |
LOGGER.info("handling file upload {}", filePart.filename()); | |
// if a file with the same name already exists in a repository, delete and recreate it |
This file contains hidden or 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
@RestController | |
@RequestMapping(path = "/api/files") | |
public class ReactiveUploadResource { | |
Logger LOGGER = LoggerFactory.getLogger(ReactiveUploadResource.class); | |
/** | |
* upload handler method, mapped to POST. Like any file upload handler it consumes MULTIPART_FORM_DATA. | |
* Produces a JSON respomse | |
* | |
* @param parts a flux providing all part contained in the MULTIPART_FORM_DATA request |
This file contains hidden or 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 java.util.Calendar; | |
import java.util.function.Consumer; | |
/** | |
* Created by emilkirschner on 13/02/17. | |
*/ | |
class BaseBenchmarkState { | |
protected void generateTime(Consumer<Long> consumer) { | |
for (int month = Calendar.JANUARY; month <= Calendar.DECEMBER; month++) { | |
for (int day = 0; day <= 28; day++) { |
This file contains hidden or 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 com.thekirschners.emplacements.column; | |
import java.util.Arrays; | |
import java.util.Iterator; | |
import java.util.Spliterator; | |
import java.util.Spliterators; | |
import java.util.function.Consumer; | |
import java.util.stream.DoubleStream; | |
import java.util.stream.LongStream; | |
import java.util.stream.Stream; |