This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Override a tab group's tab bar on iOS. | |
* | |
* NOTE: Call this function on a tabGroup AFTER you have added all of your tabs to it! We'll look at the tabs that exist | |
* to generate the overriding tab bar view. If your tabs change, call this function again and we'll update the display. | |
* | |
* @param tabGroup The tab group to override | |
* @param backgroundOptions The options for the background view; use properties like backgroundColor, or backgroundImage. | |
* @param selectedOptions The options for a selected tab button. | |
* @param deselectedOptions The options for a deselected tab button. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var tabGroupOuter = Ti.UI.createTabGroup(); | |
tabGroupOuter.addTab(Ti.UI.createTab({ | |
title: 'app.js', | |
window: Ti.UI.createWindow({ | |
title: 'app.js', | |
url: 'middle.js', | |
backgroundColor: 'red' | |
}) | |
})); | |
tabGroupOuter.open(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Create a "container" window. This will house all of our high level UI elements | |
*/ | |
var container = Ti.UI.createWindow({ | |
backgroundColor: 'yellow' | |
}); | |
/** | |
* Add some stuff to the top of the container. This will be visible everywhere in the app | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var iconStore = Ti.Filesystem.applicationDataDirectory + '/CachedRemoteImages'; | |
var dir = Ti.Filesystem.getFile(iconStore); | |
if (!dir.exists()) { | |
dir.createDirectory(); | |
} | |
function cacheRemoteURL(image, imageURL) { | |
if (imageURL) { | |
var hashedSource = Ti.Utils.md5HexDigest(imageURL + '') + '.' + imageURL.split('.').pop(); | |
var localIcon = Ti.Filesystem.getFile(iconStore, hashedSource); | |
if (localIcon.exists()) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* The images for this example can be downloaded from http://j.mp/loadingimagesforti */ | |
var win = Ti.UI.createWindow({ backgroundColor: '#f00'}); | |
var loading = Ti.UI.createImageView({ | |
images: [ | |
'images/loading/00.png', 'images/loading/01.png', 'images/loading/02.png', | |
'images/loading/03.png', 'images/loading/04.png', 'images/loading/05.png', | |
'images/loading/06.png', 'images/loading/08.png', 'images/loading/09.png', | |
'images/loading/10.png', 'images/loading/11.png' | |
], | |
width: 33, height: 33 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (c) Henry Poydar | |
# Modified from couchrest-rails | |
# A Rails plugin for connecting to and working with CouchDB via CouchRest | |
# https://github.com/hpoydar/couchrest-rails/ | |
require 'sunspot_couch.rb' | |
begin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Started GET "/success?result= for 121.98.222.42 at 2011-05-05 10:18:07 +1200 | |
Processing by OrdersController#success as HTML | |
Parameters: {obfuscated mofo} | |
[1m[36mOrder Load (1.8ms)[0m [1mSELECT `orders`.* FROM `orders` WHERE `orders`.`serial_number` = 'BOOM' LIMIT 1[0m | |
[1m[35mDeal Load (0.7ms)[0m SELECT `deals`.* FROM `deals` WHERE `deals`.`id` = 2 LIMIT 1 | |
Redirected to http://deals4backpackers.com/deals/2/orders/complete | |
Completed 302 Found in 177ms | |
Started GET "/deals/2/orders/complete" for 121.98.222.42 at 2011-05-05 10:18:07 +1200 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
App.Models.Task = App.Models.Base.createModel('Task', 'tasks', { | |
name: 'TEXT', | |
note: 'TEXT', | |
due_at: 'DATE', | |
is_completed: 'TEXT', | |
completed_at: 'TEXT', | |
category_id: 'TEXT', | |
event_id: 'INTEGER', | |
has_reminders: 'TEXT', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// RATER MODULE for Appcelerator Titanium | |
/* | |
WHAT IS IT: | |
Create a cycling reminder to go rate your app at the App Store. Tracks | |
the app launch count, and reminds the user every 20 launches (configurable) to | |
rate the app, with a click to launch the app page in the App Store. | |
Reminders stop if the user clicks the "Rate Now" or "Don't Remind Me" options. | |
USAGE: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# JSON-encoded error and redirect results for Devise controllers. | |
# This overrides an internal method of Devise, so be careful when updating Devise! | |
# | |
# Usage: | |
# | |
# class Users::RegistrationsController < Devise::RegistrationsController | |
# include DeviseJsonAdapter | |
# end | |
# | |
# devise_for :users, :controllers => { :registrations => "users/registrations" } |