Skip to content

Instantly share code, notes, and snippets.

View cdtinney's full-sized avatar

Colin Tinney cdtinney

View GitHub Profile
@SunboX
SunboX / inlineworker.js
Created June 24, 2013 12:21
Create web workers without a separate worker JS files. Source: http://jsbin.com/owogib/8/
View inlineworker.js
function worker() {
setInterval(function() {
postMessage({foo: "bar"});
}, 1000);
}
var code = worker.toString();
code = code.substring(code.indexOf("{")+1, code.lastIndexOf("}"));
var blob = new Blob([code], {type: "application/javascript"});
@jewelsea
jewelsea / ModalConfirmExample.java
Created February 22, 2012 21:47
JavaFX Modal Confirm Dialog Box Example
View ModalConfirmExample.java
import javafx.application.Application;
import javafx.beans.value.*;
import javafx.concurrent.Worker;
import javafx.event.*;
import javafx.scene.*;
import javafx.scene.control.*;
import javafx.scene.effect.BoxBlur;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.*;
import javafx.scene.paint.Color;
@cjcliffe
cjcliffe / keyboard_code_enums.js
Created September 1, 2011 01:21
Javascript Keycode Enums
View keyboard_code_enums.js
var enums = {};
enums.keyboard = {
BACKSPACE: 8,
TAB: 9,
ENTER: 13,
SHIFT: 16,
CTRL: 17,
ALT: 18,
PAUSE: 19,
CAPS_LOCK: 20,