Skip to content

Instantly share code, notes, and snippets.

@cashlo
cashlo / cameraUpload.js
Created August 12, 2011 04:04
Image upload directly from camera using appcelerator for android/iPhone
Titanium.Media.showCamera({
allowEditing: true,
success: function(event) {
var image = event.media;
var pxhr = Titanium.Network.createHTTPClient();
pxhr.onerror = function() {
Ti.UI.createNotification({
message:'Upload failed, please try again.'
}).show();
}
@lucasfais
lucasfais / gist:1207002
Created September 9, 2011 18:46
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@deyvin
deyvin / upload.js
Created March 30, 2012 00:43
image upload (device to server) with Titanium Mobile
var win = Titanium.UI.currentWindow;
var ind=Titanium.UI.createProgressBar({
width:200,
height:50,
min:0,
max:1,
value:0,
style:Titanium.UI.iPhone.ProgressBarStyle.PLAIN,
top:10,
@aaronksaunders
aaronksaunders / app_snippet.js
Last active July 11, 2020 14:07
One way to do bulk updates and deletes with Appcelerator Alloy Collections
// add all items to collection
Alloy.Collections.Fugitive.reset([{
"name" : "Jeff Haynie"
}, {
"name" : "Nolan Wright"
}, {
"name" : "Don Thorp"
}, {
"name" : "Marshall Culpepper"
}, {