Skip to content

Instantly share code, notes, and snippets.

View domdorn's full-sized avatar

Dominik Dorn domdorn

View GitHub Profile
@domdorn
domdorn / ahc-default.properties
Created March 9, 2017 14:46
Workaround for issue https://github.com/playframework/playframework/issues/7056 and https://github.com/playframework/play-ws/issues/87 . Copy the ahc-default.properties file into your conf/ folder
play.shaded.ahc.org.asynchttpclient.threadPoolName=AsyncHttpClient
play.shaded.ahc.org.asynchttpclient.maxConnections=-1
play.shaded.ahc.org.asynchttpclient.maxConnectionsPerHost=-1
play.shaded.ahc.org.asynchttpclient.connectTimeout=5000
play.shaded.ahc.org.asynchttpclient.pooledConnectionIdleTimeout=60000
play.shaded.ahc.org.asynchttpclient.connectionPoolCleanerPeriod=1000
play.shaded.ahc.org.asynchttpclient.readTimeout=60000
play.shaded.ahc.org.asynchttpclient.requestTimeout=60000
play.shaded.ahc.org.asynchttpclient.connectionTtl=-1
play.shaded.ahc.org.asynchttpclient.followRedirect=false
{
"ignition": { "version": "2.0.0" },
"storage": {
"disks": [
{
"device": "/dev/sda",
"wipeTable": false,
"partitions": [{
"label": "raid.1.1",
"number": 10,
@domdorn
domdorn / playframework
Created October 15, 2011 15:57
Upstart Script for the PlayFramework 1.x
# Upstart script for a play application that binds to an unprivileged user.
# put this into a file like /etc/init/playframework
# you can then start/stop it using either initctl or start/stop/restart
# e.g.
# start playframework
# http://dominikdorn.com
description "Description of your app"
author "Dominik Dorn <dominik@studyguru.eu>"
version "1.0"
@domdorn
domdorn / pom.xml
Created September 8, 2013 17:47
JRebel + Embedded Glassfish 4 Maven Plugin
<?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>com.dominikdorn.vaadin7ee</groupId>
<artifactId>javaee7demo</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
<name>javaee7demo</name>
@domdorn
domdorn / ClassloaderFixVaadinServlet.java
Created September 8, 2013 17:18
RAD with Vaadin7 and Embedded-Glassfish v4
package com.dominikdorn.vaadin7ee.demo.example_one;
import com.vaadin.server.VaadinServlet;
/**
* Subclass of the VaadinServlet to fix issues with the Classloader
* not finding our UIs and Themes.
*
* @author Dominik Dorn <dominik -at- dominikdorn -dot- com>
* http://dominikdorn.com/
@domdorn
domdorn / CollectionHelper.java
Created January 9, 2013 12:00
Splits a Collection into a List of Collections with a given size for each generated collection.
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
public class CollectionHelper {
public static <T, U extends Collection<T>> List<U> splitCollectionBySize(final U collection, final int sizePerList) {
@domdorn
domdorn / jpa1_orm.xml
Created July 14, 2012 15:24
orm.xml and persistence.xml file templates
<?xml version="1.0" ?>
<entity-mappings
xmlns="http://java.sun.com/xml/ns/persistence/orm"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm
http://java.sun.com/xml/ns/persistence/orm_1_0.xsd"
version="1.0">
</entity-mappings>
#! runhugs
-- Testfaelle fuer Aufgabe 9 der LVA 185.161 Funktionale Programmierung im WS09/10
-- an der Technischen Universitaet Wien
-- Aufgabenstellung: http://www.complang.tuwien.ac.at/knoop/fp185161_ws0910.html
-- Module ----------------------------------------------------------------------
module Main where
@domdorn
domdorn / fp_lu08_testfaelle_ws0910.hs
Created December 12, 2009 17:54
Testfaelle fuer Aufgabe 8 der LVA 185.161 Funktionale Programmierung im WS09/10 an der Technischen Universitaet Wien Aufgabenstellung: http://www.complang.tuwien.ac.at/knoop/fp185161_ws0910.html
#! runhugs
-- Testfaelle fuer Aufgabe 8 der LVA 185.161 Funktionale Programmierung im WS09/10
-- an der Technischen Universitaet Wien
-- Aufgabenstellung: http://www.complang.tuwien.ac.at/knoop/fp185161_ws0910.html
-- Module ----------------------------------------------------------------------
module Main where
@domdorn
domdorn / pgsqljndi.php
Created December 11, 2009 02:05
PEAR:DB PostgreSQL JNDI Driver
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* The PEAR DB driver for PHP's pgsql extension
* for interacting with PostgreSQL databases
*
* PHP versions 4 and 5
*