Skip to content

Instantly share code, notes, and snippets.

View ThomasStuetz's full-sized avatar

OStR Ing Mag Dr Thomas W. Stütz ThomasStuetz

View GitHub Profile
void handleResetEspRequest() {
//const char* response = "Formating the FlashFileSystem<br>Wifi-Connection reset settings, reboot ESP";
//HttpServer.send( 200, "text/html", response); //Returns the HTTP response
delay(1000);
//Serial.println(F("*HS Format flash memory!"));
//SPIFFS.format();
//Serial.println(F("*HS Done!"));
WiFi.disconnect(true);
WiFiManager wifiManager;
@ThomasStuetz
ThomasStuetz / _jsf.md
Last active February 11, 2018 19:18
JavaServer Faces / PrimeFaces Configuration

JavaServer Faces / PrimeFaces - Configuration

---project-dir
   |
   --- src / main 
   |          |
   |          --- java 
   |          |
 | --- resources
@ThomasStuetz
ThomasStuetz / _platformio.md
Last active February 19, 2018 14:49
PlatformIO

PlatformIO

PH-Seminar ESP8266 und Android

gists für 1AHTIM, 17/18

@ThomasStuetz
ThomasStuetz / donwloadDummyData
Created May 16, 2017 08:44
REST-Client mit Volley
private void downloadDummyData() {
final String URL = "http://vm15.htl-leonding.ac.at:8080/DummyDataGenerator/rs/person/20";
JsonArrayRequest jsonRequest = new JsonArrayRequest(
URL,
new Response.Listener<JSONArray>() {
@Override
public void onResponse(JSONArray response) {
Log.d(TAG, response.toString());
@ThomasStuetz
ThomasStuetz / ItemDivider.java
Created May 13, 2017 17:00
Google's sample implementation of dividers displayed between the RecyclerView items
@Override
public void onDrawOver(Canvas c, RecyclerView parent,
RecyclerView.State state) {
super.onDrawOver(c, parent, state);
// calculate left/right x-coordinates for all dividers
int left = parent.getPaddingLeft();
int right = parent.getWidth() - parent.getPaddingRight();
// for every item but the last, draw a line below it
@ThomasStuetz
ThomasStuetz / pom.xml
Last active October 11, 2016 08:37
Simple pom.xml for JavaEE and database access in the tests (JavaSE with eclipselink+derbydb)
<?xml version="1.0" encoding="UTF-8"?>
<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>at.htl</groupId>
<artifactId>vehicle</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
@ThomasStuetz
ThomasStuetz / web.xml
Created October 26, 2015 22:48
web.xml for JavaEE Web with Primefaces
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
<context-param>
@ThomasStuetz
ThomasStuetz / VehicleTest.java
Created October 14, 2015 08:28
Simple JDBC-Test for JavaSE
package at.htl.vehicle;
import org.junit.BeforeClass;
import org.junit.Test;
import java.sql.*;
import static junit.framework.TestCase.fail;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.is;
@ThomasStuetz
ThomasStuetz / persistence.xml
Last active December 9, 2019 19:21
Simple persistence.xml for JavaSE and DerbyDb
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence" version="2.1">
<persistence-unit name="myPU" transaction-type="RESOURCE_LOCAL">
<class>at.htl.vehicle.entity.Vehicle</class>
<exclude-unlisted-classes>true</exclude-unlisted-classes>
<properties>
<property name="eclipselink.logging.level" value="FINE"/>
<property name="eclipselink.target-database" value="DERBY"/>
<!--
<property name="javax.persistence.jdbc.driver"