Skip to content

Instantly share code, notes, and snippets.

@joeltoby
joeltoby / GenericSelector.java
Last active October 21, 2019 15:26
Generic method for a user to select one or more options from a list of objets
/**
* Presents the user with a list of items of a given type {@code T} and prompts them to select
* one or more. Optionally, once selection is complete, the user is presented with a summary of their
* selection for their confirmation.<p>
*
* <b>Sample usage (Lambda):</b>
* <pre>
* List&lt;Org&gt; orgs = new ArrayList<>();
* orgs.add(org255);
* orgs.add(org256);
package org.codefx.lab.stream;
import java.util.Collection;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BinaryOperator;
import java.util.function.Supplier;
/**
* Finds a certain customer in a collection of customers.
@mraible
mraible / DateTimeXmlAdapter.java
Last active October 15, 2019 12:56
bindings.jxb to handle dates and namepace-prefix for NCPDP schemas
package com.company.app.utils;
import org.joda.time.DateTime;
import org.joda.time.format.DateTimeFormatter;
import org.joda.time.format.ISODateTimeFormat;
import javax.xml.bind.annotation.adapters.XmlAdapter;
public class DateTimeXmlAdapter extends XmlAdapter<String, DateTime> {
private static final DateTimeFormatter formatter = ISODateTimeFormat.dateTimeNoMillis().withZoneUTC();
@mutewinter
mutewinter / commit_format_examples.txt
Created March 19, 2014 18:52
Examples of my commit format.
chore: add Oyster build script
docs: explain hat wobble
feat: add beta sequence
fix: remove broken confirmation message
refactor: share logic between 4d3d3d3 and flarhgunnstow
style: convert tabs to spaces
test: ensure Tayne retains clothing
@maksimov
maksimov / lifecycle-mapping-metadata.xml
Last active February 24, 2023 15:17
Ignore unsupported M2E goals
<?xml version="1.0" encoding="UTF-8"?>
<lifecycleMappingMetadata>
<lifecycleMappings>
<lifecycleMapping>
<packagingType>maven-plugin</packagingType>
<lifecycleMappingId>org.eclipse.m2e.jdt.JarLifecycleMapping</lifecycleMappingId>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.apache.maven.plugins</groupId>
@jareware
jareware / SCSS.md
Last active May 19, 2024 14:03
Advanced SCSS, or, 16 cool things you may not have known your stylesheets could do

⇐ back to the gist-blog at jrw.fi

Advanced SCSS

Or, 16 cool things you may not have known your stylesheets could do. I'd rather have kept it to a nice round number like 10, but they just kept coming. Sorry.

I've been using SCSS/SASS for most of my styling work since 2009, and I'm a huge fan of Compass (by the great @chriseppstein). It really helped many of us through the darkest cross-browser crap. Even though browsers are increasingly playing nice with CSS, another problem has become very topical: managing the complexity in stylesheets as our in-browser apps get larger and larger. SCSS is an indispensable tool for dealing with this.

This isn't an introduction to the language by a long shot; many things probably won't make sense unless you have some SCSS under your belt already. That said, if you're not yet comfy with the basics, check out the aweso

@hezamu
hezamu / CanvastestUI.java
Last active December 22, 2016 11:50
Demonstrate how to use the various features with the Vaadin 7 version of the Canvas add-on.
import org.vaadin.hezamu.canvas.Canvas;
import org.vaadin.hezamu.canvas.Canvas.CanvasImageLoadListener;
import com.vaadin.server.VaadinRequest;
import com.vaadin.shared.MouseEventDetails;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.UI;