Skip to content

Instantly share code, notes, and snippets.

@rblalock
rblalock / alloy.js
Last active December 13, 2015 21:48
Alloy override for analytics
Alloy.createWidget = function(id, name, args) {
Ti.Analytics.featureEvent("widget." + id, args);
return new (require("alloy/widgets/" + id + "/controllers/" + (name || "widget")))(args);
};
Alloy.createController = function(name, args) {
Ti.Analytics.featureEvent("controller." + name, args);
return new (require("alloy/controllers/" + name))(args);
};
@rblalock
rblalock / handleItemSwipe.js
Last active November 18, 2017 19:16
TableViewRow swipe sample
/**
* Handle Item Swipe
* @param {Object} _event
*/
$.handleItemSwipe = function(_event) {
var row = _event.source;
var id = row.id;
var controls = Alloy.createController("rowControls");
row.add(controls.wrapper);
@ricardoalcocer
ricardoalcocer / windowopen.js
Last active December 20, 2015 13:59
Dynamically changing menu options on Android
// this goes on the open event of your tabgroup
// what happens here is that you create a single function for the menu options of all tabs
// then upon focus of a tab, you call invalidateOptionsMenu, which triggers the onCreateOptionsMenu event
//
if (OS_ANDROID){
var tabGroup=Alloy.Globals.tabgroup;
var activity = tabGroup.getActivity();
if (activity.actionBar) {
@dalelane
dalelane / install-eventstreams-operator.sh
Last active August 20, 2020 18:57
Installing the Event Streams Operator using the kubectl-operator plugin
#!/bin/bash
# This script uses the kubectl-operator plugin
# Install it using the instructions at https://github.com/operator-framework/kubectl-operator
# -----------------------------------------------------------------------
echo "Adding the IBM Common Services catalog source that provides pre-requisite operators"
oc operator catalog add \