Skip to content

Instantly share code, notes, and snippets.

View marti1125's full-sized avatar
๐Ÿ

Willy Aguirre marti1125

๐Ÿ
View GitHub Profile
@marti1125
marti1125 / gist:5952979
Created July 8, 2013 22:19
backbone form example
var Campos = Backbone.Model.extend({
schema: {
idDocente:{ type: 'Hidden' , title: ''},
nombreDocente: { type: 'TextButton'},
fechaReasignacion : { type: 'DatePicker'}
}
});
var campos = new Campos();
@marti1125
marti1125 / gist:5996684
Created July 15, 2013 00:01
job verificar cantidad de productos
package jobs;
import java.util.List;
import models.Producto;
import play.jobs.*;
@Every("1mn")
public class VerificarCantidadDeProductos extends Job {
@marti1125
marti1125 / gist:6066734
Last active December 20, 2015 03:49
ConceptoDePlanilla
package models;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.Entity;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.Transient;
@marti1125
marti1125 / gist:6066778
Created July 23, 2013 22:36
Concept de planilla Index.hmlt
#{extends 'CRUD/index.html'/}
#{get 'moreScripts'}
<script type="text/javascript" src="@{generateForm('', true)}"></script>
#{/get}
<div id="formtipoEventualidades" data-backdrop="static" class="modelcustom2 hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">ร—</button>
<h3 id="myModalLabel">Agregar Concepto de Planilla</h3>
</div>
@marti1125
marti1125 / gist:6075107
Created July 24, 2013 22:13
extend index.html play framework
#{extends 'main.html' /}
#{set 'moreStyles'}
#{stylesheet 'backgrid.css'/}
#{stylesheet 'backgrid-filter.css'/}
#{if pagination}
#{stylesheet 'extensions/paginator/backgrid-paginator.css'/}
#{/if}
@marti1125
marti1125 / gist:6113997
Created July 30, 2013 15:28
backbone form event change
var centro = Backbone.Model.extend({
toString: function(){ return this.get("descripcion"); }
});
var centroCollection = Backbone.Collection.extend({
model: centro,
url: 'http://localhost:9000/Centros/lista'
});
var tipoDePlanilla = Backbone.Model.extend({
@marti1125
marti1125 / gist:6120290
Created July 31, 2013 08:20
backgrid example
var Eventualidad = Backbone.Model.extend({});
var Eventualidades = Backbone.PageableCollection.extend({
mode: "client",
state: {
firstPage: 0,
currentPage: 0,
totalRecords: 20,
pageSize: 10,
sortKey: "updated",
var horas = ['07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21'];
var minutos = [':00',':05',':10',':15',':20',':25',':30',':35',':40',':45',':50',':55']
var merged
var resultados = [];
for(h = 0; h < horas.length; h++){
for(i = 0; i < minutos.length; i++){
merged = horas[h].concat(minutos[i]);
resultados.push([merged,merged]);
@marti1125
marti1125 / gist:6168981
Created August 6, 2013 21:43
backboneform
var conceptoDePlanilla = Backbone.Model.extend({
toString: function(){ return this.get("descripcion"); }
});
var conceptoDePlanillaCollection = Backbone.Collection.extend({
model: conceptoDePlanilla,
url: 'conceptodeplanillas/lista/'
});
var chosen = _.template('<div class="control-group" data-editor><label class="control-label" for="<%= editorId %>"><%= title %></label></div>');
@marti1125
marti1125 / gist:6313617
Created August 22, 2013 22:30
calculate hours
Number.prototype.pad = function (len) {
return (new Array(len+1).join("0") + this).slice(-len);
}
var rumboAGrau = new Date('1988','01','01',''+result.GRAU[i].substr(0,2)+'',''+result.GRAU[i].substr(3,5)+'')
var rumboAGrauHora = rumboAGrau.getHours().pad(2) + ":"
+ rumboAGrau.getMinutes().pad(2);