Skip to content

Instantly share code, notes, and snippets.

View stritti's full-sized avatar
👨‍🏫

Stephan Strittmatter stritti

👨‍🏫
View GitHub Profile
@stritti
stritti / script.js
Last active June 21, 2023 06:03
Script to upload Kostal Plenticore Data from openHAB to PVoutput
var { QuantityType } = require("@runtime");
var HttpUtil = Java.type("org.openhab.core.io.net.http.HttpUtil");
var logger = Java.type('org.slf4j.LoggerFactory').getLogger('org.openhab.rule.' + ctx.ruleUID);
var headerProperty = Java.type("java.util.Properties");
var pvoutputApiKey = "[xxx]";
var pvoutputSystemId = "[xxx]";
var itemName = "KOSTALPLENTICOREPlus85withBattery";
@stritti
stritti / js-exif-rotate.html
Created December 12, 2019 19:34 — forked from runeb/js-exif-rotate.html
Auto-rotate images locally in the browser by parsing exif data
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<input id="file" type="file" accept="image/*" />
<br/>
<h2>As read:</h2>
<img id="placeholder1" width=300/><br/>
<h2>Rotated by exif data:</h2>
<img id="placeholder2" width=300/>
<script>
@stritti
stritti / ESPExceptionDecode.bat
Created March 23, 2019 23:28
Decode the Exception of ESP within PlatformIO
%homedrive%%homepath%/.platformio/packages/toolchain-xtensa/bin/xtensa-lx106-elf-addr2line.exe -fp -e ./.pioenvs/nodemcuv2/firmware.elf
@stritti
stritti / keybase.md
Created March 20, 2019 08:33
keybase.md

Keybase proof

I hereby claim:

  • I am stritti on github.
  • I am stritti (https://keybase.io/stritti) on keybase.
  • I have a public key ASA-egTOOfMZk5GjYFzTOYuYKhrRwa8GtzB2XlhCtoQT-Qo

To claim this, I am signing this object:

@stritti
stritti / RepeatTimer.cpp
Last active February 20, 2019 14:52
ESP32 Repeat timer example
/*
Repeat timer example
This example shows how to use hardware timer in ESP32. The timer calls onTimer
function every second.
The timer can be stopped with button attached to PIN 0 (IO0).
This example code is in the public domain.
Origin source: https://github.com/espressif/arduino-esp32/blob/master/libraries/ESP32/examples/Timer/RepeatTimer/
*/
@stritti
stritti / .clang-format
Created January 24, 2019 10:13
clang-format for programming ESP
# C/C++ Coding Style for generic Projects
# UseTab: (VS Code current setting)
BasedOnStyle: LLVM
Language: Cpp
IndentWidth: 2
ColumnLimit: 130
BreakBeforeBraces: Attach
PointerAlignment: Left
Number Sensor_Solar_Temperature "Solar"
(gPool, gTemperature, Chart_Pool_Temperature)
["CurrentTemperature", "object:solar"] {
mqtt="<[mqtt:/sensor/solar/temperature:state:JSONPATH($. value)]"
}
@stritti
stritti / esp32-internal-temp.ino
Last active September 18, 2018 20:52
Read internal temperature of ESP32
#include <Arduino.h>
#include "esp_system.h"
extern "C" {
uint8_t temprature_sens_read();
}
void setup() {
Serial.begin(115200);
}
@stritti
stritti / index.html
Last active February 6, 2018 19:39
How to embed Microsoft MakeCode Blocks to your HTML page
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Show Blocks</title>
<link rel="stylesheet" href="//pxt.azureedge.net/blob/c4478bc8315eba07849eb0eb2a4e7604081e3be7/doccdn/semantic.css" />
<link rel="stylesheet" href="//pxt.azureedge.net/blob/cb1f99cdf08c83e493934fed721ec63c9123ae5f/doccdn/blockly.css" />
</head>
<body>
@stritti
stritti / Template_ESP8266.ino
Created October 31, 2017 18:36 — forked from gjlawran/Template_ESP8266.ino
ESP8266 Arduino project template with optional OTA firmware update
/**
* ESP8266 project template with optional:
* - WiFi config portal - auto or manual trigger
* - OTA update - Arduino or web server
* - Deep sleep
* - Process timeout watchdog
*
* Copyright (c) 2016 Dean Cording <dean@cording.id.au>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy