Skip to content

Instantly share code, notes, and snippets.

@meeech
meeech / gist:864285
Created March 10, 2011 15:38
used for google maps api- rough
//Requires
//jquery and
//<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
(function() {
// Being Closure
var map = false;
geocoder = false;
currentMarker = false;
dragEndListener = false;
@meeech
meeech / gist:1413770
Created December 1, 2011 04:54
Titanium Desktop 1.2.0RC6 + Lion - Process Warnings
//Using 1.2.0RC6e / Lion
var test= Titanium.Process.createProcess({
args: ['ls', '/Users'],
env: {'PATH': '/bin'}
});
test.setOnReadLine(function(data){
console.log('Test2: '+data.toString());
});
test.launch();
function writeBase64Asset($path, $data) {
return file_put_contents($path, base64_decode($data));
}
@meeech
meeech / app.js
Created February 7, 2012 17:17 — forked from pec1985/app.js
SmartLabel
var UI = {};
var W = {};
var V = {};
var AUTODETECT_NONE = Ti.UI.iOS.AUTODETECT_NONE;
var AUTODETECT_ALL = Ti.UI.iOS.AUTODETECT_ALL;
var AUTODETECT_PHONE = Ti.UI.iOS.AUTODETECT_PHONE;
var AUTODETECT_LINK = Ti.UI.iOS.AUTODETECT_LINK;
var AUTODETECT_ADDRESS = Ti.UI.iOS.AUTODETECT_ADDRESS;
var AUTODETECT_CALENDAR = Ti.UI.iOS.AUTODETECT_CALENDAR;
@meeech
meeech / gist:1760995
Created February 7, 2012 17:56
[ERROR] Adding an event listener to a proxy that isn't already in the context
// this sets the background color of the master UIView (when there are no windows/tab groups on it)
Titanium.UI.setBackgroundColor('#ccc');
var win = Ti.UI.createWindow({
modal: false
});
var cView = Ti.UI.createScrollView({
layout:'horizontal',
height: 35,
@meeech
meeech / gist:1895665
Created February 23, 2012 23:22
table flicker
// create table view data object
var win = Ti.UI.createWindow({
backgroundColor: "#ccc"
});
var data = [];
function addRow(text, detailtext){
var textContainer = Ti.UI.createView({
@meeech
meeech / gist:2031838
Created March 13, 2012 21:37
YUI Profiler code tweaked to run in titanium
/*
Profiler - Code base from YUI 3.4.1 (build 4118)
Brought required pieces into one file, to run in context of Titanium
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
(function(){
//Begin Closure
-(void)setScrollsToTop_:(id)value
{
[[self tableView] setScrollsToTop:[TiUtils boolValue:value]];
}
var props = data.properties || {};
var obj = Ti.UI.createWindow(props);
@meeech
meeech / gist:2705664
Created May 15, 2012 22:37
Longpress example for Titanium toolbar
var win = Ti.UI.createWindow({
backgroundColor: "#ccc",
fullscreen: true,
modal: true
});
//Create the button. We use backgroundImage so that we get
//the standard effect where the button get grey when tapped
var button = Titanium.UI.createButton({
width: 40,