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
@jmcerrejon
jmcerrejon / backup.sh
Last active April 18, 2021 04:25
Zip the current Titanium project on macOS
#!/usr/bin/bash
#
# Description: Zip the current Titanium project on macOS
# File: backup.sh
# Author: Jose Cerrejon (ulysess_at_gmail.com)
# Help: Copy in the root of your Titanium project and Add to package.json the script: "backup": "sh backup.sh",
#
clear
stop_liveview() {
@brentonhouse
brentonhouse / api.js
Created January 20, 2021 20:44 — forked from cyberwombat/api.js
Walmart API authentication in Node
import { createSign, randomBytes } from 'crypto'
import axios from 'axios'
import { resolve } from 'url'
const PK_HEADER = '\n-----BEGIN PRIVATE KEY-----\n'
const PK_FOOTER = '\n-----END PRIVATE KEY-----\n'
const BASE_URL = 'https://marketplace.walmartapis.com/'
const WALMART_CONSUMER = "b68d2a72....";
@hansemannn
hansemannn / README.md
Created October 5, 2020 06:47
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';
@adamtarmstrong
adamtarmstrong / ti_splitwindow.js
Created May 29, 2019 13:37
Use SplitWindow w/ Titanium and toggle MasterView based on both orientation + if in SplitView/SplitOver Mode
//XML
<Alloy>
<SplitWindow id="splitWindow" backgroundColor="white" showMasterInPortrait="true" masterIsOverlayed="true" platform="ios">
<!--MASTER-->
<NavigationWindow platform="ios">
<Window title="Master" layout="vertical">
<LeftNavButtons>
<Label id="masterCollapseButton" class="navButton" text="<<" onClick="toggleMaster" />
</LeftNavButtons>
@hansemannn
hansemannn / deep-linking-manager.js
Created May 20, 2019 10:06
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
});
@hansemannn
hansemannn / ti.speech.example.js
Created April 8, 2019 05:29
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 = '';
@lbrenman
lbrenman / Getting Started with AWS Amplify for Serverless Functions.md
Last active August 16, 2019 03:02
Getting Started with AWS Amplify for Serverless Functions

Getting Started with AWS Amplify for Serverless Functions

The Amplify Framework provides a set of libraries, UI components, and a command line interface to build a mobile backend and integrate with your iOS, Android, Web, and React Native apps.

This article will describe how to use Amplify to easily create serverless API's.

I'll follow this tutorial.

Installing & configuring the Amplify CLI

@hansemannn
hansemannn / cropping-manager.js
Created March 14, 2019 11:04
An example of cropping images cross-platform on Titanium.
/**
* Crops a given image URL to an optional aspect ratop (square by default).
*
* Example:
*
* const image = await ImageCroppingManager.crop(myImageURL);
*
*/
export default class ImageCroppingManager {
@hansemannn
hansemannn / app-utils.js
Last active October 15, 2019 20:16
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');
@hansemannn
hansemannn / cache.js
Created December 12, 2018 10:19
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);
}