This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Subsriber and publisher pattern via https://api.jquery.com/jQuery.Callbacks/ | |
var topics = {}; | |
jQuery.Topic = function( id ) { | |
var callbacks, method, | |
topic = id && topics[ id ]; | |
if ( !topic ) { | |
callbacks = jQuery.Callbacks(); | |
topic = { | |
publish: callbacks.fire, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Setup a global scopped timer variable | |
var timer; | |
// Create a named function expression | |
var yourPromise = getBeer(); | |
// Execute this code when the promise is done | |
yourPromise.done(function(message) { | |
console.log('done. ' + message); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Chandelier workshop program (Non-interactive version) | |
// Created by Nathen Street 24 March 2012 | |
// Program choice determined by switch on circuit board | |
// Option 1: Chase | |
// Option 2: Always on | |
int lightsOne = 0; // light group 1 | |
int lightsTwo = 1; // light group 2 | |
int lightsThree = 2; // light group 3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
import java.util.Hashtable; | |
import java.util.Random; | |
import java.util.Vector; | |
public class Markov { |