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
<?php | |
/** | |
* imageColor | |
* | |
* Shows three methods to find the 'average' image color. | |
* | |
* Each function expects a gd image object. | |
* | |
* imageColor::averageResize($image) resizing to 1px, and checking the color. | |
* imageColor::averageBorder($image) find the average color of all border pixels. |
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
// jQuery.support.transition | |
// to verify that CSS3 transition is supported (or any of its browser-specific implementations) | |
$.support.transition = (function(){ | |
var thisBody = document.body || document.documentElement, | |
thisStyle = thisBody.style, | |
support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined; | |
return support; | |
})(); |
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 search = Titanium.UI.createSearchBar({ | |
barColor:'#000', | |
showCancel:true, | |
height:43, | |
top:0 | |
}); | |
var tableView = Titanium.UI.createTableView({ | |
top:40, | |
data:{title:'Please perform a search'} |
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' }); | |
var rotate = Ti.UI.create2DMatrix().rotate(90); | |
var counterRotate = rotate.rotate(-180); | |
var scrollView = Titanium.UI.createScrollableView({ | |
views:[ | |
Titanium.UI.createImageView({ image:'default_app_logo.png', transform: counterRotate }), | |
Titanium.UI.createImageView({ image:'KS_nav_ui.png', transform: counterRotate }), | |
Titanium.UI.createImageView({ image:'KS_nav_views.png', transform: counterRotate }) |
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
cachedImageView = function(basedir, uri, obj, attr, cacheage) { | |
/** | |
Appcelerator Titanium ImageView /w cache | |
This function attempts to cache a remote image and then returns it again | |
when it's requested. | |
The file is stored in a directory "basedir," this is to try and help | |
you keep files unique. It's not special or magical, but not dirty either. |
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 goes in your Info.plist | |
it's been a while since I added this functionality so I'm not sure what was added and what was already there, you may already have some pieces of the code. | |
When you tap and hold a mail attachment your app will show up in the list of associated apps and switch to your app when selected. | |
*/ | |
<key>CFBundleURLTypes</key> | |
<array> | |
<dict> |
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
// console dump of sample returned object | |
I/TiAPI ( 244): (kroll$4: app://app.js) [797,3312] Object | |
I/TiAPI ( 244): { | |
I/TiAPI ( 244): weatherData => Object | |
I/TiAPI ( 244): { | |
I/TiAPI ( 244): forecastInfo => Object | |
I/TiAPI ( 244): { | |
I/TiAPI ( 244): city => 'Bydgoszcz, Kuyavian-Pomeranian Voivodeship', |
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
//include StackMob & credentials module | |
var credentials = require('credentials').C; | |
var stackmob = require('stackmob-module.min'); | |
//create StackMob Client | |
var client = new stackmob.Client(credentials.STACKMOB_APP_NAME, credentials.STACKMOB_PUBLIC_KEY, credentials.STACKMOB_PRIVATE_KEY, credentials.STACKMOB_USER_OBJECT_NAME); | |
//login the user | |
client.login({ | |
'username' : "aaron-B1FBD26C-89B1-49E3-B4C4-F319493324DB", |
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 privateDocumentsDirectory(){ | |
Ti.API.info('We need to open a file object to get our directory info'); | |
var testFile = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory); | |
Ti.API.info('Now we remove the Documents folder reference'); | |
var privateDir = testFile.nativePath.replace('Documents/',''); | |
Ti.API.info('This is our base App Directory =' + privateDir); | |
Ti.API.info('Now we add the Private Documents Directory'); | |
privateDir+='Library/Private%20Documents/'; | |
Ti.API.info('Our new path is ' + privateDir); |
OlderNewer