Skip to content

Instantly share code, notes, and snippets.

View shouse's full-sized avatar

Steven shouse

  • SIVCI
  • Kansas City, MO
View GitHub Profile
@shouse
shouse / ios-sim-inspector.sh
Created November 7, 2017 20:06
Open up Safari's Web Inspector to be used for debugging
#!/bin/sh
function ios-sim-inspector() {
appName="$1"
osascript <<EOF
# Name of the device as visible in Safari->Develop menu
set deviceName to "Simulator"
# Number of seconds to wait for the simulator window to show up
set maxWait to 20
@shouse
shouse / titanium-auth-session.js
Created November 7, 2017 21:08 — forked from hansemannn/titanium-auth-session.js
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 });
@shouse
shouse / appc.js
Created November 12, 2017 01:29 — forked from jkotchoff/appc.js
This Titanium code can be used in an appcelerator project (with Hyperloop enabled) to determine if an iOS advertisement was the cause of the current installation
module.exports = {
hyperloop: {
ios: {
xcodebuild: {
frameworks: [
'iAd'
]
}
}
}
@shouse
shouse / beacons.js
Created November 13, 2017 15:47 — forked from hansemannn/beacons.js
Discover iBeacons with Hyperloop
var CLBeaconRegion = require("CoreLocation/CLBeaconRegion"),
NSUUID = require("Foundation/NSUUID"),
CLLocationManager = require("CoreLocation/CLLocationManager"),
CLProximityFar = require("CoreLocation").CLProximityFar,
CLProximityNear = require("CoreLocation").CLProximityNear,
CLProximityImmediate = require("CoreLocation").CLProximityImmediate,
CLProximityUnknown = require("CoreLocation").CLProximityUnknown,
UILocalNotification = require("UIKit/UILocalNotification"),
UIApplication = require("UIKit/UIApplication"),
locationManager;
@shouse
shouse / avaudioplayer.js
Created November 13, 2017 15:56 — forked from hansemannn/avaudioplayer.js
Use the AVAudioPlayer with Hyperloop.
var AVAudioEngine = require('AVFoundation/AVAudioEngine');
var AVAudioPlayerNode = require('AVFoundation/AVAudioPlayerNode');
var AVAudioFile = require('AVFoundation/AVAudioFile');
var NSBundle = require('Foundation/NSBundle');
var win = Ti.UI.createWindow({
backgroundColor: '#fff'
});
var btn = Ti.UI.createButton({
@shouse
shouse / index.js
Created November 13, 2017 16:37
Speech Recognition using Appcelerator Titanium and Hyperloop
'use strict';
/**
* Android sample showing speech recognition using Hyperloop.
*
* @version Titanium 6.1.2.GA
* @version Alloy 1.9.13
* @version Hyperloop 2.1.3
*/
@shouse
shouse / charts.js
Created November 13, 2017 18:17 — forked from grantges/charts.js
Hyperloop Donut Example using Alloy Custom Tags (charts.js should be put in the app/lib folder of your app)
var Hyperloop = require('hyperloop');
var UIView = require('UIView');
var CGRect = require('CGRect');
var CGPoint = require('CGPoint');
var UIColor = require('UIColor');
var UIBezierPath = require('UIBezierPath');
function DEGREES_TO_RADIANS(angle) { return (Number(angle) / 180.0 * Math.PI) };
var Button = require("android.widget.Button"),
LayoutParams = require('android.widget.FrameLayout.LayoutParams'),
Activity = require('android.app.Activity'),
Color = require('android.graphics.Color'),
TypedValue = require('android.util.TypedValue'),
Gravity = require('android.view.Gravity'),
OnClickListener = require('android.view.View.OnClickListener'),
currentActivity = new Activity(Ti.Android.currentActivity);
// Create a new Button object with your current activity
var FBSDKShareLinkContent = require("FBSDKShareKit/FBSDKShareLinkContent"),
FBSDKShareDialog = require("FBSDKShareKit/FBSDKShareDialog"),
NSURL = require("Foundation/NSURL");
var win = Ti.UI.createWindow({
backgroundColor: "#fff"
});
var btn = Ti.UI.createButton({
title: "Trigger Share Dialog"
/**
* 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");