Skip to content

Instantly share code, notes, and snippets.

View ffgiraldez's full-sized avatar

Fernando Franco Gíraldez ffgiraldez

View GitHub Profile
@ffgiraldez
ffgiraldez / JavaFXTrayIconSample.java
Created March 2, 2020 15:49 — forked from jewelsea/JavaFXTrayIconSample.java
Demonstrate using the System Tray (AWT) to control a JavaFX application.
import javafx.application.*;
import javafx.geometry.Pos;
import javafx.scene.*;
import javafx.scene.control.Label;
import javafx.scene.layout.*;
import javafx.scene.paint.Color;
import javafx.stage.*;
import javax.imageio.ImageIO;
import java.io.IOException;
@ffgiraldez
ffgiraldez / VolatileLiveData.kt
Created April 24, 2019 12:59 — forked from d4vidi/VolatileLiveData.kt
A MutableLiveData variant that introduces a volatile behavior
package com.und0.vocabularymate.x.utils
import androidx.annotation.MainThread
import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.Observer
import java.util.concurrent.atomic.AtomicInteger
/**
* A [MutableLiveData] variant that introduces a _volatile_ behavior. Namely, it has no "memory" of values set
@ffgiraldez
ffgiraldez / Pager.java
Created June 1, 2016 08:19 — forked from mttkay/Pager.java
A simple Rx based pager
public class Pager<I, O> {
private static final Observable FINISH_SEQUENCE = Observable.never();
private PublishSubject<Observable<I>> pages;
private Observable<I> nextPage = finish();
private Subscription subscription = Subscriptions.empty();
private final PagingFunction<I> pagingFunction;
private final Func1<I, O> pageTransformer;
buildscript {
repositories {
// rather than hit central each time with this:
// mavenCentral()
// we hit our company Nexus server ont he public group
// which includes the Central Repository
// and is local, so more performant
maven {
url "http://localhost:8081/nexus/content/groups/public"
}