Skip to content

Instantly share code, notes, and snippets.

View bob-sims's full-sized avatar

Bob Sims bob-sims

View GitHub Profile
@rubenfonseca
rubenfonseca / backbone.sync.js
Created April 10, 2012 19:08
Backbone + Titanium - part 2
//Customise Backbone.sync to work with Titanium rather than jQuery
var getUrl = function(object) {
if (!(object && object.url)) return null;
return _.isFunction(object.url) ? object.url() : object.url;
};
Backbone.sync = (function() {
var methodMap = {
'create': 'POST',
'read' : 'GET',
@tzmartin
tzmartin / Titanium-Android.txt
Created March 24, 2012 04:39
Titanium Android Modules
Titanium Android Modules
--------------------------------------
- https://github.com/dbankier/TiKeyguard-Android
Appcelerator/Titanium module to unlock and power on an Android device.
- https://github.com/dbankier/TiSIPClient-Android
SIP/VoIP for Appcelerator's Titanium (Android)
- https://github.com/3ign0n/TiOpenStreetMap
@benbahrenburg
benbahrenburg / GeolocationModule.mm
Created March 11, 2012 01:41 — forked from stevenou/GeolocationModule.mm
Geofencing in Titanium
// this file located in /Library/Application Support/Titanium/mobilesdk/osx/{version_number}
// add the following methods to GeolocationModule.mm
- (void)locationManager:(CLLocationManager *)manager didEnterRegion:(CLRegion *)region
{
NSDictionary *event = [NSDictionary dictionaryWithObjectsAndKeys:NUMBOOL(YES),@"success",[NSDictionary dictionaryWithObjectsAndKeys:NUMDOUBLE(region.center.latitude),@"lat",NUMDOUBLE(region.center.longitude),@"lng",NUMDOUBLE(region.radius),@"radius",region.identifier,@"identifier",nil],@"region",nil];
if ([self _hasListeners:@"enteredRegion"])
{
[self fireEvent:@"enteredRegion" withObject:event];
@psyked
psyked / RateMe.js
Created March 7, 2012 10:08 — forked from dawsontoth/app.js
"Rate my app in Appcelerator Titanium Mobile" as a commonJS module.
function RateMe(ios_url, goog_url, usecount) {
if(!Ti.App.Properties.hasProperty('RemindToRate')) {
Ti.App.Properties.setString('RemindToRate', 0);
}
var remindCountAsInt = parseInt(Ti.App.Properties.getString('RemindToRate'), 10);
var newRemindCount = remindCountAsInt += 1;
if(remindCountAsInt === -1) {
// the user has either rated the app already, or has opted to never be
// reminded again.
@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) {
<?xml version="1.0" encoding="utf-8"?>
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
@aaronksaunders
aaronksaunders / user.js
Created January 5, 2012 14:24
Appcelerator Stackmob Integrating Facebook as your Authentication Method - Login User - data
{
"username": "TEST-FACEBOOK-USER",
"fb": {
"id": "100001720461935",
"timezone": -5,
"username": "ClearlyInnovative",
"locale": "en_US",
"link": "http://www.facebook.com/ClearlyInnovative",
"email": "[email protected]",
"verified": true,
@aaronksaunders
aaronksaunders / app.js
Created January 4, 2012 00:11
Cocoafish + Appcelerator iOS Module Example Code - Login with Twitter, Create Account From Twitter
//
// blog.clearlyinnovative.com
// Aaron K. Saunders
// Clearly Innovative Inc
//
// @see https://github.com/aaronksaunders/Appcelerator-Cocoafish-Native-Module
//
var cocoafishMgr = require('com.ci.cocoafish');
Ti.API.info("module is => " + cocoafishMgr);
@pec1985
pec1985 / app.js
Created December 30, 2011 18:49
FaceBook slide in views
// Create a new project and copy this code into app.js
// if you use this code, please give me credit :)
function JustAView(text){
var view = Ti.UI.createView({
backgroundColor:"#"+((1<<24)*Math.random()|0).toString(16),
width:200,
height:100
});
var label = Ti.UI.createLabel({
@aaronksaunders
aaronksaunders / app.js
Created December 21, 2011 04:37
posting data with attachment to couchdb using iriscouch and appcelerator
//
// blog.clearlyinnovative.com
// Aaron K. Saunders
// Clearly Innovative Inc
//
var database_url = "http://greenlyyt.iriscouch.com/movie_store/";
var user_name, password;
/** ----------------------------------------------------------------------------