This file contains 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
// create tab group | |
demo.tabMainGroup = Ti.UI.createTabGroup({isOpen:false}); | |
demo.tabLoginGroup = Ti.UI.createTabGroup({isOpen:false}); | |
demo.wLogin = Ti.UI.createWindow({ | |
id:'wLogin' | |
}); | |
demo.tbLogin = Ti.UI.createTab({window:demo.wLogin}); |
This file contains 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
// this sets the background color of the master UIView (when there are no windows/tab groups on it) | |
Titanium.UI.setBackgroundColor('#000'); | |
var tzt ={ | |
testIt: function(){ | |
alert('testIt'); | |
}, | |
isAndroid : function(){ | |
return (Ti.Platform.osname == 'android'); | |
}, |
This file contains 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
bGet.addEventListener('click', function(){ | |
var _url = "https://my.url.goes.here"; | |
var username='demo'; | |
var password='badpass'; | |
var aToken = 'Basic ' + Ti.Utils.base64encode(username + ':' + password); | |
var c = Titanium.Network.createHTTPClient(); | |
c.setTimeout(10000); | |
c.onload = function(e) | |
{ | |
Ti.API.info("ONLOAD = "+e); |
This file contains 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
// this sets the background color of the master UIView (when there are no windows/tab groups on it) | |
Ti.UI.setBackgroundColor('#000'); | |
Ti.UI.iPhone.statusBarStyle = Ti.UI.iPhone.StatusBar.OPAQUE_BLACK; | |
//Create main app namespace | |
var demo={}; | |
//Create a few helpers | |
demo.myHelpers = { | |
isAndroid : function(){ | |
return (Ti.Platform.name == 'android'); | |
}, |
This file contains 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
var xhr = Titanium.Network.createHTTPClient(); | |
xhr.onload = function() | |
{ | |
var results = this.responseText; | |
Ti.API.info('Results from xhr Lookup = ' + results ); | |
var supportDir = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory,'my_support'); | |
if(!supportDir.exists()){ | |
supportDir.createDirectory(); | |
} |
This file contains 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
/** | |
* | |
* | |
* Copyright 2011 Aaron K. Saunders, Clearly Innovative Inc | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a> |
This file contains 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
git config --global core.excludesfile ~/.gitignore | |
echo .DS_Store >> ~/.gitignore |
This file contains 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
tmp | |
android/ | |
iphone/ |
This file contains 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
//This snippet is based on the below: | |
//http://alloy.liferay.com/deploy/api/querystring-stringify-simple-debug.js.html | |
function queryStringify(obj, sep, eq) { | |
sep = sep || "&"; | |
eq = eq || "="; | |
var qs = [], key, escape = encodeURIComponent; | |
for (key in obj){ | |
if (obj.hasOwnProperty(key)) { | |
qs.push(escape(key) + eq + escape(String(obj[key]))); | |
} |
This file contains 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
select abs(lat- 40.711389)+abs(lng- -74.064722)*0.643/case | |
when max(abs(lat- 40.711389),abs(lng- -74.064722)*0.643)/(min(abs(lat- 40.711389),abs(lng- -74.064722)*0.643)+0.000001) < 1.5 then 1.41 | |
when max(abs(lat- 40.711389),abs(lng- -74.064722)*0.643)/(min(abs(lat- 40.711389),abs(lng- -74.064722)*0.643)+0.000001) < 2 then 1.34 | |
when max(abs(lat- 40.711389),abs(lng- -74.064722)*0.643)/(min(abs(lat- 40.711389),abs(lng- -74.064722)*0.643)+0.000001) < 3 then 1.29 | |
when max(abs(lat- 40.711389),abs(lng- -74.064722)*0.643)/(min(abs(lat- 40.711389),abs(lng- -74.064722)*0.643)+0.000001) < 5 then 1.18 | |
when max(abs(lat- 40.711389),abs(lng- -74.064722)*0.643)/(min(abs(lat- 40.711389),abs(lng- -74.064722)*0.643)+0.000001) < 11 then 1.08 | |
when max(abs(lat- 40.711389),abs(lng- -74.064722)*0.643)/(min(abs(lat- 40.711389),abs(lng- -74.064722)*0.643)+0.000001) < 25 then 1.04 | |
else 1 end DISTANCE, AIRPORT_NAME, |
OlderNewer