Skip to content

Instantly share code, notes, and snippets.

View pegli's full-sized avatar

Paul Mietz Egli pegli

View GitHub Profile
@pegli
pegli / gist:2996514
Created June 26, 2012 15:39
postal.js and machina.js in Titanium
// 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'),
@pegli
pegli / NavigationController_Ex1.js
Created October 31, 2011 16:08
NavigationController with added pop() and close_all() methods
/**
* https://github.com/appcelerator-developer-relations/Forging-Titanium/tree/master/ep-002
* written by Kevin Whinnery, Appcelerator
*/
function dump(windowStack) {
var titles = [];
for (var i=0; i < windowStack.length; i++) {
var win = windowStack[i]
titles.push(win.title);
@pegli
pegli / gist:996326
Created May 27, 2011 22:31
XPath namespace declaration and routeContext
<!-- 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
">
@pegli
pegli / gist:969694
Created May 12, 2011 23:46
missing top-level objects on Android
// 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]]);
}
}