Skip to content

Instantly share code, notes, and snippets.

View rollsroyc3's full-sized avatar

Andrew Royce rollsroyc3

View GitHub Profile
@rollsroyc3
rollsroyc3 / gist:76ef5345bca0c9361400
Created March 23, 2016 20:54
Rotate and save image using Appcelerator Titanium
/*
https://www.snip2code.com/Snippet/78042/Rotate-and-save-image-using-Appcelerator
Hi, I have tested this issue in Ti SDK 3.3.0.RC. Its working good.
Testing Environment:
Titanium SDK: 3.3.0.RC, 3.2.3.GA
Titanium CLI: 3.3.0-rc
//"THE BEER-WARE LICENSE": As long as you retain this notice you can do whatever you want with this stuff.
//If we meet some day, and you think this stuff is worth it, you can buy me a beer in return Jamie Buckley
var screenWidth = Ti.Platform.displayCaps.platformWidth;
var screenHeight = Ti.Platform.displayCaps.platformHeight;
var win = Ti.UI.createWindow({
fullscreen: true,
width: screenWidth,
height: screenHeight,
@rollsroyc3
rollsroyc3 / gist:6869880
Last active November 7, 2023 20:06
HTTP Digest Authentication
//HTTP Digest Authentication
//---------------------------
//Step 1: Send request to server with no credentials
//Step 2: Get 410 response with Www-Authenticate header containing Digest variables and do magic
//Step 3: Send back request with new magical header
//Step 4: Receive original request data
==================================================
@Override
public void onReceiveMsgCardData(byte flagOfCardData, byte[] cardData) {
byte flag = (byte) (flagOfCardData & 0x04);
if (flag == 0x00)
_strMSRData = new String(cardData);
if (flag == 0x04) {
// You need to dencrypt the data here first.
_strMSRData = new String(cardData);
}
@rollsroyc3
rollsroyc3 / gist:4357795
Last active December 10, 2015 01:19 — forked from anonymous/gist:4357794
Custom tabbar built in Titanium for ios (iphone and ipad) that was modified of the custom tabgroup found here : gist.github.com/853935 Added a larger middle icon that sticks above tabgroup
function customTabView(tabGroup) {
var isIPad = Ti.Platform.osname === 'ipad';
var maxWidth = isIPad ? 70 : 100;
var container = Ti.UI.createView({
width : '100%',
height : 80,
bottom : 0,
touchEnabled : false
});