Skip to content

Instantly share code, notes, and snippets.

@mucaho
mucaho / src.YOUR_CODE.scala
Created February 13, 2014 10:42
Akka Actors to be executed in Swing / JavaFX thread - based on Victor Klang's [Swing Actors](https://gist.github.com/viktorklang/2422443)
// After that we just create the GUI Actors with a Props with the correct dispatcher set:
val javaFxActor = context.actorOf(Props[JavaFxActor].withDispatcher("javafx-dispatcher"), "javaFxActor")
val swingActor = context.actorOf(Props[SwingActor].withDispatcher("swing-dispatcher"), "swingActor")
// Done! Now all messages processed by the new actor will be executed by the Swing/JavaFX Event Dispatch Thread, enjoy!
@mucaho
mucaho / ClassPrototype.js
Last active August 29, 2015 13:56
JavaScript prototype template
var Person = (function() {
// private statics
var greetHeader = "Welcome,";
var greetFooter = "! Have a nice day!";
// constructor -- define instance specific stuff
function Person(isMale, firstName, lastName) {
this.firstName = firstName;
this.lastName = lastName;