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 fill_select(id, values) { | |
$select = $(id); | |
$select[0].options.length = 0; | |
$ul = $select.parent().find('ul'); | |
$ul.html(''); | |
$.each(values, function(i, v) { | |
var index = $select[0].options.length; | |
$select[0].options[index] = new Option(v.text, v.value); | |
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
def group_by_foreign_model(): | |
""" | |
Example of the model: | |
class MyModel(Model): | |
foreign = models.ForeignKey(MyForeignModel) | |
""" | |
result = MyModel.objects.all() |
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
/** | |
* Generar y enviar el PDF | |
*/ | |
function generate_and_send() { | |
var file = generatePDF('comprobante.pdf'); | |
sendPDF(file); | |
} | |
/** | |
* Generar el PDF |
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
/** | |
* Ejemplo del modulo Ttiatium-Calenadar disponible en: | |
* | |
* https://github.com/stelford/Titanium-Calendar | |
*/ | |
var btnAgendarCal = Titanium.UI.createButton({ | |
backgroundImage: '/images/btnAgendarCal.png', | |
left: 10, | |
width: 144, |
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 TableView() { | |
var self = Ti.UI.createView(); | |
var data = [{title:"Row 1"},{title:"Row 2"}]; | |
var table = createTable('Pagadores', self, data); | |
self.add(table); | |
return self; | |
} |
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 addTitleToWin(win, title) { | |
// Si es la pantalla del home no se agrega titulo | |
//Ti.API.info("title WIN : " + title); | |
if (typeof title == 'undefined') { | |
return; | |
} | |
var titleLabel = Ti.UI.createLabel({ | |
text: title, | |
color: 'white', |
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 Picker = require("/commons/picker"); | |
var oPicker = new Picker(); | |
// | |
// create base UI tab and root window | |
// | |
var win = Titanium.UI.createWindow({ | |
title:'Ejemplo', | |
backgroundColor:'#fff' |
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 win = Ti.UI.createWindow(); | |
// Vistas de ejemplo | |
var view0 = Ti.UI.createView({ width: Ti.UI.FILL, height: 150, backgroundColor: 'red' }); | |
var view1 = Ti.UI.createView({ width: Ti.UI.FILL, height: 150, backgroundColor: 'brown' }); | |
var view2 = Ti.UI.createView({ width: Ti.UI.FILL, height: 150, backgroundColor: 'silver' }); | |
var view3 = Ti.UI.createView({ width: Ti.UI.FILL, height: 200, backgroundColor: 'blue' }); | |
var view4 = Ti.UI.createView({ width: Ti.UI.FILL, height: 200, backgroundColor: 'yellow' }); | |
var view5 = Ti.UI.createView({ width: Ti.UI.FILL, height: 200, backgroundColor: 'green' }); | |
var view6 = Ti.UI.createView({ width: Ti.UI.FILL, height: 200, backgroundColor: 'magenta' }); |
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
find . -name "*.jar" -exec sh -c 'unzip -l $1 | /usr/xpg4/bin/grep -q DESKeySpec' _ {} \; -print 2>/dev/null |
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
private EJBInterface getEJB() { | |
Hashtable h = new Hashtable(); | |
h.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory"); | |
h.put(Context.PROVIDER_URL, "t3://host:port"); | |
Context context; | |
try { | |
context = new InitialContext(h); | |
EJBHome home = | |
(EJBHome) context.lookup("<jndi_name>"); |
OlderNewer