#Leaks ###Setup Standard Ti environment
- OSX
- Node
- Ti SDK
- alloy/titanium from NPM
- Xcode/Instruments
Run instruments from Xcode, choose 'Allocations', your device, and the application to test.
var Transloadit = module.exports = {}; | |
var TRANSLOADIT_API = 'http://api2.transloadit.com/assemblies'; | |
var PING_TIMEOUT = 3000; | |
/* | |
* @method upload | |
* requires Object options with the following parameters | |
* key - your transloadit API key | |
* notify_url - notification URL (optional) | |
* template - template ID | |
* fields - form fields to use with your template |
#Leaks ###Setup Standard Ti environment
Run instruments from Xcode, choose 'Allocations', your device, and the application to test.
var express = require('express'); | |
var mongoose = require('mongoose'); | |
// connect to local db | |
mongoose.connect('mongodb://127.0.0.1:27017/swag', function(error) { | |
if (error) { | |
throw new Error(error); | |
} | |
}); | |
// Mongoose Schema definition |
This is one approach to create a square progress indicator with Titanium views. In it, we draw a background view with a border, and use 5 view sections to indicate progress.
I'm including a <Slider>
to test progress on the device.
XML
<View id="container">
<View class="off-border"></View>
<View id="view1" class="part"></View>
<View id="view2" class="part"></View>
//load tiapp.xml in grunt config | |
grunt.initConfig({ | |
// This line makes your node configurations available for use | |
pkg: grunt.file.readJSON('package.json'), | |
tiapp: require('tiapp.xml').load('./tiapp.xml'), | |
//... | |
//........... | |
grunt.registerTask('buildbump', function() { | |
console.log('be sure to check that "ios.skipAppIdValidation" is set to true \n\n ti config ios.skipAppIdValidation true\n'); | |
var tiapp = grunt.config.data.tiapp; |
/*** | |
* Ti PD API | |
* | |
* App.config -> global config namespace | |
* we connect to a proxy instead of the API directly | |
* to avoid storing credentials on the client | |
* | |
* | |
* // Example api request | |
* api.request({ |
gulp.task('programmatic-configs', function () { | |
var foldernames = ['some', 'folder', 'names']; | |
var tasks = foldernames.map(function (fname) { | |
var taskname = fname + '-build'; | |
gulp.task(taskname, function (done) { | |
SOME_CONFIG_NAME = fname; | |
//sequence will run with alternate config... | |
runSequence('build', done); | |
}); | |
return taskname; |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Demo</title> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
<meta name="description" content="Demo project"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> | |
<style type="text/css"></style> |
// requires jQuery https://code.jquery.com/jquery-1.11.3.js | |
window.events = []; | |
$('body').click(function(event) { | |
//use event.target with firefox | |
var selector = fromHTMLElement(event.toElement || event.target); | |
window.events.push(selector); | |
console.log(selector, $(selector)); | |
}); | |
function fromHTMLElement(srcElement) { |