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
// INcluding memory management utils. | |
Ti.include('utils.js'); | |
// root window. | |
var win = Ti.UI.createWindow({ | |
backgroundColor:'white', | |
exitOnclose:true, | |
}); | |
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({ | |
backgroundColor:'white', | |
}); | |
var infile = Titanium.Filesystem.getFile('quixotebig.txt'); | |
var instream = infile.open(Titanium.Filesystem.MODE_READ); | |
var outfile = | |
Titanium.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory, 'quixote_base64.txt'); | |
var outstream = outfile.open(Titanium.Filesystem.MODE_WRITE); |
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
/** | |
* We're going to create an infinite scrollable list. In this case, we're going to show a date. When you swipe left, | |
* you'll see yesterday. Then the day before yesterday, and so on. Swiping right shows you tomorrow, and so on. | |
*/ | |
var win = Ti.UI.createWindow({ backgroundColor: '#fff' }); | |
var isAndroid = Ti.Platform.osname === 'android'; | |
/** | |
* Track where we are in the infinite scrollable views, and define how large of a step goes between each view. | |
*/ | |
var currentDate = new Date(), msIntervalBetweenViews = 1000/*ms*/ * 60/*s*/ * 60/*m*/ * 24/*h*/; |
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
Ti.include('utils.js'); | |
// Base window | |
var win = Ti.UI.createWindow(); | |
// Base launch button | |
var button = Ti.UI.createButton({ | |
title:'Press here', | |
top: 10, | |
left: 10, |
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 Dave | |
def start | |
puts 'Adentro de start' | |
def stop | |
puts 'Adentro de stop' | |
end | |
end | |
end |
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
def n_times(n) | |
#codigo | |
lambda {|val| n * val} | |
end | |
two_times = n_times(2) | |
puts two_times.call(3) | |