Skip to content

Instantly share code, notes, and snippets.

View momolinus's full-sized avatar

Marcus Bleil momolinus

  • Berlin
View GitHub Profile
let cfg_fnc = function(cfg = {
duration: 10,
delays: [3, 6]
}) {
return "duration: " + cfg.duration + ", delays: " + cfg.delays;
}
// prints "duration: 5, delays: undefined"
console.log(cfg_fnc({duration:5}));
import sys
# prints the path to pythons executable
print (sys.executable)
@momolinus
momolinus / FileChooserDemo.java
Last active November 13, 2017 04:47
how to use Optional if any API interface returns null indicating missing value
import java.io.File;
import java.util.Optional;
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.FlowPane;
import javafx.stage.FileChooser;
import javafx.stage.Stage;
@momolinus
momolinus / LensEffect.java
Created January 25, 2017 13:09 — forked from skrb/LensEffect.java
Lens Effect
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.effect.DisplacementMap;
import javafx.scene.effect.Effect;
import javafx.scene.effect.FloatMap;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.StackPane;
import javafx.scene.paint.Color;
@momolinus
momolinus / InverseClip.java
Created January 20, 2017 15:58 — forked from bugabinga/InverseClip.java
Demonstrates an inverse clipping technique in JavaFx.
package application;
import javafx.application.Application;
import javafx.beans.binding.Bindings;
import javafx.scene.Node;
import javafx.scene.Scene;
import javafx.scene.control.ProgressBar;
import javafx.scene.effect.InnerShadow;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
@momolinus
momolinus / UriUrlDemo.java
Created March 22, 2016 09:17
shows URI and URL syntax
import java.net.MalformedURLException;
import java.nio.file.*;
public class UriUrlDemo {
public static void main(String[] args) throws MalformedURLException {
boolean assertEnabled;
try {
assert false;
@momolinus
momolinus / SkipDoubleElements.java
Last active August 29, 2015 14:26
sample simple-framework, repeated elements
import java.util.ArrayList;
import org.simpleframework.xml.*;
import org.simpleframework.xml.core.Persister;
public class SkipDoubleElements {
static class RepeatElements {
@ElementListUnion({ @ElementList(entry = "enable", type = Boolean.class, inline = true) })
@momolinus
momolinus / EventGeneratorSource.java
Created July 18, 2013 12:40
Sample with CommentTemplate
import de.devboost.commenttemplate.CommentTemplate;
import de.devboost.commenttemplate.VariableAntiQuotation;
public class EventGeneratorSource {
public EventGeneratorSource() {
System.out.println("constructed: " + this.getClass().getSimpleName());
}
@CommentTemplate