Skip to content

Instantly share code, notes, and snippets.

View barlino's full-sized avatar

Barlino Yeh barlino

  • N Squared Ltd. Co.
  • Taipei, Taiwan
View GitHub Profile
@kwhinnery
kwhinnery / howto.md
Created May 13, 2013 00:42
Execute "tishadow run" in your Titanium app directory whenever a JavaScript file changes.

Automatic TiShadow Installs

Execute "tishadow run" in your Titanium app directory whenever a JavaScript file changes. Edit your JS files in a text editor, save, then switch to the test device or simulator. Profit.

Install supervisor

[sudo] npm install -g supervisor

Execute tishadow run anytime a JavaScript file changes

@setou
setou / ApplicationWindow.js
Created August 15, 2012 01:51
Titanium Mobile Facebook Menu UI
function ApplicationWindow() {
var MainView = require('ui/common/MainView')
MenuTableView = require('ui/common/MenuTableView');
var self = Ti.UI.createWindow();
var mainView = new MainView(),
menuTable = new MenuTableView();
@jmoiron
jmoiron / bongo.sh
Created June 30, 2012 21:58
export and import all collections from a mongodb database into/outof a single tarball
#!/bin/bash
LOADING=false
usage()
{
cat << EOF
usage: $0 [options] dbname
OPTIONS:
@bob-sims
bob-sims / 00-README.TXT
Last active October 1, 2015 09:47
Demo CommonJS module for Titanium Mobile interaction with Drupal Services 3.x REST + JSON interface
This is a simple CommonJS module to wrap Titanium Ti.Network.HttpClient calls to interact with Drupal Services.
NOTE: Code updated at @TiConf using callback functions.
Tested using:
Drupal 6.24
Services 3.1
Titanium Mobile SDK 1.8.2 (Android 2.2 SDK)
var window = Ti.UI.createWindow({
backgroundColor:'white'
});
var scroller = Ti.UI.createScrollView({
top:60,
contentHeight:'auto'
});
window.add(scroller);
@yagitoshiro
yagitoshiro / push_notifications.js
Last active August 13, 2016 17:29
apple push notification sample (Titanium Mobile)
//////////////////////push_notifications.js///////////////////////
var apns = function(){
var pref = require('preferences').preferences;
Titanium.Network.registerForPushNotifications({
types: [
Titanium.Network.NOTIFICATION_TYPE_BADGE,
Titanium.Network.NOTIFICATION_TYPE_ALERT
],
success:function(e)
@kwhinnery
kwhinnery / parse.js
Created August 27, 2011 04:03
A Parse client for Titanium Mobile - sneak peek
//Public client interface
function Client(applicationId, masterKey) {
this.applicationId = applicationId;
this.masterKey = masterKey;
}
exports.Client = Client;
//Parse API endpoint
var ENDPOINT = 'https://api.parse.com/1/classes/';
@guilhermechapiewski
guilhermechapiewski / Makefile
Created April 6, 2011 03:26
Utility scripts to start Titanium Mobile projects from the command line.
PROJECT_ROOT=$(shell pwd)
PROJECT_NAME=SampleApp
run:
@echo "Building with Titanium..."
@mkdir -p ${PROJECT_ROOT}/${PROJECT_NAME}/build/iphone/
@PROJECT_NAME=${PROJECT_NAME} PROJECT_ROOT=${PROJECT_ROOT} DEVICE_TYPE=iphone bash ${PROJECT_ROOT}/bin/titanium.sh
@jpurcell
jpurcell / pull-to-refresh(android).js
Created April 5, 2011 15:58
Tweetie-like pull to refresh and pull to load more. Note that it requries set heights for everything.
// This is the Android version of the Tweetie-like pull to refresh table:
// http://developer.appcelerator.com/blog/2010/05/how-to-create-a-tweetie-like-pull-to-refresh-table.html
var win = Ti.UI.currentWindow;
var alertDialog = Titanium.UI.createAlertDialog({
title: 'System Message',
buttonNames: ['OK']
});
var scrollView = Ti.UI.createScrollView({
@dawsontoth
dawsontoth / InfiniteScrollingTableView.js
Created February 3, 2011 22:49
Infinite loading table view for iOS and Android.
/**
* We're going to create an infinite loading table view. Whenever you get close to the bottom, we'll load more rows.
*/
var win = Ti.UI.createWindow({ backgroundColor: '#fff' });
var isAndroid = Ti.Platform.osname === 'android';
/**
* Create our UI elements.
*/
var table = Ti.UI.createTableView({ top: 0, right: 0, bottom: 0, left: 0 });