Skip to content

Instantly share code, notes, and snippets.

View UrsKR's full-sized avatar

Urs Reupke UrsKR

View GitHub Profile
@UrsKR
UrsKR / settings.gradle
Created July 8, 2013 18:36
Make Gradle treat a folder as a submodule if it contains a ``build.gradle``
//Make Gradle treat a folder as a submodule if it contains a ``build.gradle``
rootDir.eachDir { folder ->
def buildFile = new File(folder, "build.gradle")
if (buildFile.exists()){
include folder.getName()
}
}
@UrsKR
UrsKR / log1.txt
Created June 14, 2012 15:16
Gradle 1.0 logs from a build with ``gradlew clean buildZip --debug`` for Anathema 4.2.1
Downloading http://services.gradle.org/distributions/gradle-1.0-bin.zip
........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
@UrsKR
UrsKR / gist:2925516
Created June 13, 2012 17:56
Anathema's repositories section
...
subprojects {
...
repositories {
maven {
url 'https://github.com/anathema/anathema-thirdparty/raw/master/snapshots/'
}
maven {
url 'https://github.com/anathema/anathema-thirdparty/raw/master/releases/'
}
@UrsKR
UrsKR / TableDemo.java
Created June 8, 2012 13:51
JavaFX 2's TableView creates more rows than required
import com.sun.javafx.collections.ObservableListWrapper;
import javafx.application.Application;
import javafx.beans.property.SimpleIntegerProperty;
import javafx.scene.Scene;
import javafx.scene.control.TableCell;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableRow;
import javafx.scene.control.TableView;
import javafx.scene.layout.FlowPane;
@UrsKR
UrsKR / TableTest.java
Created May 15, 2012 10:55
Suppress reordering of table columns in JavaFX2
import javafx.application.Application;
import javafx.collections.ListChangeListener;
import javafx.scene.Scene;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.stage.Stage;
public class TableTest extends Application {
@UrsKR
UrsKR / DesktopSupport.java
Created May 8, 2012 07:54
Opening a file with KDE-support
import org.apache.commons.io.IOUtils;
import java.awt.Desktop;
import java.io.File;
import java.io.IOException;
public class DesktopSupport {
public static void open(File file) {
try {
@UrsKR
UrsKR / TextIsInvisible.java
Created May 3, 2012 09:14
Two variants of adding a custom component to a Swing frame
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JPanel;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.font.TextLayout;
import static java.awt.Color.black;
@UrsKR
UrsKR / DeepProxyExample.java
Created March 6, 2012 15:08
A deep proxy, that returns proxies to all calls except those configured otherwise
package de.idos.operatingreserve.internal.client.interaction;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;
import org.junit.Test;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.util.List;
@UrsKR
UrsKR / table.html
Created February 15, 2012 12:28
A table, made of <divs/> and css
<html>
<head>
<style type="text/css">
.table {
display: table;
}
.header {
display: table-row;
}
@UrsKR
UrsKR / Serialization_Test.java
Created January 27, 2012 13:24
Testing Serialization
import org.junit.Test;
import java.io.*;
public class Serialization_Test {
@Test
public void isSerializable() throws Exception {
Object object = new Object();
assertIsSerializable(object);