Skip to content

Instantly share code, notes, and snippets.

View brentonhouse's full-sized avatar
🚀
Busy being awesome!

Brenton House brentonhouse

🚀
Busy being awesome!
View GitHub Profile
@lbrenman
lbrenman / app.js
Last active August 16, 2019 03:03
Node.js example of accessing Axway/Appcelerator MBaaS (ArrowDB/ACS) - user and photo API
var fs = require('fs');
var ArrowDBAppKey_Dev = '<ACS DEV APP KEY>';
var ArrowDBAppKey_Prod = '<ACS PROD APP KEY>';
var ArrowDB = require('arrowdb'),
arrowDBApp = new ArrowDB(ArrowDBAppKey_Prod);
var loginParams = {
login: 'a',
password: '1234'
@adamtarmstrong
adamtarmstrong / ti_helper.js
Created July 24, 2018 16:48
Titanium Helper Functions
//var tiHelper = require('ti_helper');
/*
* USAGE
* tiHelper.currency(numberToFormat,0);
*/
exports.currency = function(number, decimals, decSymbol, thousSymbol) { //number, decimal places , decimal symobl (.), thousands separator (,)
decimals = isNaN(decimals = Math.abs(decimals)) ? 2 : decimals,
decSymbol = decSymbol == undefined ? "." : decSymbol,
@lbrenman
lbrenman / README.md
Created July 17, 2018 14:27
Amplify MyPO Alexa Skill for Syncplicity POs

Axway Alexa Sync PO

An Amazon Echo Skill that runs on API Builder and MBaaS and enables users to discover new POs in the PO syncpoint. These files (POs) must be manually uploaded (for now)

Currently Supports:

  • Reading all or new files since last check
  • Sending URL to file to the user's mobile phone

NOTE that the skill compares file dates on Syncplicity with time that the Echo user checked for POs last

@adamtarmstrong
adamtarmstrong / appc_func_decode-jwt.js
Last active June 9, 2020 13:06
Decode JWT in Axway Titanium
/**
* token
* claim = "registered" || "public" || "private"
*/
exports.decodeJWT = function(token, claim) {
var base64Url;
if (claim == "registered") {
base64Url = token.split('.')[0];
} else if (claim == "private") {
base64Url = token.split('.')[2];
@hansemannn
hansemannn / CXCallObserver-example.js
Last active January 29, 2020 22:40
CXCallObserver in Hyperloop and Titanium
var CXCallObserver = require('CallKit/CXCallObserver'); // Require native class from CallKit
var CallDelegate = require('callDelegate'); // Require delegate class from app/lib/ (Alloy) or Resources/ (Classic)
var myDelegate = new CallDelegate(); // Instantiate Delegate
myDelegate.callChanged = function (callObserver, call) {
if (call.hasConnected) {
Ti.API.info('********** voice call connected **********\n');
} else if(call.hasEnded) {
Ti.API.info('********** voice call disconnected **********/n');
}
@hansemannn
hansemannn / titanium-auth-session.js
Last active February 13, 2018 20:07
Use Axway Hyperloop to perform OAuth-sessions with the iOS 11+ API "SFAuthenticationSession"
const SFAuthenticationSession = require('SafariServices/SFAuthenticationSession');
const NSURL = require('Foundation/NSURL');
const session = SFAuthenticationSession.alloc().initWithURLCallbackURLSchemeCompletionHandler(
NSURL.alloc().initWithString('https://github.com/login/oauth/authorize?scope=repo&client_id=XXXXX'),
'appcgithub://',
function(url, error) {
if (error != null) {
Ti.API.error('Error performing OAuth: ' + error.localizedDescription);
cb({ success: false, error: 'Error performing OAuth: ' + error.localizedDescription });
@hansemannn
hansemannn / hook-run-script-phase.js
Last active January 9, 2018 17:23
Use Run-Script-Phases in Axway Titanium
/**
* Ti.RunScriptPhase
* @abstract Support run-script-phases (aka shell-scripts) in native Titanium modules.
* @version 0.0.1
*/
exports.id = 'ti.runscriptphase';
exports.cliVersion = '>=3.2';
exports.init = function(logger, config, cli, appc) {

Upload images to GitHub

  1. Create a new issue on GitHub.

  2. Drag an image into the comment field.

  3. Wait for the upload process to finish.

  4. Copy the URL and use it in your Markdown files on GitHub.

@adamtarmstrong
adamtarmstrong / youversion_event.js
Last active August 18, 2017 17:39
YouVersion Event - Deep-Link (Cross-Platform)
/*
* You Version Sample Event URL: http://bible.com/events/264769
*/
var sermonNoteURL = "youversion://events?id=" + eventID; //where eventID = 6 digit from YouVersion Event URL
openYouVersionSermonNotes(sermonNoteURL);
function openYouVersionSermonNotes(eventURL){
if (OS_ANDROID){
try {
var intent = Ti.Android.createIntent({
@hansemannn
hansemannn / ti.es6.js
Last active November 16, 2017 20:16
Use ES6 in Appcelerator Titanium 6.2.0+
class Application {
constructor(cb) {
this.window = Ti.UI.createWindow({
backgroundColor: '#fff'
});
var btn = Ti.UI.createButton({
title: 'Trigger'
});