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 / README.md
Created December 3, 2020 21:00 — forked from hansemannn/README.md
Titanium iOS In-App-Purchase / Storekit

Titanium In-App-Purchasing

Support the native in-app-purchasing API's in Titanium.

Example

var IAP = require('ti.iap');

var PRODUCT_IDENTIFIER = 'YOUR_PRODUCT_IDENTIFIER';
@brentonhouse
brentonhouse / git-tag.js
Created May 23, 2020 16:13 — forked from omrilotan/git-tag.js
Create a tag by the last commit's author with it's message (example for async getters)
const asyncExec = require('util').promisify(require('child_process').exec);
/**
* Execute command line in a child process
* @param {...String} args Commands
* @return {String}
*/
async function exec (...args) {
const { stdout, stderr } = await asyncExec(...args);
@brentonhouse
brentonhouse / MOCK_DATA.js
Created May 14, 2020 14:38 — forked from lbrenman/MOCK_DATA.js
Arrow - How to Populate Your Arrow Builder Project With Data
module.exports = {
data: [
{"Name":"Demivee","Type":"Prospect","Phone":"1-(818)173-8443"},
{"Name":"Shufflester","Type":"Prospect","Phone":"93-(232)869-5557"},
{"Name":"Voonte","Type":"Customer","Phone":"62-(269)473-1186"},
{"Name":"Thoughtsphere","Type":"Prospect","Phone":"86-(902)994-3017"},
{"Name":"Zoonder","Type":"Customer","Phone":"1-(202)358-2758"},
{"Name":"Flashspan","Type":"Customer","Phone":"57-(126)114-4912"},
{"Name":"Yoveo","Type":"Customer","Phone":"593-(320)380-5127"},
@brentonhouse
brentonhouse / base.js
Created May 6, 2020 15:22 — forked from samueleastdev/base.js
Appcelerator requesting location permissions
/*
* function to check for all location services outcomes
*/
function requestLocationPermissions(authorizationType, callback) {
// FIXME: Always returns false on Android 6
// https://jira.appcelerator.org/browse/TIMOB-23135
if (OS_IOS && !Ti.Geolocation.locationServicesEnabled) {
return callback({
success : false,
@brentonhouse
brentonhouse / index.js
Created April 29, 2020 02:24 — forked from jasonkneen/index.js
Appcelerator swipe card like tinder
var win = Titanium.UI.createWindow({
backgroundColor: "#ffffff",
title: "win"
});
// animations
var animateLeft = Ti.UI.createAnimation({
left: -520,
transform: Ti.UI.create2DMatrix({rotate: 60}),
opacity: 0,
@brentonhouse
brentonhouse / appc_func_decode-jwt.js
Created April 29, 2020 02:19 — forked from adamtarmstrong/appc_func_decode-jwt.js
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];
@brentonhouse
brentonhouse / ti_helper.js
Created April 29, 2020 02:18 — forked from adamtarmstrong/ti_helper.js
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,
// https://jira.appcelerator.org/browse/TIMOB-12291
exports.compareQueries = function () {
testCommonWay();
testGroupConcat();
};
const TEST_QUERY_EXEC_COUNT = 50;
function testCommonWay() {
@brentonhouse
brentonhouse / IMPORT.md
Created March 10, 2020 14:57 — forked from FokkeZB/IMPORT.md
Add support for @import to Alloy styles

@import TSS for Alloy

NOTE: This is out-dated, I suggest using https://github.com/dbankier/ltss instead.

This alloy.jmk adds support for using CSS-like @import "file.tss"; statements in Alloy TSS styles.

The idea for this came when discussing adding the option of including a CSS-like reset stylesheet in Alloy to make up for platform differences in (background)color, but also some good practices.

I think one of the key issues in this discussion is that there is no such thing as the base style for an app. iOS fans would like to reset to iOS-like styles, Android fans like to reset to theirs, flat UI fanatics would like everything minimalized and Bootstrap adepts will ask for a huge library of styles.

@brentonhouse
brentonhouse / CXCallObserver-example.js
Created January 29, 2020 22:40 — forked from hansemannn/CXCallObserver-example.js
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');
}