Skip to content

Instantly share code, notes, and snippets.

@jeffatstepup
jeffatstepup / passwalletIntent.js
Created February 17, 2015 10:18
How to open pkpass files in PassWallet from Appcelerator Titanium
/**
*
* Save pkpass to PassWallet
* See http://passwallet.attidomobile.com/PassWallet%20Developer%20Guide.pdf
*
*/
function shareToPassWallet () {
var pkpassFile,
intent,
// add all items to collection
Alloy.Collections.Fugitive.reset([{
"name" : "Jeff Haynie"
}, {
"name" : "Nolan Wright"
}, {
"name" : "Don Thorp"
}, {
"name" : "Marshall Culpepper"
}, {
import bb.cascades 1.0
import bb.data 1.0 // don't forget to add "LIBS += -lbbdata" to your .pro file!
Page {
id: pgDetail
actions: [
ActionItem {
title: qsTr("Refresh")
onTriggered: {
@jeffatstepup
jeffatstepup / gist:3799012
Created September 28, 2012 10:15 — forked from benbahrenburg/gist:1515352
Titanium : How to find the Private Directory
function privateDocumentsDirectory(){
Ti.API.info('We need to open a file object to get our directory info');
var testFile = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory);
Ti.API.info('Now we remove the Documents folder reference');
var privateDir = testFile.nativePath.replace('Documents/','');
Ti.API.info('This is our base App Directory =' + privateDir);
Ti.API.info('Now we add the Private Documents Directory');
privateDir+='Library/Private%20Documents/';
Ti.API.info('Our new path is ' + privateDir);
@jeffatstepup
jeffatstepup / 00-README.txt
Created February 3, 2012 14:31 — forked from bob-sims/00-README.txt
Demo of charts display using simulated web service data. Charts are rendered in WebViews using the RGraph JS library within Titanium Mobile, which works nicely on Android.
This app uses RGraph library to build Android-compatible pie charts using Titanium Mobile.
Brief screencast to demo functionality:
http://youtu.be/itTEwQmvNfY?hd=1
This was for a work prototype/mockup, so excuse the esoteric text labels and fake activity indicator.
I borrowed heavily from prior art.
Aaron Saunder's "Titanium Appcelerator Quickie: Google Charts and Appcelerator"
@jeffatstepup
jeffatstepup / cachedImageView.js
Created January 23, 2012 12:03 — forked from gcoop/cachedImageView.js
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.