Skip to content

Instantly share code, notes, and snippets.

@skypanther
skypanther / logger.js
Created January 21, 2012 00:23 — forked from pec1985/app.js
console.log - appcelerator
/*
Custom logger
// usage
var console = require('/logger');
console.log({sdf:"df"}, [1,3,5,6], "sdfsdf");
*/
exports.log = function() {
if(Ti.App.Properties.getBool('production')==false) {
@skypanther
skypanther / app.js
Created December 2, 2011 19:49
Titanium Mobile helper module for determining whether you're on a tablet or phone
// this sets the background color of the master UIView (when there are no windows/tab groups on it)
Titanium.UI.setBackgroundColor('#000');
// create tab group
var tabGroup = Titanium.UI.createTabGroup();
//
// create base UI tab and root window
//
function createNotification() {
var mainIntent = Titanium.Android.createIntent({
className: 'org.appcelerator.titanium.TiActivity',
packageName: 'com.appcelerator.foo'
});
var pending = Titanium.Android.createPendingIntent({
activity: Titanium.Android.currentActivity,
intent: mainIntent,
@skypanther
skypanther / app.js
Created September 1, 2011 21:48
Draw gridlines in a Titanium window
// implement like this:
var window = Ti.UI.createWindow({
backgroundColor:'#fff'
});
// draw the gridlines first so your other elements stack on top of them
// without requiring you to set the z-index property of each
var grid = require('gridlines');
grid.drawgrid(10,window);