Skip to content

Instantly share code, notes, and snippets.

View shouse's full-sized avatar

Steven shouse

  • SIVCI
  • Kansas City, MO
View GitHub Profile
/**
* @class Utils.Weather
* @author Steven House <[email protected]>
*
* This retrieves weather information
*/
// Include underscore awesomness
var _ = require('alloy/underscore')._;
var Alloy = require('alloy');
var _factor;
function crop(blob, options, height) {
if (typeof options !== 'object') {
options = {
width: options,
height: height
}
}
@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;
/**
* Salesforce module
*/
if (typeof Alloy === 'undefined') {
var Alloy = require('alloy');
}
if (typeof Backbone === 'undefined') {
var Backbone = require('alloy/backbone');
}
if (typeof _ === 'undefined') {
/**
* 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 = [];
if(OS_ANDROID)
var gcm = require('net.iamyellow.gcmjs');
/**
* @class PushNotifications
* @singleton
*
* Functions handling Push Notifications on both iOS and Android
*/
var PN = {
/**
* ACS Cloud Push module, comes with Ti SDK
* @exports Cloud
* @type {object}
*/
var Cloud = require('ti.cloud'),
CloudPush;
/**
* CommonJS Module of reusable config values and helper methods.
* @exports Config
@shouse
shouse / Gruntfile.js
Last active August 29, 2015 14:19 — forked from FokkeZB/Gruntfile.js
module.exports = function(grunt) {
grunt.initConfig({
settings: {
releaseNotes: grunt.option('notes') || 'CI build',
appName: 'Flashlight',
ppUuid: '0253600x-ac6d-35b6-b66d-dd25c4fd956f',
installrAppToken: '6xC0I8SdJA76kW3pqq7GFZLIyq6fBP4Z'
},
[sudo] npm install -g gittio
var photoDir = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, "photos");
if(!photoDir.exists()) {
photoDir.createDirectory();
}
function takePhoto(e) {
// https://github.com/appcelerator-modules/ti.imagefactory
var ImageFactory = require('ti.imagefactory');
Ti.Media.showCamera({