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 isTablet(){ | |
| if(!Ti.Android){ | |
| return Ti.Platform.osname === 'ipad'; | |
| } | |
| // http://www.libtronics.com/2013/10/determining-if-device-is-tablet-on.html | |
| var height = Ti.Platform.displayCaps.platformHeight; | |
| var width = Ti.Platform.displayCaps.platformWidth; | |
| if (height < width){ | |
| var w_inch = height / Ti.Platform.displayCaps.xdpi; |
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
| type mogrify >/dev/null 2>&1 || { echo >&2 "» This script requires mogrify. Please install ImageMagick first!"; exit 1; } | |
| rm -rf Resources/android/images | |
| mkdir Resources/android/images | |
| mkdir Resources/android/images/res-xhdpi | |
| mkdir Resources/android/images/res-mdpi | |
| echo " » Copying the splash screen" | |
| cp Resources/iphone/Default.png Resources/android/images/res-mdpi/default.png | |
| cp Resources/iphone/[email protected] Resources/android/images/res-xhdpi/default.png |
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
| class GooglePlayVerification | |
| require 'google/api_client' | |
| # Refer: | |
| # https://code.google.com/p/google-api-ruby-client/issues/detail?id=72 | |
| # and | |
| # http://jonathanotto.com/blog/google_oauth2_api_quick_tutorial.html | |
| # and | |
| # http://milancermak.wordpress.com/2012/08/24/server-side-verification-of-google-play-subsc/ | |
| GOOGLE_KEY = 'xxx-xxx.apps.googleusercontent.com' |
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
| require 'rspec' | |
| def format_money(amount) | |
| '-1' #TODO | |
| end | |
| describe "format_money" do | |
| context "when the amount is a simple fraction" do | |
| subject{ 0.4 } | |
| specify{ format_money(subject).should == "$0.40" } |
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
| require 'net/http' | |
| # Extend img tag to optionally embed images in-line into HTML instead of referencing as a URI | |
| # | |
| # This is a useful technique when sending HTML emails as it circumvents the prompt many mail clients | |
| # present seeking permission to 'display images from this sender?' when an email of mime-type 'html' | |
| # contains <img> tags. | |
| # | |
| # ie. <%= image_tag('red_dot.gif', :embed_inline => "true") %> | |
| # |
NewerOlder