Skip to content

Instantly share code, notes, and snippets.

View yozef's full-sized avatar

Joseph yozef

  • Boston - San Francisco - Montréal
View GitHub Profile
var win = Ti.UI.createWindow({
backgroundColor:"#fafaf9"
});
var logo = Ti.UI.createView({
backgroundImage:"info_usat_logo.png",
width:157,
height:131,
top:30,
left:30
@dawsontoth
dawsontoth / app.js
Created March 4, 2011 00:44
Customize the look of the tab bar in iOS Appcelerator Titanium
Ti.include('overrideTabs.js');
/*
This is a typical new project -- a tab group with three tabs.
*/
var tabGroup = Ti.UI.createTabGroup();
/*
Tab 1.
@mcongrove
mcongrove / TiFtp.js
Created April 11, 2011 22:02
An FTP wrapper library for Titanium Mobile.
var TiFtp = {
config: {
host: null,
port: 21,
path: null,
user: null,
password: null
},
init: function(_host, _path, _user, _password) {
if(!_host || !_path || !_user || !_password) {
@nulltask
nulltask / usage.js
Created April 20, 2012 08:01
XML-RPC client for Titanium Mobile
var xmlrpc = require('./lib/xmlrpc');
var client = xmlrpc.createClient({
url: 'https://api.example.com/XML-RPC'
, username: 'xxxx'
, password: 'xxxx'
});
client
.call('foo.methodName')
@rampicos
rampicos / social.js
Last active January 10, 2019 10:10
Social.js is the Appcelerator Titanium's Alloy Widget at first it is used to connect with Twitter only, though twitter and linkedin uses OAuth for its authentication I made some changes on Social.js for multi-purpose to connect Twitter and LinkedIn
function hex_sha1(s) {
return binb2hex(core_sha1(str2binb(s), s.length * chrsz));
}
function b64_sha1(s) {
return binb2b64(core_sha1(str2binb(s), s.length * chrsz));
}
function str_sha1(s) {
return binb2str(core_sha1(str2binb(s), s.length * chrsz));
@FokkeZB
FokkeZB / RATING.md
Last active December 16, 2015 16:49
Rate-my-app CommonJS module for Titanium
@FokkeZB
FokkeZB / ALLOY.md
Last active February 13, 2019 20:01
Alloy constants and helpers for non-Alloy Titanium projects.

If you want to your CommonJS modules to work in both Alloy and plain Titanium projects, you might need a way to detect if you're in Alloy. For instance, if you're in Alloy you would get Underscore from the alloy-module, while in plain Titanium you would require Underscore directly.

Well, you can:

var _ = require((typeof ENV_TEST === 'boolean') ? 'alloy' : 'underscore')._;

The above works by utilizing Alloy's optimization process. In this process, constants like ENV_TEST will be either TRUE or FALSE. The actual expressions in wich they are used will then be evaluated. If FALSE the code block will be removed. In plain Titanium projects the constants are undefined and this typeof ENV_TEST will be undefined, so the code block will be executed.

@jakeorr
jakeorr / RateMe.js
Last active May 12, 2017 10:22 — forked from psyked/RateMe.js
function RateMe(ios_url, goog_url, usecount) {
if(!Ti.App.Properties.hasProperty('RemindToRate')) {
Ti.App.Properties.setString('RemindToRate', 0);
}
var remindCountAsInt = parseInt(Ti.App.Properties.getString('RemindToRate'), 10);
var newRemindCount = remindCountAsInt + 1;
if(remindCountAsInt === -1) {
// the user has either rated the app already, or has opted to never be
// reminded again.
@benbahrenburg
benbahrenburg / app.js
Last active March 15, 2017 14:48
Titanium TableView Expand Zoom TableView HeaderView
'use strict';
var win = Ti.UI.createWindow({
backgroundColor: 'white',
});
//Generate some sample rows
var rows = [];
for (var iLoop=0;iLoop<100;iLoop++){
rows.push({ title: 'demo row #'+iLoop});
@aaronksaunders
aaronksaunders / credentials.js
Last active February 2, 2019 16:54
Updated Instagram Integration with Appcelerator, all the files you need are here, be sure to include the promises library in your project
exports.C = {
INSTAGRAM_CLIENT_ID : 'replace this with your public', //replace this with your public
INSTAGRAM_CLIENT_SECRET : 'replace this with your private key', //replace this with your private key
INSTAGRAM_CALLBACK_URL : 'replace this with your INSTAGRAM_CALLBACK_URL'
};