Skip to content

Instantly share code, notes, and snippets.

View andytill's full-sized avatar

Andy Till andytill

View GitHub Profile
@Target({ TYPE, METHOD }) @Retention(RUNTIME) @ScopeAnnotation
public @interface BookScoped
{
}
@BookScoped
public class Hobbit implements Hero
{
public Hobbit()
{
System.out.println("created " + toString());
}
}
public class MiddleEarthModule extends AbstractModule
{
private final EnterableScope scope;
public MiddleEarthModule()
{
scope = new EnterableScope();
}
@Override
public class Main
{
public static void main(String[] args)
{
MiddleEarthModule module;
module = new MiddleEarthModule();
Injector injector;
public interface Hero
{
}
@andytill
andytill / DragResizer.java
Last active May 14, 2024 12:52
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>
@andytill
andytill / SPL
Created March 30, 2013 21:41
South Park inspired software license v1
All specifications and documentation for
this software--even those required for
customer sign off--are entirely fictional.
All code is tested... poorly.
The following program contains leaky
abstractions and should not be reused by anyone.
2013-04-08 21:02:14,662 [ 75597] INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stdout]: Build process started. Classpath: C:/Program Files (x86)/JetBrains/IntelliJ IDEA Community Edition 12.1/lib/jna-utils.jar;C:/Program Files (x86)/JetBrains/IntelliJ IDEA Community Edition 12.1/lib/oromatcher.jar;/C:/Program Files (x86)/JetBrains/IntelliJ IDEA Community Edition 12.1/lib/jps-server.jar;C:/Program Files (x86)/JetBrains/IntelliJ IDEA Community Edition 12.1/lib/annotations.jar;/C:/Program Files (x86)/JetBrains/IntelliJ IDEA Community Edition 12.1/lib/idea_rt.jar;C:/Program Files (x86)/JetBrains/IntelliJ IDEA Community Edition 12.1/lib/jna.jar;C:/Program Files (x86)/JetBrains/IntelliJ IDEA Community Edition 12.1/lib/picocontainer.jar;C:/Program Files (x86)/JetBrains/IntelliJ IDEA Community Edition 12.1/lib/resources_en.jar;/C:/Program Files (x86)/JetBrains/IntelliJ IDEA Community Edition 12.1/lib/protobuf-2.4.1.jar;/C:/Program Files (x86)/JetBrains/IntelliJ IDEA Community Edition 12.1/lib/idea.jar;/
int_to_pairs(IntList) ->
[{N, integer_to_list(N)} || N <- IntList].
@andytill
andytill / Erlang Dev Environment.md
Last active December 20, 2015 07:39
Erlang Dev Environment

Erlang Dev Environment

This tutorial is aimed at a Windows user looking to start with erlang, it will help you set up an effective development environment, without proper tooling erlang seems underpowered. After all you wouldn't write java code in notepad.

Install Ubuntu on VirtualBox

Save yourself some time early on and just use linux for erlang development. Erlang does work on windows but most testing of the SDK, open source libraries and tools gets done on linux so things just seem to go more smoothly in this environment.

Download VirtualBox and a supported version of Ubuntu. Install VirtualBox and create a new virtual machine using the Ubuntu ISO.