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({title: 'listview test', backgroundColor: 'white', extendEdges: [Ti.UI.EXTEND_EDGE_TOP]}); | |
var listView = Ti.UI.createListView({height:'90%', top:0}); | |
var sections = []; | |
var TOP_OFFSET = 64; | |
listView.setContentInsets({top:TOP_OFFSET}, {animated:false}); | |
var fruitSection = Ti.UI.createListSection({ headerTitle: 'Fruits'}); | |
var fruitDataSet = [ | |
{properties: { title: 'Apple'}}, |
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
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 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 'rubygems' | |
require 'urbanairship' | |
require 'httparty' | |
Urbanairship.application_key = '...' | |
Urbanairship.application_secret = '...' | |
Urbanairship.master_secret = '...' | |
response = Urbanairship.device_tokens |
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
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/Default@2x.png Resources/android/images/res-xhdpi/default.png |
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 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 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
module.exports = { | |
hyperloop: { | |
ios: { | |
xcodebuild: { | |
frameworks: [ | |
'iAd' | |
] | |
} | |
} | |
} |
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
... | |
workflows: | |
primary: | |
steps: | |
- activate-ssh-key@4.0.3: | |
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}' | |
- git-clone@4.0.17: {} | |
- script@1.1.5: | |
inputs: | |
- content: |- |
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
require 'rubygems' | |
require 'aws-sdk' | |
# This code snippet sends a push notification to a device using the Amazon SNS service. | |
# | |
# It is using the preview V2 amazon gem as per: | |
# https://aws.amazon.com/sdk-for-ruby/ | |
# | |
# This was installed using: | |
# $ gem install aws-sdk --pre |
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 class shows uses version 0.28.7 of the ruby google-api-client gem circa April 2019 | |
# to query the Google Play subscription API. | |
# | |
# If using an older version of the google-api-client gem (ie. version 0.8.x), instead refer to: | |
# https://gist.github.com/jkotchoff/e60fdf048ec443272045/e3e2c867633900d9d6f53de2de13aa0a0a16bb03 | |
# | |
# Sample usage: | |
# | |
# package_name = 'com.stocklight.stocklightapp' | |
# product_id = 'com.stocklight.stocklight.standardsubscription' |
OlderNewer