Skip to content

Instantly share code, notes, and snippets.

View hofiorg's full-sized avatar

Christian Hofmann hofiorg

View GitHub Profile
@hofiorg
hofiorg / VertxSSLConfiguration.java
Created March 7, 2019 12:54
SSL Configuration for Vert.x HttpServer
private HttpServer sslConfiguration() {
Boolean ssl = config().getBoolean(CONFIG_SSL, DEFAULT_SSL);
logger.debug(CONFIG_SSL + " " + ssl);
if(ssl) {
String keystoreFile = config().getString(CONFIG_SSL_KEYSTORE_FILE, DEFAULT_SSL_KEYSTORE_FILE);
logger.debug(CONFIG_SSL_KEYSTORE_FILE + " " + keystoreFile);
String keystorePassword = config().getString(CONFIG_SSL_KEYSTORE_PASSWORD, DEFAULT_SSL_KEYSTORE_PASSWORD);
logger.debug(CONFIG_SSL_KEYSTORE_PASSWORD + " " + keystorePassword);
HttpServerOptions options = new HttpServerOptions()
//.setUseAlpn(true)
@hofiorg
hofiorg / ColorSubComposites.java
Last active April 16, 2018 07:30
set background color to SWT composites recursive
private void colorSubComposites(Composite co, int color) {
Control [] controls = co.getChildren();
co.setBackground(getShell().getDisplay().getSystemColor(color));
for(Control control : controls) {
if(control instanceof Composite)
colorSubComposites((Composite)control, color);
}
}
// USAGE: colorSubComposites(co, SWT.COLOR_RED);
@hofiorg
hofiorg / Varargs1.java
Last active May 10, 2016 13:16
Java - Variable Arguments
void function(Object... args) {
for(Object arg : args) {
// ---
}
}
@hofiorg
hofiorg / Varags2.java
Last active May 11, 2016 11:05
Java - Variable Arguments
public class Varargs2 {
public static String insertComma(String... values) {
String result = "";
boolean first = true;
for (String value : values) {
result += (first ? "" : ", ") + value;
first = false;
}
return result;
package bwl;
import com.ml.views.AusgabeFenster;
import com.ml.views.ZeichenFenster;
public class Programm {
public static void main(String[] args) {
ZeichenFenster z1 = new ZeichenFenster("Uebersicht");
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Weihnachten</title>
<style type="text/css">
#a1 {
color:#6496FF;
font-family:arial;
font-weight: bold;
font-size:80px;
package bwl;
import bwl.main.oo.Lagerhaus;
import com.ml.utils.MatheHelfer;
import com.ml.views.AusgabeFenster;
import com.ml.views.Daten;
import com.ml.views.DatenReihe;
import com.ml.views.Permutator;
import com.ml.views.ZeichenFenster;
package bwl;
import bwl.main.oo.Lagerhaus;
import com.ml.utils.MatheHelfer;
import com.ml.views.AusgabeFenster;
import com.ml.views.Daten;
import com.ml.views.DatenReihe;
import com.ml.views.Permutator;
import com.ml.views.ZeichenFenster;
<html>
<!-- Schoene Farbe suchen unter:
http://de.selfhtml.org/helferlein/farben.htm -->
<body bgcolor="#333333">
Hallo
<h1>Ueberschrift</h1>
<h1>Ueberschrift</h1>
<h1>Ueberschrift</h1>
<h1>Ueberschrift</h1>
<h1>Ueberschrift</h1>
<link rel="import" href="bower_components/core-toolbar/core-toolbar.html">
<link rel="import" href="bower_components/core-drawer-panel/core-drawer-panel.html">
<link rel="import" href="bower_components/core-header-panel/core-header-panel.html">
<polymer-element name="my-component">
<template>
<core-drawer-panel id="drawerPanel" narrow="false" responsiveWidth="860px">