Skip to content

Instantly share code, notes, and snippets.

@alanwhite
alanwhite / Indigesturing.java
Last active March 4, 2024 08:19
Sample code to capture MacOS touchpad gestures
package xyz.arwhite.swing;
import java.awt.Dimension;
import java.awt.HeadlessException;
import java.awt.event.MouseEvent;
import java.awt.event.MouseWheelEvent;
import java.awt.event.MouseAdapter;
import javax.swing.JFrame;
import javax.swing.JPanel;
@alastairs
alastairs / Cambridge Software Crafters Email.md
Last active April 12, 2018 12:40
Email to the Cambridge Software Crafters re: name change and CoC

Changes to the Cambridge Software Craftsmanship Community

Hi everyone

It's not often that we email our members, so please bear with me and read this to the end.

Recent events in the wider tech community, and reactions within the Software Craftsmanship community, have prompted wider discussions about the inclusiveness of the community, and I've decided to make some small but important changes to our local chapter.

@thomasdarimont
thomasdarimont / KeycloakAdminClientExample.java
Last active April 30, 2024 22:18
Using Keycloak Admin Client to create user with roles (Realm and Client level)
package demo.plain;
import org.keycloak.OAuth2Constants;
import org.keycloak.admin.client.CreatedResponseUtil;
import org.keycloak.admin.client.Keycloak;
import org.keycloak.admin.client.KeycloakBuilder;
import org.keycloak.admin.client.resource.RealmResource;
import org.keycloak.admin.client.resource.UserResource;
import org.keycloak.admin.client.resource.UsersResource;
import org.keycloak.representations.idm.ClientRepresentation;
@msteiger
msteiger / GradientExtensionHandler.java
Created January 11, 2013 09:05
An ExtensionHandler for Apache Batik's svggen part that uses SVGGraphics2D to convert Swing drawing routines to SVG elements. Currently supports LinearGradientPaint and RadialGradientPaint. Feel free to comment and extend ..
import static org.apache.batik.util.SVGConstants.*;
import java.awt.Color;
import java.awt.LinearGradientPaint;
import java.awt.MultipleGradientPaint;
import java.awt.Paint;
import java.awt.RadialGradientPaint;
import java.awt.geom.AffineTransform;
import java.awt.geom.Point2D;