Skip to content

Instantly share code, notes, and snippets.

@lbrenman
lbrenman / _readme
Last active August 29, 2015 14:06
Appcelerator Titanium tijasmine simple titanium example
tijasmine Unit Test Demo
* Have a working project
- Note that i created a utils.js file in the lib folder with my business logic methods
e.g.
exports.concatName = function(a,b) {
return a.substring(0,1).concat(b);
}
@lbrenman
lbrenman / _readme
Last active August 29, 2015 14:06
Appcelerator Titanium ACS Search History
Example of implementing search history synced across a user's multiple devices (like google maps)
See blog post here:
http://www.appcelerator.com/blog/2014/08/implementing-recent-history-in-your-appcelerator-apps/
Excerpt from Blog:
Implementing Recent Search History in your Appcelerator apps
@lbrenman
lbrenman / config.json
Created October 4, 2014 01:36
Appcelerator Titanium Node.ACS Post Example
{
"routes": [ {
"path": "/",
"callback": "application#index"
}, {
"path": "/getData",
"method": "post",
"callback": "services#getData"
} ],
"filters": [ {
@lbrenman
lbrenman / ACS.js
Created October 5, 2014 22:45
Appcelerator Titanium ACS Photo Example
var Cloud = require('ti.cloud');
function createUserACS(u,p,o){
Ti.API.info("ACS: createUserACS(), u = "+u+", p="+p);
if(Titanium.Network.networkType == Titanium.Network.NETWORK_NONE){
alert("No Network. Please try again later.");
return;
}
//Alloy.Globals.waitCursorStart();
@lbrenman
lbrenman / index.html
Created November 1, 2014 13:54
Appcelerator Titanium EKG Monitor Example using Logical Labs LE BT Module and Highcharts
<!DOCTYPE HTML>
<!--html manifest="cache.manifest"-->
<html>
<head>
<meta name="viewport" content="width=device-width">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Highstock Example</title>
<script src="jquery.min.js"></script>
<script src="highcharts.js"></script>
<script src="exporting.js"></script>
@lbrenman
lbrenman / alloy.js
Last active August 29, 2015 14:09
Appcelerator Titanium Alloy Bluetooth LE Weather Station using TI CC2541 SmartTag and Logical Labs BT LE Module
// The contents of this file will be executed before any of
// your view controllers are ever executed, including the index.
// You have access to all functionality on the `Alloy` namespace.
//
// This is a great place to do any initialization for your app
// or create any global variables/functions that you'd like to
// make available throughout your app. You can easily make things
// accessible globally by attaching them to the `Alloy.Globals`
// object. For example:
//
@lbrenman
lbrenman / 0_reuse_code.js
Last active August 29, 2015 14:16
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@lbrenman
lbrenman / app.js
Last active August 29, 2015 14:17
ArrowDB Block Example - Sample 'Before' Block to be executed before each API call related to the iotdevice model - clear iot device timer
var Arrow = require('arrow'),
server = new Arrow();
var Timers = require('./timers');
// lifecycle examples
server.on('starting', function(){
server.logger.debug('server is starting!');
});
server.on('started', function(){
@lbrenman
lbrenman / alert.js
Last active August 29, 2015 14:17
ArrowDB Custom APIs Example - Sample custom api's in the apis folder interacting with the same model as the automatic APIs
var Arrow = require('arrow');
var ACS = require('acs-node');
ACS.init(<ACS Key>);
var Alert = Arrow.API.extend({
group: 'iotapis',
path: '/api/alert',
method: 'GET',
description: 'this is an api that shows how to implement an API',
@lbrenman
lbrenman / AccountDetail.js
Last active August 29, 2015 14:19
Appcelerator Arrow Salesforce Composite Connector Models for retrieving Account Details with Associated Opportunities for that Account
var Arrow = require("arrow");
var Model = Arrow.Model.reduce("appc.salesforce/Account","AccountDetail",{
"fields": {
"Name": {
"type": "string",
"description": "Account Name",
"readonly": false,
"maxlength": 255,
"required": true,