jq is useful to slice, filter, map and transform structured json data.
brew install jq
console.warn('- console.(debug|info|log|warn|error) monkey-patched'); | |
const methods = ['debug', 'info', 'log', 'warn', 'error']; | |
// We have to take the direct references to the actual function like this | |
// instead of doing just: originalConsole = console | |
const originalConsole = _.reduce(methods, (memo, methodName) => { | |
memo[methodName] = _.bind(console[methodName], console); | |
return memo; | |
}, {}); |
/** | |
* Ti.TouchID | |
* | |
* Summary: Support native Touch ID with Hyperloop in Titanium Mobile. | |
* Author: Hans Knoechel | Appcelerator, Inc | |
* Date: 03/22/2016 | |
* Version: 0.1.0 | |
* Example | |
* | |
* var touchID = require("ti.touchid"); |
/** | |
* HYPERLOOP GENERATED - DO NOT MODIFY | |
* | |
* This source code is Copyright (c) 2016 by Appcelerator, Inc. | |
* All Rights Reserved. This code contains patents and/or patents pending. | |
*/ | |
var $dispatch = Hyperloop.dispatch, | |
$init, | |
$imports, | |
$class; |
Ti.UI.setBackgroundColor('#000'); | |
var alertSettings = require("settings-dialog"); | |
var win = Ti.UI.createWindow({ | |
title:'Example', backgroundColor:'#fff', layout:"vertical" | |
}); | |
win.add(Ti.UI.createLabel({ | |
text:"Example on now to prompt user to change settings", |
Install OS X El Capitan
is created$.Departures.comparator = sortDepartures; | |
$.Departures.reset([]); | |
var sortByName = true; | |
function transformDeparture(model){ | |
if (!model || !model.get('destination')){ | |
console.warn(model.toJSON()); | |
} | |
var time = require('Date').formatTime(model.get('time')); |
With Alloy and Hyperloop, you can quickly and easily expose native UI as Custom Alloy tags by leveraging the namespace (ns) attribute and commonjs modules.
Alloy allows you to create your own UI element that can be included into the XML View heirarchy in one of two ways, an Alloy Widget or through the use of Custom Tags.
To create your own custom tag, you link the tag to the commonjs module with the namespace attribute (ns). Here is an example using a custom tag to render a standard Titanium View: