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 |
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
// Para compatibilidad con Android en modo automático | |
Ti.Geolocation.setAccuracy(Ti.Geolocation.ACCURACY_HIGH); | |
// Obtener ubicación por única vez | |
Ti.Geolocation.getCurrentPosition(function(e){ | |
alert("obteniendo por única vez: "+ | |
e.coords.latitude+","+e.coords.longitude); | |
}); | |
// Obtener ubicación cada que cambie |
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
$countries = array( | |
'AF' => 'AFG', | |
'AX' => 'ALA', | |
'AL' => 'ALB', | |
'DZ' => 'DZA', | |
'AS' => 'ASM', | |
'AD' => 'AND', | |
'AO' => 'AGO', | |
'AI' => 'AIA', | |
'AQ' => 'ATA', |
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
<?xml version="1.0" encoding="utf-8"?> | |
<resources> | |
<style name="Theme.NuevoTema" parent="Theme.AppCompat"> | |
<item name="colorPrimary">#1565C0</item> | |
<item name="colorPrimaryDark">#0D47A1</item> | |
<item name="colorAccent">#FF80AB</item> | |
<item name="colorControlNormal">#757575</item> | |
<item name="colorControlActivated">#FF6E40</item> | |
<item name="colorControlHighlight">#FF4081</item> | |
<item name="colorSwitchThumbNormal">#BDBDBD</item> |
OlderNewer