This file contains 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 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 ( jQuery ) { | |
$( 'body' ).delegate( ".ui-page", "pagebeforeshow", function( event, opts ) { | |
var $page = $(event.target), | |
reloadPage = false, | |
cacheStrategy = $page.data('cache'), | |
pageInstance = $page.data('page'), | |
invalidateCache = pageInstance.dirtyCache; | |
// Check if page never gets cached | |
if ( cacheStrategy == 'never' ) { |
This file contains 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 win = Ti.UI.createWindow({ backgroundColor: '#fff' }); | |
win.add(Ti.UI.createLabel({ text: 'Look for the notification! It should be there now.' })); | |
win.open(); | |
Titanium.Android.NotificationManager.notify( | |
0, // <-- this is an ID that we can use to clear the notification later | |
Ti.Android.createNotification({ | |
contentTitle: 'Cheese, Gromit!', | |
contentText: 'Swiss', | |
tickerText: 'Our app made a notification!', |
This file contains 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
/** | |
* @description: This is the iPhone version to create picker views on the fly :-) | |
* @author: Stephen G | |
* @date: 04/11/2011 | |
* @screenshot: http://yfrog.com/h4vr6ep | |
* | |
* @thanks to: http://cssgallery.info/making-a-combo-box-in-titanium-appcelerator-code-and-video/ | |
* | |
* Example of use (two different pickers using same function to create): | |
* |
This file contains 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 following snippet will ask the user to rate your app the second time they launch it. | |
* It lets the user rate it now, "Remind Me Later" or never rate the app. | |
*/ | |
var win = Ti.UI.createWindow({ backgroundColor: '#fff' }); | |
win.addEventListener('open', checkReminderToRate); | |
win.add(Ti.UI.createLabel({ text: 'This is a simple app that will remind you to rate it.' })); | |
win.open(); | |
function checkReminderToRate() { |
This file contains 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
/** | |
* This demonstrates how to show suggestions on a text field using just JavaScript with Appcelerator Titanium. | |
* | |
* You will need to download four images to get this to work: | |
* | |
* 1) http://dl.dropbox.com/u/16441391/Suggest/bg.png | |
* 2) http://dl.dropbox.com/u/16441391/Suggest/[email protected] | |
* 3) http://dl.dropbox.com/u/16441391/Suggest/separator.png | |
* 4) http://dl.dropbox.com/u/16441391/Suggest/[email protected] | |
* |
This file contains 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
/* | |
Learn the basics of Storekit with this example. | |
Before we can do anything in our app, we need to set up iTunesConnect! This process can be a little painful, but I will | |
guide you through it so you don't have to figure it out on your own. | |
Follow these steps: | |
1) Log in to your Apple Developer account at https://itunesconnect.apple.com/ | |
2) Click "Manage Your Applications". |
This file contains 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
pg_dump database -Fc backup.dump | |
pg_restore -l backup.dump | sed '/MATERIALIZED VIEW DATA/d' > restore.lst | |
pg_restore -L restore.lst -d database backup.dump | |
pg_restore -l backup.dump | grep 'MATERIALIZED VIEW DATA' > refresh.lst | |
pg_restore -L refresh.lst -d database backup.dump |