Skip to content

Instantly share code, notes, and snippets.

@stephenfeather
stephenfeather / Timings.js
Last active December 19, 2016 12:22
Quick and dirty timings libary, most definitely should not be used for engineering, medical, safety related usages.
/*
Requires Underscore
Basic Usage:
var Timing = require('Timing');
Timing.start('myLabel');
Timing.stop('myLabel');
Timing.getTime('myLabel');
@tzmartin
tzmartin / ios.settings.schemes.md
Created January 13, 2016 18:27
iOS Settings URL Scheme List

Settings URL schemes:

Note: < i=OS 5.1 use prefs:. > 5.1 use app-settings:

  • app-settings:root=General&path=About
  • app-settings:root=General&path=ACCESSIBILITY
  • app-settings:root=AIRPLANE_MODE
  • app-settings:root=General&path=AUTOLOCK
  • app-settings:root=General&path=USAGE/CELLULAR_USAGE
  • app-settings:root=Brightness
@benbahrenburg
benbahrenburg / app.js
Last active February 6, 2018 09:46
Titanium Settings Dialog Examples
Ti.UI.setBackgroundColor('#000');
var alertSettings = require("settings-dialog");
var win = Ti.UI.createWindow({
title:'Example', backgroundColor:'#fff', layout:"vertical"
});
win.add(Ti.UI.createLabel({
text:"Example on now to prompt user to change settings",
@stephenfeather
stephenfeather / gist:2ac42b8544c995f7b7ff
Created January 3, 2016 00:23
OSX command line for tool to test your android library for text relocations
/sdks/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-readelf -a yourlib.so | grep TEXTREL
@rborn
rborn / README.md
Last active August 29, 2015 14:23 — forked from manumaticx/README.md

Fading Actionbar

This is a quick example of how to create a fading actionbar effect like this in Appcelerator Titanium

fadingactionbar

How this works

This is actually very simple. The trick is putting the Actionbar in overlay mode by configuring the theme with windowActionBarOverlay:true. Then all you need to do is updating the color of the Actionbar, in this case by scrolling a ScrollView.

@manumaticx
manumaticx / README.md
Last active July 11, 2020 14:07
Fading ActionBar in Titanium

Fading Actionbar

This is a quick example of how to create a fading actionbar effect like this in Appcelerator Titanium

fadingactionbar

How this works

This is actually very simple. The trick is putting the Actionbar in overlay mode by configuring the theme with windowActionBarOverlay:true. Then all you need to do is updating the color of the Actionbar, in this case by scrolling a ScrollView.

@iotashan
iotashan / alloy.js
Last active March 2, 2017 15:18
Listening for android start/pause/stop/resume events in Titanium
if (OS_ANDROID) {
// Somehow, only in alloy.js we can get the data (URL) that opened the app
Alloy.Globals.url = Ti.Android.currentActivity.intent.data;
Ti.API.info('launch data: '+Ti.Android.currentActivity.intent.data);
Ti.Android.currentActivity.addEventListener('newintent',function(e){
Ti.API.info('newintent ' + JSON.stringify(e.intent.data));
});
Ti.Android.currentActivity.onCreate = function(e){
@jasonkneen
jasonkneen / Alloy.js
Last active November 27, 2018 07:12
Dynamically change languages in a Titanium Alloy app (for testing)
// add this to the Alloy.js file
// Set to run in ENV_DEV mode so it's used for testing withou
// having to change languages on device etc
// NO checks in place so assumes you know what you're doing, have
// the relevant strings files and specify the correct one!
// should work on Android - not tested yet!
if (ENV_DEV) {
Alloy.Globals.setLanguage = function(lang) {
@ndob
ndob / patched socket.io.js
Last active April 7, 2017 18:58
Socket io 1.2.0 patched to work with tiws (https://github.com/omorandi/tiws)
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.io=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
module.exports = _dereq_('./lib/');
},{"./lib/":2}],2:[function(_dereq_,module,exports){
/**
* Module dependencies.
*/
@stephenfeather
stephenfeather / Gruntfile.js
Last active October 2, 2015 18:18
Appcelerator Gruntjs
module.exports = function(grunt) {
require('time-grunt')(grunt);
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
CHANGELOG: '',
// add tiapp.xml changes to the repo
gitadd: {
versionBump: {
options: {