Skip to content

Instantly share code, notes, and snippets.

@tbroyer
tbroyer / apt-idea.gradle
Last active October 30, 2018 17:09
Goodbye `net.ltgt.apt-idea` 👋
// Put this file in ~/.gradle/init.d/
//
// It will automatically configure Java projects (not Groovy) with for use in IntelliJ IDEA,
// by declaring options.annotationProcessorGeneratedSourcesDirectory as generated sources
// (assumes "Delegate IDE build/run actions to gradle" and "Create separate module per source set";
// only works for 'main' and 'test' source sets).
// The options.annotationProcessorGeneratedSourcesDirectory still needs to be configured in builds
// (see https://github.com/gradle/gradle/issues/4956). This script is thus mainly a workaround for
// the IDEA issue https://youtrack.jetbrains.com/issue/IDEA-182577
//

Keybase proof

I hereby claim:

  • I am tbroyer on github.
  • I am tbroyer (https://keybase.io/tbroyer) on keybase.
  • I have a public key ASBs8rj4D1r7cfdXaQ4M0kqXBuGYnBCTXLlelR_9nvxoNQo

To claim this, I am signing this object:

@tbroyer
tbroyer / OkHttpClientEngine.java
Last active May 31, 2022 07:19
Use OkHttp as JAX-RS Client implementation with RESTEasy
/*
* Copyright 2015 Thomas Broyer
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@tbroyer
tbroyer / README.md
Last active May 25, 2016 13:46
Error-prone in Gradle

UPDATE: This is now available as a plugin https://github.com/tbroyer/gradle-errorprone-plugin

To use it, just add the following to your build.gradle and it'll change all JavaCompile tasks to use the error-prone compiler:

apply from: 'https://gist.github.com/tbroyer/6847494/raw/errorprone.gradle'
@tbroyer
tbroyer / SecurityServiceLayer.java
Last active December 20, 2015 07:09
ServiceLayerDecorator for RequestFactory that enforces javax.annotation.security annotations on service methods.
/*
* Copyright 2013 Thomas Broyer <t.broyer@ltgt.net>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@tbroyer
tbroyer / fix_guake_primary_monitor.sh
Created November 26, 2012 10:44
Fix Guake to open on primary monitor
#!/bin/sh
sudo sed -i s/get_monitor_geometry\(0\)/get_monitor_geometry\(screen.get_primary_monitor\(\)\)/ /usr/bin/guake
@tbroyer
tbroyer / ActivityAsyncProxy.java
Created July 3, 2012 10:07
ActivityAsyncProxy
/*
* Copyright 2012 Thomas Broyer <t.broyer@ltgt.net>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@tbroyer
tbroyer / Html5Historian.java
Created February 22, 2012 10:07
GWT PlaceHistoryHandler.Historian using HTML5 pushState and onpopstate
/*
* Copyright 2012 Thomas Broyer <t.broyer@ltgt.net>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@tbroyer
tbroyer / git-svn-diff.sh
Created January 25, 2011 16:58 — forked from mojodna/git-svn-diff.sh
git-svn-diff.sh
#!/bin/bash
#
# git-svn-diff originally by (http://mojodna.net/2009/02/24/my-work-git-workflow.html)
# modified by mike@mikepearce.net
# modified by aconway@[redacted] - handle diffs that introduce new files
# modified by t.broyer@ltgt.net - fixes diffs that introduce new files
#
# Generate an SVN-compatible diff against the tip of the tracking branch
# Get the tracking branch (if we're on a branch)
@tbroyer
tbroyer / Address.java
Created January 15, 2011 00:29
Before/after GWT 2.1 Editors
package net.ltgt.gwt.samples.editors.shared;
public class Address {
private String street;
private String city;
private String zip;
private String state;
public String getStreet() { return this.street; }