Skip to content

Instantly share code, notes, and snippets.

View iantearle's full-sized avatar
💭
I may be slow to respond.

Ian Tearle iantearle

💭
I may be slow to respond.
View GitHub Profile
@FokkeZB
FokkeZB / README.md
Created April 19, 2013 08:59
Setting default unit of measurement.

To make sure your lay-outs look pretty much the same on all devices, including the thousands of different Android resolutions and densities, it's always best to use the 'dp' unit. However, typing '10dp' instead of 10 is quite a pain. A pain you can easily take away by changing the default unit in your tiapp.xml.

@FokkeZB
FokkeZB / SHARING.md
Last active December 16, 2015 15:49
Sharing lib for Titanium
@FokkeZB
FokkeZB / RATING.md
Last active December 16, 2015 16:49
Rate-my-app CommonJS module for Titanium
@FokkeZB
FokkeZB / VALIDATE.md
Last active December 16, 2015 22:39
Validation lib for Titanium
@Rogichi
Rogichi / app.js
Last active December 19, 2015 05:29
Tweet Example (Using VIEZEL Codebird for Appcelerator Titanium. Twitter API 1.1 https://gist.github.com/viezel/5781083 ):
// How Publish a Tweet (Titanium)
// Full Codebird API is here: https://github.com/mynetx/codebird-js
// Codebird for Appcelerator Titanium. Using the Twitter API 1.1: https://gist.github.com/viezel/5781083
//THANKS VIEZEL
@gcoop
gcoop / cachedImageView.js
Created May 18, 2011 13:26
Appcelerator Titanium ImageView /w cache and cacheage. Supports retina display.
cachedImageView = function(basedir, uri, obj, attr, cacheage) {
/**
Appcelerator Titanium ImageView /w cache
This function attempts to cache a remote image and then returns it again
when it's requested.
The file is stored in a directory "basedir," this is to try and help
you keep files unique. It's not special or magical, but not dirty either.
@tonylukasavage
tonylukasavage / compare.js
Created May 10, 2013 16:17
Deep (but slow) comparison of JSON-serializable JS objects
// I'm using this now in my Alloy runtime testing to assert that the
// proper styles are getting assigned to Titanium proxy objects. The
// deep comparison is necessary for objects like font in the style. So
// for my purposes the accuracy of the results far supercedes the lack
// of blazing performance with this code. I'm using underscore.js as
// it's part of Alloy, but isX() calls could easily be filled out in
// a couple lines of JS.
//
// Obviously due to the use of JSON.stringify() the objects to be
// compared need to be JSON serializable.
@FokkeZB
FokkeZB / ALERT.md
Created May 3, 2013 11:06
Replacement for Titanium's alert()

I guess just like me you like to do alert('My message'); instead of:

Ti.UI.createAlertDialog({
        message: 'My message'
}).show();

But I'd even more like to do alert('My message', 'My title', myCallback); instead of:

@kwhinnery
kwhinnery / howto.md
Created May 13, 2013 00:42
Execute "tishadow run" in your Titanium app directory whenever a JavaScript file changes.

Automatic TiShadow Installs

Execute "tishadow run" in your Titanium app directory whenever a JavaScript file changes. Edit your JS files in a text editor, save, then switch to the test device or simulator. Profit.

Install supervisor

[sudo] npm install -g supervisor

Execute tishadow run anytime a JavaScript file changes