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
// module code | |
// assets/Resources/foogle.js | |
exports.client = { | |
test: function() { | |
var modules = ["Accelerometer","Analytics","Android","App","Contacts","Database","Facebook","Filesystem","Geolocation", | |
"Gesture","Locale","Map","Media","Network","Platform","UI","Utils","XML","Yahoo"]; | |
for (var i = 0; i < modules.length; i++) { | |
Titanium.API.info(modules[i]+ "? "+Titanium[modules[i]]); | |
} | |
} |
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
<!-- xpathFilterWithNamespace.xml from existing camel-spring test case; works fine --> | |
<beans xmlns="http://www.springframework.org/schema/beans" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xmlns:foo="http://example.com/person" | |
xsi:schemaLocation=" | |
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd | |
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd | |
"> |
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
// setting up postal and machina to work together | |
/* | |
1. Download underscore.js and the node versions of postal.js, machina.js, and machina-postal.js | |
from http://github.com/ifandelse | |
2. Change the location of underscore in the require() statements of the postal.js and machina.js | |
3. Connect machina to postal as follows: | |
*/ | |
var postal = require('lib/ifandelse/postal'), |
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
// https://jira.appcelerator.org/browse/TIMOB-3132 | |
function FORCE_LINKER() { | |
Ti.UI.createWindow(); | |
Ti.UI.createTab(); | |
Ti.UI.createTabGroup(); | |
Ti.UI.createProgressBar(); | |
Ti.UI.create2DMatrix(); | |
Ti.UI.createAnimation(); | |
Ti.UI.iOS.createToolbar(); | |
Ti.UI.iPhone.createNavigationGroup(); |
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
function ApplicationTabGroup(Window) { | |
var MusicWindow = require('ui/handheld/MusicWindow'), | |
VideosWindow = require('ui/handheld/VideosWindow'), | |
SearchWindow = require('ui/handheld/SearchWindow'); | |
//create module instance | |
var self = Ti.UI.createTabGroup(); | |
//create app tabs | |
var win1 = new MusicWindow(L('music')), |
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
{ | |
"_id": "_design/configs", | |
"_rev": "4-a0b96a31984e1267e6ecf46302744451", | |
"views": { | |
"subnet": { | |
"map": "function(doc) {\n emit(null, doc);\n};" | |
} | |
}, | |
"lists": { |
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 server = require('com.obscure.titouchdb'), | |
db = server.databaseNamed('mydb'); | |
var doc = db.untitledDocument() | |
var result = doc.putProperties({ | |
foo: 10, | |
bar: 'a string', | |
x: [1,2,3,4] | |
}); |
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 client = require('couch_client').CouchClient('http://foo.iriscouch.com'); | |
var db = client.database('mydb'); | |
db.create(); // if not already created | |
var document = { | |
x: 10, | |
y: 'some string', | |
foo: [1, 2, 3] | |
}; |
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
// semi-contrived example: adding a count() function to SQL collections which doesn't | |
// load all of the models. | |
// Alloy/lib/alloy/sync/sql.js | |
function Count() { | |
var table = model.config.adapter.collection_name; | |
var sql = 'SELECT * FROM '+table; | |
var rs = db.execute('SELECT COUNT(*) FROM '+table); | |
return rs.isValidRow() ? rs.field(0) : 0; |
OlderNewer