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
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(){ | |
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
// 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
//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
//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
(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
cat access_log |awk '{print $1}' |sort | uniq -c | sort -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
require 'rubygems' | |
require 'aws-sdk' | |
backup_dir = "/backup/cpbackup/" #end with / | |
users = "appspinc,arturo" #cpanel accounts to backup | |
users = users.split(",") | |
bucket = 'BUCKET_NAME' |
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
#from http://blog.divebomb.org/2012/01/ruby-sinatra-and-ssl/ | |
require 'sinatra/base' | |
require 'webrick' | |
require 'webrick/https' | |
require 'openssl' | |
name = "/C=US/ST=SomeState/L=SomeCity/O=Organization/OU=Unit/CN=localhost" | |
ca = OpenSSL::X509::Name.parse(name) | |
key = OpenSSL::PKey::RSA.new(1024) | |
crt = OpenSSL::X509::Certificate.new | |
crt.version = 2 |