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 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 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
using System; | |
using System.Diagnostics; | |
using System.Runtime.InteropServices; | |
namespace Dawson.Accessibility | |
{ | |
/// <summary> | |
/// Interaction logic for MouseHooker.xaml | |
/// Derived from http://blogs.msdn.com/b/toub/archive/2006/05/03/589468.aspx | |
/// </summary> |
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
tell application "System Events" | |
tell application "Terminal" to activate | |
keystroke "c" using {control down} | |
key code 126 | |
key code 52 | |
end tell |
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
/* | |
Define our various sizes. | |
*/ | |
var AndroidSizes = { | |
'android/images/res-ldpi/splash.9.png': 240, | |
'android/images/res-mdpi/splash.9.png': 360, | |
'android/images/res-hdpi/splash.9.png': 480, | |
'android/images/res-xhdpi/splash.9.png': 720, | |
'android/images/res-xxhdpi/splash.9.png': 960, | |
'android/images/res-xxxhdpi/splash.9.png': 1440 |
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
// create our web view | |
var win = Ti.UI.createWindow({ backgroundColor: "#fff" }); | |
var web = Ti.UI.createWebView({ url: "http://chicago.craigslist.org/" }); | |
// inject our css when the web view finishes loading (because we need to inject into the head element) | |
web.addEventListener('load', function () { | |
// first, specify the CSS file that we should load | |
var cssFileName = 'styles.css'; | |
// read in the contents | |
var cssFromFile = Ti.Filesystem.getFile(cssFileName); |
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
/* 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 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
Ti.include('overrideTabs.js'); | |
/* | |
This is a typical new project -- a tab group with three tabs. | |
*/ | |
var tabGroup = Ti.UI.createTabGroup(); | |
/* | |
Tab 1. |
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
/** | |
* XMLToJS Module 0.1 | |
* | |
* To use: | |
* var XMLToJS = require('xmlToJS'); | |
* var jsObject = XMLToJS.convert(xml); | |
* | |
* This will take XMl like the following: | |
* | |
<atom:feed xmlns:atom="http://www.w3.org/2005/Atom"> |
NewerOlder