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 download(fileUrl, apiPath, callback) { | |
var url = require('url'), | |
http = require('http'), | |
p = url.parse(fileUrl), | |
timeout = 10000; | |
var file = fs.createWriteStream(apiPath); | |
var timeout_wrapper = function( req ) { | |
return function() { |
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 findViews = function(where, props, deep) { | |
var ctl = _.where(where.children, props); | |
if(deep){ | |
return _.reduce(where.children, function(memo, view) { | |
return memo.concat(findViews(view, props, true)); | |
}, ctl); | |
} else { | |
return ctl; | |
} | |
}; |
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 patches = require('patches'); | |
patches.fix_displayCaps(); |
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
// http://stackoverflow.com/a/17499889/506724 | |
package com.falkolab.drunkmode.platform; | |
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
import java.lang.reflect.Method; | |
import java.util.ArrayList; | |
import org.appcelerator.kroll.KrollProxy; |
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
exports.setMenuItemEnabled = function(menuItem, isEnabled) { | |
if(OS_ANDROID) { | |
if(Alloy.Globals.isAndroid3Plus && menuItem.actionView) { | |
menuItem.actionView.touchEnabled = isEnabled; | |
} | |
menuItem.setEnabled(isEnabled); | |
} | |
}; |
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 doClick(e) { | |
Alloy.createController("test").getView().open(); | |
} | |
$.index.open(); |
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 args = arguments[0] || {};var url = "https://api.github.com/search/repositories?q=pushed:>2015-09-01&order=desc"; | |
var page = 1, | |
loading = false; | |
function init() { | |
$.activityIndicator.show(); | |
load(function(items) { | |
$.list.setItems(transform(items)); | |
$.activityIndicator.hide(); |
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
Alloy.Globals.Android = Alloy.Globals.Android || {}; | |
_.extend(Alloy.Globals.Android.VERSION_CODES, { | |
CUR_DEVELOPMENT: 10000, | |
BASE: 1, | |
BASE_1_1: 2, | |
CUPCAKE: 3, | |
DONUT: 4, | |
ECLAIR: 5, | |
ECLAIR_0_1: 6, | |
ECLAIR_MR1: 7, |
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 moment = require('alloy/moment'); | |
// First add languages that support your application | |
var languages = ['ru', 'nl', 'fr', 'fr-ca']; | |
// Full language list: https://github.com/appcelerator/alloy/tree/master/Alloy/builtins/moment/lang | |
// You must explicit way to require language files in order to compiler saw their. | |
require('alloy/moment/lang/ru'); | |
require('alloy/moment/lang/nl'); | |
require('alloy/moment/lang/fr'); |
OlderNewer