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
@brentonhouse
brentonhouse / deep-linking-manager.js
Created January 29, 2020 22:35 — forked from hansemannn/deep-linking-manager.js
Titanium Deep Linking Manager (iOS)
export default class DeepLinkingManager {
constructor () {
this.handledLinks = {};
this.activityType = 'io.lambus.app.universalLink';
const activity = Ti.App.iOS.createUserActivity({
activityType: this.activityType
});
@brentonhouse
brentonhouse / ti.speech.example.js
Created November 28, 2019 03:59 — forked from hansemannn/ti.speech.example.js
Realtime Speech Recognition in Titanium
var TiSpeech = require('ti.speech');
TiSpeech.initialize('en_US'); // locale is optional
var win = Ti.UI.createWindow({
backgroundColor: '#fff'
});
var currentValue = '';
@brentonhouse
brentonhouse / push-manager.js
Created November 28, 2019 03:56 — forked from hansemannn/push-manager.js
Handle iOS push notifications in Appcelerator Titanium
import FirebaseMessaging from 'firebase.cloudmessaging';
export default class PushManager {
listenForPushNotifications() {
// Called when the Firebase token is ready
FirebaseMessaging.addEventListener('didRefreshRegistrationToken', event => {
const fcmToken = event.fcmToken;
// Update push token here …
@brentonhouse
brentonhouse / resetsims.js
Created October 29, 2019 15:30 — forked from cb1kenobi/resetsims.js
Resets all iOS, watchOS, and tvOS simulators
'use strict';
const execSync = require('child_process').execSync;
const json = JSON.parse(execSync('xcrun simctl list --json'));
for (const runtime of Object.keys(json.devices)) {
for (const device of json.devices[runtime]) {
console.log(`Removing ${device.name} (${device.udid})`);
execSync(`xcrun simctl delete ${device.udid}`);
}
@brentonhouse
brentonhouse / Components.js
Created September 19, 2019 14:21 — forked from zo0m/Components.js
Custom tags in go-od
const createFunctionsSet = {};
function buildCreatorFor(tagName, controllerName) {
const createFuntionName = `create${tagName}`;
createFunctionsSet[createFuntionName] = function (args) {
return Alloy.createController(controllerName, args).getView();
}
}
buildCreatorFor('BaseWindow', 'components/common/base-window/BaseWindow');
@brentonhouse
brentonhouse / index.js
Created August 27, 2019 20:51 — forked from hmridha/index.js
Shake a view using Appcelerator Titanium
/*
Hi, I have tested this issue in Ti SDK 3.3.0.RC. Its working good.
Testing Environment:
Titanium SDK: 3.3.0.RC, 3.2.3.GA
Titanium CLI: 3.3.0-rc
Android Version 4.4.3 KitKat
@brentonhouse
brentonhouse / cache.js
Created August 23, 2019 16:56 — forked from hansemannn/cache.js
Caching remote images in Titanium (asynchronously)
export default class Utils {
static loadCachedImageFromURL(url, cb) {
let filename;
try {
filename = url.substring(url.lastIndexOf('/') + 1);
} catch (err) {
cb(null);
}
@brentonhouse
brentonhouse / app-utils.js
Created August 23, 2019 16:55 — forked from hansemannn/app-utils.js
Using ES7+ async/await in Appcelerator Titanium
export function showOptions (args) {
const title = args.title;
const message = args.message;
const options = args.options;
const destructive = args.destructive !== undefined ? args.destructive : -1;
let cancel = -1;
return new Promise((resolve, reject) => {
if (OS_IOS) {
options.push('Cancel');
@brentonhouse
brentonhouse / README.md
Created August 16, 2019 03:03 — forked from lbrenman/README.md
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

@brentonhouse
brentonhouse / app.js
Created August 16, 2019 03:03 — forked from lbrenman/app.js
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'