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(){ | |
var bd = Ti.Database.open('baseDeDatosCompleta'); | |
bd.file.setRemoteBackup(false); | |
bd.execute('CREATE TABLE IF NOT EXISTS entradas(id INTEGER PRIMARY KEY, nombre TEXT, apellido TEXT);'); | |
var ventanaInicio = require('ventanaInicio'); | |
ventanaInicio(bd).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
//http://j.mp/ejemplomodulos | |
(function(){ | |
var db = Titanium.Database.open('tabla'); | |
db.execute('CREATE TABLE IF NOT EXISTS favoritos (fila INTEGER)'); | |
var tabla = require('tabla'); | |
var favoritos = require('favoritos'); | |
var tabGroup = Ti.UI.createTabGroup(); | |
var win1 = tabla(), |
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://j.mp/ejemplomodulos | |
(function(){ | |
var db = Titanium.Database.open('tabla'); | |
db.execute('CREATE TABLE IF NOT EXISTS favoritos (fila INTEGER)'); | |
var tabla = require('tabla'); | |
var favoritos = require('favoritos'); | |
var mapa = require('mapa'); | |
var tabGroup = Ti.UI.createTabGroup(); |
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
// The contents of this file will be executed before any of | |
// your view controllers are ever executed, including the index. | |
// You have access to all functionality on the `Alloy` namespace. | |
// | |
// This is a great place to do any initialization for your app | |
// or create any global variables/functions that you'd like to | |
// make available throughout your app. You can easily make things | |
// accessible globally by attaching them to the `Alloy.Globals` | |
// object. For example: | |
// |
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(){ | |
var Secundaria = require('secundaria'); | |
var ventana = Ti.UI.createWindow({ | |
backgroundColor: "white" | |
}); | |
var boton = Ti.UI.createButton({ | |
title: "Hola!" | |
}); |
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 formatPhone($phone){ | |
return preg_replace('~.*(\d{3})[^\d]*(\d{3})[^\d]*(\d{4})(.*).*~', '($1) $2-$3 $4', $phone). "\n"; | |
} |
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 click(){ | |
console.log($.tabla.data[0].rows); | |
console.log("Añadiendo row en posición 3"); | |
var fila = Ti.UI.createTableViewRow({ | |
title: "Fila adicional insertada" | |
}); | |
//http://www.w3schools.com/jsref/jsref_splice.asp | |
var filas = $.tabla.data[0].rows; |
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 xhr = Titanium.Network.createHTTPClient(); | |
xhr.open('GET', "http://www.notisistema.com/noticias/feed/"); | |
xhr.onload = function(e) { | |
var xml = this.responseXML; | |
if (xml === null || xml.documentElement === null) { | |
alert('Error. Respuesta vacia'); | |
return; | |
} | |
var items = xml.documentElement.getElementsByTagName('item'); | |
for (var i = 0; i < items.length; i++) { |
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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'aws-sdk' | |
class S3FolderUpload | |
attr_reader :folder_path, :total_files, :s3_bucket | |
attr_accessor :files |
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
Ti.Geolocation.getCurrentPosition(function(e){ | |
if(e.success){ | |
// Actualizamos etiqueta | |
$.ubicacion.setText(e.coords.longitude + ", " + e.coords.latitude); | |
var coordenadas = [e.coords.longitude, e.coords.latitude]; | |
// Actualizamos perfil de usuario | |
Cloud.Users.update({ | |
custom_fields: { | |
coordinates: coordenadas |