Skip to content

Instantly share code, notes, and snippets.

View shouse's full-sized avatar

Steven shouse

  • SIVCI
  • Kansas City, MO
View GitHub Profile
if(OS_ANDROID)
var gcm = require('net.iamyellow.gcmjs');
/**
* @class PushNotifications
* @singleton
*
* Functions handling Push Notifications on both iOS and Android
*/
var PN = {
/**
* TimeLogger
* Enhanced logger, with information about the current timestamp and the time passed before the previous event.
*
* @author Davide Cassenti <[email protected]>
*
*/
(function() {
var loggers = [];
/**
* Salesforce module
*/
if (typeof Alloy === 'undefined') {
var Alloy = require('alloy');
}
if (typeof Backbone === 'undefined') {
var Backbone = require('alloy/backbone');
}
if (typeof _ === 'undefined') {
@shouse
shouse / tiws.js
Last active August 29, 2015 14:17
Titanium WebSocket demo. Based on https://github.com/omorandi/tiws
function websocketSetup() {
//@TODO check config.json for socket setting
uri = 'ws://localhost:8765';
tiws = require('net.iamyellow.tiws').createWS();
tiws.addEventListener('open', function () {
alert('opened')
_self.info('Websocket opened');
socketConnected = true;
var _factor;
function crop(blob, options, height) {
if (typeof options !== 'object') {
options = {
width: options,
height: height
}
}
/**
* @class Utils.Weather
* @author Steven House <[email protected]>
*
* This retrieves weather information
*/
// Include underscore awesomness
var _ = require('alloy/underscore')._;
var Alloy = require('alloy');
/**
* @class Util.map
*
* @author Steven House
* @email [email protected]
*
* Map utility functions
*/
// Include logging utility
/**
* This is a library for recording audio on Android and iOS using Titanium
*
* @Class Lib/AudioRecorder
* @author steven.m.house
*/
/**
* Start it rolling
* @method init
@shouse
shouse / Camera.js
Created March 21, 2015 05:18
Not tested yet.
/**
* This handles the camera and related functions. It handles video as well
* @class Util.VideoRecorder
* @author Steven House <[email protected]>
*
* This is the Video Recorder Library
*/
// Access Global Logging Utility
var log = Alloy.Globals.log;
/**
* Movies
*
* @copyright
* Copyright (c) 2015 by Appcelerator, Inc. All Rights Reserved.
*
* @license
* Licensed under the terms of the Apache Public License
* Please see the LICENSE included with this distribution for details.
*/