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 Stephen Feather and other contributors. | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a | |
// copy of this software and associated documentation files (the | |
// "Software"), to deal in the Software without restriction, including | |
// without limitation the rights to use, copy, modify, merge, publish, | |
// distribute, sublicense, and/or sell copies of the Software, and to permit | |
// persons to whom the Software is furnished to do so, subject to the | |
// following conditions: | |
// |
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
/* | |
Migrated to: https://github.com/jdarling/Object.observe | |
Tested against Chromium build with Object.observe and acts EXACTLY the same, | |
though Chromium build is MUCH faster | |
Trying to stay as close to the spec as possible, | |
this is a work in progress, feel free to comment/update | |
http://wiki.ecmascript.org/doku.php?id=harmony:observe |
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 win = Ti.UI.createWindow(); | |
var images = []; | |
for(var i = 1; i < 100; i++){ | |
// Assuming all the images are called image1.jpg, image2.jpeg, etc... | |
images.push('/images/image'+i+'.jpg'); | |
} | |
var gallery = Gallery(images,0); |
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
<?xml version="1.0" ?><manifest android:versionCode="1" android:versionName="1" package="com.appcelerator.foo" xmlns:android="http://schemas.android.com/apk/res/android"> | |
<uses-sdk android:minSdkVersion="8"/> | |
<uses-sdk android:targetSdkVersion="14"/> | |
<!-- TI_MANIFEST --> | |
<application android:debuggable="false" android:icon="@drawable/appicon" android:label="Foo" android:name="FooApplication" android:theme="@android:style/Theme.Holo.Light"> | |
<!-- TI_APPLICATION --> |
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
/* | |
* I made this code for an upcoming hackaton, so, it's really, really ugly. Feel free | |
* to update it here so everyone will be able to use it correctly. | |
* | |
* It's pretty easy to understand, basicly the object you want to edit, an overlay, | |
* four handlers, and the background view. | |
* | |
* It's currently made for/tested on iPad 5.0 with Timob 2.0.2; works only in landscape. | |
* | |
* This code is under the Moustach licence. This means you can do whatever you want with |
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
- (void)clearWebViewCookies:(NSMutableArray*)cleardomain | |
{ | |
NSLog(@"[INFO] called webView clearWebViewCache to clear : %@", [cleardomain objectAtIndex:0]); | |
for(NSHTTPCookie *cookie in [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookies]) { | |
//NSLog(@"[INFO] cookie for : %@",[cookie domain]); | |
if([[cookie domain] isEqualToString:[cleardomain objectAtIndex:0]]) { | |
//NSLog(@"[INFO] deleting cookie for : %@",[cookie domain]); | |
[[NSHTTPCookieStorage sharedHTTPCookieStorage] deleteCookie:cookie]; | |
} | |
} |
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
- (void)clearWebViewCookies:(NSMutableArray*)cleardomain | |
{ | |
NSLog(@"[INFO] called webView clearWebViewCache to clear : %@", [cleardomain objectAtIndex:0]); | |
for(NSHTTPCookie *cookie in [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookies]) { | |
//NSLog(@"[INFO] cookie for : %@",[cookie domain]); | |
if([[cookie domain] isEqualToString:[cleardomain objectAtIndex:0]]) { | |
//NSLog(@"[INFO] deleting cookie for : %@",[cookie domain]); | |
[[NSHTTPCookieStorage sharedHTTPCookieStorage] deleteCookie:cookie]; | |
} | |
} |
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
/** | |
* Javascript example patterns | |
*/ | |
/** | |
* Singleton Object | |
* Should be used for global, static objects. You should not place memory | |
* intensive items in here unless they are meant to be used throughout the application | |
* at anytime. If the item is meant to be reused or instantiated multiple times | |
* a singleton should not be used. |
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
// I am pretty sure there is a sexier approach, but this works nicely | |
var isPhone5 = Ti.Platform.displayCaps.platformHeight == 568; | |
parse568hImages = function(imagePath) { | |
if (isPhone5){ | |
// Do this because the filename could contain dots | |
imagePath = imagePath.replace(".png","[email protected]"); | |
imagePath = imagePath.replace(".jpg","[email protected]"); | |
imagePath = imagePath.replace(".jpeg","[email protected]"); | |
} |
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
/** | |
* | |
* this code was inspired by the work done by David Riccitelli | |
* | |
* Copyright 2011 Aaron K. Saunders, Clearly Innovative Inc | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* |