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
| 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 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
| set selectedDevices to choose from list {"iPhone", "iPhone (Retina)", "iPad"} with prompt "Choose device type:" default items {"iPhone"} without multiple selections allowed | |
| if selectedDevices is not false then | |
| set selectedDevice to item 1 of selectedDevices as string | |
| set thePListFolderPath to path to preferences folder from user domain as string | |
| set thePListPath to thePListFolderPath & "com.apple.iphonesimulator.plist" | |
| tell application "System Events" | |
| tell property list file thePListPath | |
| tell contents | |
| set value of property list item "SimulateDevice" to selectedDevice |
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
| //////////////////////push_notifications.js/////////////////////// | |
| var apns = function(){ | |
| var pref = require('preferences').preferences; | |
| Titanium.Network.registerForPushNotifications({ | |
| types: [ | |
| Titanium.Network.NOTIFICATION_TYPE_BADGE, | |
| Titanium.Network.NOTIFICATION_TYPE_ALERT | |
| ], | |
| success:function(e) |
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 show_my_videos(data){ | |
| html = ['<ul id="youtube-videos">']; | |
| $(data.feed.entry).each(function(entry){ | |
| url = this.link[0].href; | |
| url_thumbnail = this.media$group.media$thumbnail[3].url; | |
| description = this.media$group.media$description.$t; | |
| html.push('<li><a href="'+url+'">'); | |
| html.push('<img src="'+url_thumbnail+'" alt="'+description+'">'); | |
| html.push('</a></li>'); | |
| }); |
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
| <?php | |
| /* Demonstration of problem with large integers in JSON, and | |
| a couple options for dealing with them as strings instead. | |
| ref: | |
| * http://php.net/manual/en/function.json-decode.php | |
| * http://stackoverflow.com/questions/2907806/handling-big-user-ids-returned-by-fql-in-php | |
| */ | |
| $json = <<<EOT |
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
| <?php | |
| /** | |
| * WordPress Query Comprehensive Reference | |
| * Compiled by luetkemj - luetkemj.com | |
| * | |
| * CODEX: http://codex.wordpress.org/Class_Reference/WP_Query | |
| * Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php | |
| */ | |
| $args = array( |
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
| /** | |
| * Handle Item Swipe | |
| * @param {Object} _event | |
| */ | |
| $.handleItemSwipe = function(_event) { | |
| var row = _event.source; | |
| var id = row.id; | |
| var controls = Alloy.createController("rowControls"); | |
| row.add(controls.wrapper); |
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
| // Sass Media Query Breakpoints | |
| // | |
| // METHOD 1 | |
| // | |
| // Inspired by http://thesassway.com/intermediate/responsive-web-design-in-sass-using-media-queries-in-sass-32 | |
| // | |
| // Usage: | |
| // | |
| // div { |
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 webView = Ti.UI.createWebView({ | |
| url: 'http://www.youtube.com/embed/' + myVideoID + '?autoplay=1&autohide=1&cc_load_policy=0&color=white&controls=0&fs=0&iv_load_policy=3&modestbranding=1&rel=0&showinfo=0', | |
| enableZoomControls: false, | |
| scalesPageToFit: false, | |
| scrollsToTop: false, | |
| showScrollbars: false | |
| }); |
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 is an example of use. | |
| // Here we use the new Bearer Token thats make it possible to get tweets without user login | |
| // More info on Bearer here: https://dev.twitter.com/docs/auth/application-only-auth | |
| // Full Codebird API is here: https://github.com/mynetx/codebird-js | |
| var Codebird = require("codebird"); | |
| var cb = new Codebird(); | |
| cb.setConsumerKey('CONSUMER_KEY', 'CONSUMER_SECRET_KEY'); | |
| var bearerToken = Ti.App.Properties.getString('TwitterBearerToken', null); |
OlderNewer