Skip to content

Instantly share code, notes, and snippets.

View adamtarmstrong's full-sized avatar
🏠
Working from home

Adam T Armstrong adamtarmstrong

🏠
Working from home
View GitHub Profile
@adamtarmstrong
adamtarmstrong / theme.css
Last active July 7, 2022 14:14
Five9 Theme
/*!
* jQuery Mobile 1.4.0
* Git HEAD hash: f09aae0e035d6805e461a7be246d04a0dbc98f69 <> Date: Thu Dec 19 2013 17:34:22 UTC
* http://jquerymobile.com
*
* Copyright 2010, 2013 jQuery Foundation, Inc. and other contributors
* Released under the MIT license.
* http://jquery.org/license
*.
*/html{font-size:100%}body,input,select,textarea,button,.ui-btn{font-size:1em;line-height:1.3;font-family:Arial}legend,.ui-input-text input,.ui-input-search input{color:inherit;text-shadow:inherit}.ui-mobile label,div.ui-controlgroup-label{font-weight:normal;font-size:16px}.ui-field-contain{border-bottom-color:#828282;border-bottom-color:rgba(0,0,0,0.15);border-bottom-width:1px;border-bottom-style:solid}.table-stroke thead th,.table-stripe thead th,.table-stripe tbody tr:last-child{border-bottom:1px solid #d6d6d6;border-bottom:1px solid rgba(0,0,0,0.1)}.table-stroke tbody th,.table-stroke tbody td{border-bottom:1px solid #e6e6e6;border-bottom:1px solid rgba(0,0,0,0.05)}.table-stripe.table-stroke tbody tr:last-child th,.table-stri
@adamtarmstrong
adamtarmstrong / SwiftUIObjectBindingIssue.swift
Last active July 3, 2019 16:11
Issue updating @object in Class and reflecting in View
class ResultsObserver : NSObject, SNResultsObserving { //https://developer.apple.com/documentation/soundanalysis/analyzing_audio_to_classify_sounds
@ObjectBinding var whistle = Whistle()
func request(_ request: SNRequest, didProduce result: SNResult) {
... //removed for simplicity
if (classification.identifier == "my classification") {
print("Detected my classification - setting Object to true") //This shows in console (when appropriate)
DispatchQueue.main.async {
self.whistle.detected = true
@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>
@adamtarmstrong
adamtarmstrong / ti_modal-bottomsheet.js
Last active September 4, 2018 17:39
Ti Modal BottomSheet - Fragment
/*
* Ti Modal BottomSheet - Fragment
* Sample/Screenshot - https://imgur.com/EPHd7D2
*/
/*
* USAGE WITHIN YOUR MAIN APP:
* Simply use:
* Alloy.createController("modalBottomsheet").getView().open();
@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,
@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];
@adamtarmstrong
adamtarmstrong / appc_reste_sqlite_usage.js
Last active April 11, 2018 08:55
AppC: Using RESTe + local sqlite DB
//alloy.js
require("sqlite_reste_config");
var localDB = require('sqlite_db');
localDB.initDB();
//sqlite_reste_config.js
Alloy.Globals.reste = require("reste");
04f2a15dc90ddb1e9fcbe51c9450bf1a4655e7ffec0d7db4092d6b7633fc9ff8a126d12d53286a3a6e094eda60922b699fc1e708b888deef8581096773ccb653b3;m1ga
@adamtarmstrong
adamtarmstrong / xplatform_bio_auth.js
Last active February 6, 2018 15:06
iOS/Android Biometric Auth
/*
The Android UI is provided via my Ti.Widget: ti.androidfingerprintalertdialog
https://github.com/adamtarmstrong/ti.androidfingerprintalertdialog
referenced in the code below as: $.androidFingerprint
*/
function promptForTouchAuth(){ "use strict";
if (OS_IOS) {
$.emailAddress.blur(); //hide keyboard before prompting for biometrics
TiTouchId.authenticate({
@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({