Skip to content

Instantly share code, notes, and snippets.

View patrickseda's full-sized avatar

Patrick Seda patrickseda

  • Software & Mobile Director
  • Atlanta, GA
View GitHub Profile
@patrickseda
patrickseda / Latch.js
Created September 6, 2012 14:54
A CommonJS module providing the ability to pause program flow until a set of asynchronous operations have completed.
/**
* Provides the ability to have a set of asynchronous operations wait after their
* respective execution until all of the operations in the group have completed.
*
* Sample usage:
* // Define some operations that will run asynchronously.
* var worker1 = function(announceComplete) {
* // Do some work here ...
* announceComplete();
* };
@patrickseda
patrickseda / app.js
Created April 4, 2012 14:21
Sample of iOS/MobileWeb NavigationGroup.
/**
* Sample app.js to demonstrate cross-platform NavigationGroup on iOS & MobileWeb.
*/
var mainWin = Ti.UI.createWindow();
var win2 = Ti.UI.createWindow({
exitOnClose : true,
backgroundColor : '#a68',
title : 'Window2',
@patrickseda
patrickseda / app.js
Created April 4, 2012 14:18
Sample of TableViewRow selection color.
/**
* Sample app.js to demonstrate TableViewRow selection color.
*/
var win = Ti.UI.createWindow();
var data = [];
for (var i = 0; i < 10; i++) {
var row = Ti.UI.createTableViewRow({
title : 'Row ' + i,
backgroundColor : '#68a',
@patrickseda
patrickseda / SampleImpl.java
Created September 7, 2011 15:37
Java ShutdownHook registration class for managing controlled shut downs.
/**
* Sample implementation of a Shutdownable object.
*/
public class SampleImpl implements Shutdownable {
public static void main(String[] args) {
SampleImpl sample = new SampleImpl();
// Make the JVM call our shutdown() method upon exit.
ShutdownHook.registerForShutdownHook(sample);