Skip to content

Instantly share code, notes, and snippets.

View HanSolo's full-sized avatar

Gerrit Grunwald HanSolo

View GitHub Profile
@miho
miho / Main.java
Created March 23, 2014 17:00
Stream DSL like API
package eu.mihosoft.tutorials.streams;
import java.util.Arrays;
import java.util.List;
import static eu.mihosoft.tutorials.streams.Item.*;
import java.util.Objects;
import java.util.function.Predicate;
public class Main {
@stonehippo
stonehippo / Arduino_PN532_NTAG203_dumper.ino
Last active April 2, 2021 02:29
Reading out the contents of an NTAG203 NFC tag using an Adafruit PN532 shield for Arduino. This sketch reads and prints to the serial console all 42 pages of memory on the tag.
/*
Dump the memory on a NTAG203 NFC tag using the Adafruit PN532 RFID/NFC Shield
http://www.adafruit.com/products/789
This sketch requires the installation of the Adafruit I2C library for the shield,
which can be found at https://github.com/adafruit/Adafruit_NFCShield_I2C
The datasheet and other info for the NTAG203 can be found at
http://www.nxp.com/products/identification_and_security/smart_label_and_tag_ics/ntag/series/NTAG203.html
package com.dooapp.FXBinding.model;
import com.dooapp.FXBinding.FXDoubleBinding;
import javafx.beans.binding.DoubleBinding;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.scene.chart.XYChart;
/**
* A simple demo class
@shemnon
shemnon / gist:5552255
Last active December 17, 2015 04:39
SwingNode: A JTable in a JavaFX Stage
import javafx.animation.Interpolator;
import javafx.animation.KeyFrame;
import javafx.animation.KeyValue;
import javafx.animation.TimelineBuilder;
import javafx.application.Application;
import javafx.embed.swing.*;
import javafx.geometry.Pos;
import javafx.scene.Node;
import javafx.scene.Scene;
import javafx.scene.control.Button;
@andytill
andytill / DragResizer.java
Last active September 22, 2021 08:42
DragResizercan be used to add mouse listeners to a Region and make it resizable by the user by clicking and dragging the border in the same way as a window. Only height resizing is currently implemented.
import javafx.event.EventHandler;
import javafx.scene.Cursor;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.Region;
/**
* {@link DragResizer} can be used to add mouse listeners to a {@link Region}
* and make it resizable by the user by clicking and dragging the border in the
* same way as a window.
* <p>
@miho
miho / DraggableNode02.java
Created October 3, 2012 20:00
Draggable Node 02 (make JavaFX nodes draggable)
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Cursor;
import javafx.scene.Node;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.input.MouseEvent;
import javafx.scene.input.ScrollEvent;
import javafx.scene.layout.Pane;
@shemnon
shemnon / StyleableProperty1.java
Created September 13, 2012 03:49
JavaFX CSS Styling Plumbing
public final void setBackScale(double value) {
backScaleProperty().set(value);
}
public final double getBackScale() {
return backScale == null ? 0.7 : backScale.get();
}
public final DoubleProperty backScaleProperty() {
if (backScale == null) {
backScale = new StyleableDoubleProperty(0.7) {
@iros
iros / API.md
Created August 22, 2012 14:42
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

@jamesthompson
jamesthompson / JavaFXImageConversion.java
Created August 13, 2012 21:03
JavaFX Image from a byte array
import javafx.scene.image.Image;
import javax.imageio.ImageIO;
import java.awt.image.*;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
public Image getJavaFXImage(byte[] rawPixels, int width, int height) {
ByteArrayOutputStream out = new ByteArrayOutputStream();
try {
ImageIO.write((RenderedImage) createBufferedImage(rawPixels, width, height), "png", out);
@kevinsdooapp
kevinsdooapp / LogarithmicAxis.java
Created August 1, 2012 12:55
setRange animation required properties
/**
* The time of animation in ms
*/
private static final double ANIMATION_TIME = 2000;
private final Timeline lowerRangeTimeline = new Timeline();
private final Timeline upperRangeTimeline = new Timeline();