Skip to content

Instantly share code, notes, and snippets.

@Danny02
Danny02 / commandhandler.java
Created May 30, 2022 18:45
commandhandler.java
import org.apache.kafka.streams.KeyValue;
import org.apache.kafka.streams.StreamsBuilder;
import org.apache.kafka.streams.kstream.Transformer;
import org.apache.kafka.streams.kstream.TransformerSupplier;
import org.apache.kafka.streams.processor.ProcessorContext;
import org.apache.kafka.streams.state.KeyValueStore;
import org.apache.kafka.streams.state.StoreBuilder;
import org.apache.kafka.streams.state.Stores;
import java.util.List;
@Danny02
Danny02 / sensor-to-influx.ino
Created August 25, 2019 20:08
ESP32 program to upload sensor data to InfluxDB
#define uS_TO_S_FACTOR 1000000 /* Conversion factor for micro seconds to seconds */
#define TIME_TO_SLEEP 15 /* Time ESP32 will go to sleep (in seconds) */
// Example testing sketch for various DHT humidity/temperature sensors written by ladyada
// REQUIRES the following Arduino libraries:
// - DHT Sensor Library: https://github.com/adafruit/DHT-sensor-library
// - Adafruit Unified Sensor Lib: https://github.com/adafruit/Adafruit_Sensor
#include "DHT.h"
class SchuleQuery {
constructor(public art: string, public name: string, public addresse: string, public plz: string) {
}
}
type SchuleValidator = Validator<Partial<SchuleQuery>, string>;
const minOne: SchuleValidator = ps => {
if (Object.keys(ps).find(f => f !== undefined)) {
return new Success(ps);

Keybase proof

I hereby claim:

  • I am danny02 on github.
  • I am dannynullzwo (https://keybase.io/dannynullzwo) on keybase.
  • I have a public key ASA1rHC8VhSyXLiJ7F383oOCoHapjXqrSk28WQP2JD5kiQo

To claim this, I am signing this object:

@Danny02
Danny02 / App.java
Last active August 29, 2015 14:07
Showcases a compiler bug in the JDK 8_20
class App {
interface B<T>{T get();}
interface C<S>{}
static void error() {
C a = null;
/*
* No error, but an Error with Java 7(which is correct).
* Foo returns a Rawtype which gets mapped to B<Float>
use strict;
use warnings;
package VarVal;
sub println
{
print @_, "\n";
}
sub val
{
trait A[T]{
def foo(): Any
}
implicit object B extends A[Bar]{
def foo(): String = "Hi"
}
val a: String = B.foo()
@Danny02
Danny02 / bull.scala
Last active December 24, 2015 02:59
import shapeless._
object Bullshit {
sealed abstract class Size[T](val size:Int)
object Size{
implicit object sizeForString extends Size[String](9)
implicit object sizeForInt extends Size[Int](4)
implicit object sizeForFloat extends Size[Float](7)
}
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>info.yeppp</groupId>
<artifactId>yeppp</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<properties>
@Danny02
Danny02 / physical.c
Last active December 23, 2015 06:19
some basic GLSL fragment shader show casing physical correct lighting
in vec3 normal;
in vec3 eye;//from vertex to eye/origin
const light = vec3(0.12708472893924555, -2.5399460893115735, 2.8320502943377743) // from vertex to lightsource
const vec3 LIGHT_COLOR = vec3(1, 0.7, 0.4);
//created textures have to have realistic values
//Fresh asphalt 0.04
//Worn asphalt 0.12
//Bare soil 0.17