Skip to content

Instantly share code, notes, and snippets.

@lis186
lis186 / Gruntfile.js
Created June 27, 2013 08:42
Grunt script that generate view (app/views/*.xml) and style(app/styles/*.tss) from jade(app/views/.jade) in Titanium Alloy project.
module.exports = function(grunt) {
function getJadeFiles(srcdir, destdir, wildcard) {
var path = require('path');
var files = {};
grunt.file.expand({cwd: srcdir}, wildcard).forEach(function(relpath) {
files[path.join(destdir, relpath.replace('.jade','.xml'))] = path.join(srcdir, relpath);
});
return files;
@lis186
lis186 / app.js
Created November 16, 2011 02:30 — forked from dawsontoth/app.js
Rate my app in Appcelerator Titanium Mobile
/**
* The following snippet will ask the user to rate your app the second time they launch it.
* It lets the user rate it now, "Remind Me Later" or never rate the app.
*/
var win = Ti.UI.createWindow({ backgroundColor: '#fff' });
win.addEventListener('open', checkReminderToRate);
win.add(Ti.UI.createLabel({ text: 'This is a simple app that will remind you to rate it.' }));
win.open();
function checkReminderToRate() {